Search Results

Search found 18361 results on 735 pages for 'hibernate search'.

Page 71/735 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • How to configure LocalSessionFactoryBean to release connections after transaction end?

    - by peter
    I am testing an application (Spring 2.5, Hibernate 3.5.0 Beta, Atomikos 3.6.2, and Postgreql 8.4.2) with the configuration for the DAO listed below. The problem that I see is that the pool of 10 connections with the dataSource gets exhausted after the 10's transaction. I know 'hibernate.connection.release_mode' has no effect unless the session is obtained with openSession rather then using a contextual session. I am wandering if anyone has found a way to configure the LocalSessionFactoryBean to release connections after any transaction. Thank you Peter <bean id="dataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close"> <property name="uniqueResourceName"><value>XADBMS</value></property> <property name="xaDataSourceClassName"> <value>org.postgresql.xa.PGXADataSource</value> </property> <property name="xaProperties"> <props> <prop key="databaseName">${jdbc.name}</prop> <prop key="serverName">${jdbc.server}</prop> <prop key="portNumber">${jdbc.port}</prop> <prop key="user">${jdbc.username}</prop> <prop key="password">${jdbc.password}</prop> </props> </property> <property name="poolSize"><value>10</value></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="mappingResources"> <list> <value>Abc.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop> <prop key="hibernate.show_sql">on</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.connection.isolation">3</prop> <prop key="hibernate.current_session_context_class">jta</prop> <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</prop> <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop> <prop key="hibernate.connection.release_mode">auto</prop> <prop key="hibernate.transaction.auto_close_session">true</prop> </props> </property> </bean> <!-- Transaction definition here --> <bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp" init-method="init" destroy-method="shutdownForce"> <constructor-arg> <props> <prop key="com.atomikos.icatch.service"> com.atomikos.icatch.standalone.UserTransactionServiceFactory </prop> </props> </constructor-arg> </bean> <!-- Construct Atomikos UserTransactionManager, needed to configure Spring --> <bean id="AtomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close" depends-on="userTransactionService"> <property name="forceShutdown" value="false" /> </bean> <!-- Also use Atomikos UserTransactionImp, needed to configure Spring --> <bean id="AtomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp" depends-on="userTransactionService"> <property name="transactionTimeout" value="300" /> </bean> <!-- Configure the Spring framework to use JTA transactions from Atomikos --> <bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager" depends-on="userTransactionService"> <property name="transactionManager" ref="AtomikosTransactionManager" /> <property name="userTransaction" ref="AtomikosUserTransaction" /> </bean> <!-- the transactional advice (what 'happens'; see the <aop:advisor/> bean below) --> <tx:advice id="txAdvice" transaction-manager="txManager"> <tx:attributes> <!-- all methods starting with 'get' are read-only --> <tx:method name="get*" read-only="true" propagation="REQUIRED"/> <!-- other methods use the default transaction settings (see below) --> <tx:method name="*" propagation="REQUIRED"/> </tx:attributes> </tx:advice> <aop:config> <aop:advisor pointcut="execution(* *.*.AbcDao.*(..))" advice-ref="txAdvice"/> </aop:config> <!-- DAO objects --> <bean id="abcDao" class="test.dao.impl.HibernateAbcDao" scope="singleton"> <property name="sessionFactory" ref="sessionFactory"/> </bean>

    Read the article

  • ASP.NET MVC search box: use modal popup or inline div or redirect to another page?

    - by JK
    I have a view with a textbox and a search button, eg CustomerTextBox and CustomerSearchButton. The list of customers is too long to display in a dropdown, and there has to be advanced search functions anyway. What is the best practice in MVC to handle this case? When the user clicks on the search button, should it: A. Load another view into a modal popup (eg /customers/search)? How would you do this in MVC, just set popupWindow.location.href = '/customers/search'? How would you return the value to the main view? B. Have the search form in a hidden div that expands when the search button is clicked? How would be done? a partial view maybe? C. Redirect the user to a search page by means of RedirectTo("/customers/search")? How would you return the value to the main class? I've only been doing MVC for 3 days so thanks to those who answer my questions that might have quite obvious answers that I cant see yet. :)

    Read the article

  • How to use JTA support in Tomcat 6 for Hibernate ?

    - by EugeneP
    They recommend using JTA transaction support in JEE environment. But how to configure JTA in Tomcat6 so that Hibernate Session could use it ? Starting with version 3.0.1, Hibernate added the SessionFactory.getCurrentSession() method. Initially, this assumed usage of JTA transactions, where the JTA transaction defined both the scope and context of a current session. Given the maturity of the numerous stand-alone JTA TransactionManager implementations, most, if not all, applications should be using JTA transaction management, whether or not they are deployed into a J2EE container. Based on that, the JTA-based contextual sessions are all you need to use.

    Read the article

  • Full Text Search MSSQL2008 show wrong display_item for Thai Language

    - by ensecoz
    I am working on MSSQL2008. My task is to investigate the issue that why FTS cannot find the right result for Thai. First, I am having the table which enable the FTS on the column 'ItemName' which is nvarchar. The Catalog is created with the Thai Language. Note that, Thai language is one of the language that doesn't separate the word by space so '????' '???' '????' are written like this in the sentence '???????????' In the table, there are many rows that include the word (????) for examples row#1 (ItemName: '???????????') On the webpage, I try to search for '????' but SQLServer cannot find it. So I try to investigate it by trying the following query in SQLServer select * from sys.dm_fts_parser(N'"???????????"', 1054, 0, 0) To see how the words are broken. The first one is the text to be break. The second parameter is specify that using Thai (WorkBreaker, so on). and here is the result: row#1 (display_item: '????', source_item: '???????????') row#2 (display_item: '????', source_item: '???????????') row#3 (display_item: '??', source_item: '???????????') Notice that the first and second row display the worng display_item '?' in the '????' isn't even Thai characters. '?' in '????' is not Thai charater either. So the question is where is those alien characters come from? I guess this i why I cannot search for '????' because the word breaker is mis-borken and keeping the wrong character in the indexes. Please help!

    Read the article

  • "SELECT ... FOR UPDATE" not working for Hibernate and MySQL

    - by Andres Rodriguez
    Hi, We have a system in which we must use pessimistic locking in one entity. We are using hibernate, so we use LockMode.UPGRADE. However, it does not lock. The tables are InnoDB We have checked that locking works correctly in the database (5.0.32), so this bug http://bugs.mysql.com/bug.php?id=18184 seems to be no problem. We have checked that datasource includes the autoCommit = false parameter. We have checked that the SQL hibernate (version 3.2) generates includes the " FOR UPDATE". Thanks,

    Read the article

  • How to user Hibernate @Valid constraint with Spring 3.x?

    - by Burak Dede
    I am working on simple form to validate fields like this one. public class Contact { @NotNull @Max(64) @Size(max=64) private String name; @NotNull @Email @Size(min=4) private String mail; @NotNull @Size(max=300) private String text; } I provide getter and setters hibernate dependencies on my classpath also.But i still do not get the how to validate simple form there is actually not so much documentation for spring hibernate combination. @RequestMapping(value = "/contact", method = RequestMethod.POST) public String add(@Valid Contact contact, BindingResult result) { .... } Could you explain it or give some tutorial , except original spring 3.x documentation

    Read the article

  • Mysql german accents not-sensitive search in full-text searches

    - by lukaszsadowski
    Let`s have a example hotels table: CREATE TABLE `hotels` ( `HotelNo` varchar(4) character set latin1 NOT NULL default '0000', `Hotel` varchar(80) character set latin1 NOT NULL default '', `City` varchar(100) character set latin1 default NULL, `CityFR` varchar(100) character set latin1 default NULL, `Region` varchar(50) character set latin1 default NULL, `RegionFR` varchar(100) character set latin1 default NULL, `Country` varchar(50) character set latin1 default NULL, `CountryFR` varchar(50) character set latin1 default NULL, `HotelText` text character set latin1, `HotelTextFR` text character set latin1, `tagsforsearch` text character set latin1, `tagsforsearchFR` text character set latin1, PRIMARY KEY (`HotelNo`), FULLTEXT KEY `fulltextHotelSearch` (`HotelNo`,`Hotel`,`City`,`CityFR`,`Region`,`RegionFR`,`Country`,`CountryFR`,`HotelText`,`HotelTextFR`,`tagsforsearch`,`tagsforsearchFR`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci; In this table for example we have only one hotel with Region name = "Graubünden" (please note umlaut ü character) And now I want to achieve same search match for phrases: 'graubunden' and 'graubünden' This is simple with use of MySql built in collations in regular searches as follows: SELECT * FROM `hotels` WHERE `Region` LIKE CONVERT(_utf8 '%graubunden%' USING latin1) COLLATE latin1_german1_ci This works fine for 'graubunden' and 'graubünden' and as a result I receive proper result, but problem is when we make MySQL full text search Whats wrong with this SQL statement?: SELECT * FROM hotels WHERE MATCH (`HotelNo`,`Hotel`,`Address`,`City`,`CityFR`,`Region`,`RegionFR`,`Country`,`CountryFR`, `HotelText`, `HotelTextFR`, `tagsforsearch`, `tagsforsearchFR`) AGAINST( CONVERT('+graubunden' USING latin1) COLLATE latin1_german1_ci IN BOOLEAN MODE) ORDER BY Country ASC, Region ASC, City ASC This doesn`t return any result. Any ideas where the dog is buried ?

    Read the article

  • SEM/SEO tasks doubts

    - by Josemalive
    Hello, Actually i think that i have an strong knowledge of SEO, but im having some doubts about the following: I will have to increase the position in Google of certain product pages of a company in the next months. I supposed that not only will be sufficient the following tasks: Improve usability of those pages. Change the pages title. Add meta description and keywords. Url's in a REST way. 301's http header to dont lose page rank for the new URLS Optimizing content for Google. Configure links of the website (follow and no follow attributes) Get more inbounds links (Link building tasks). Create RSS. Put main website in Twitter (using twitter feed) using the RSS. Put main website in Facebook. Create a Youtube channel. Invest in Adwords. Invest in other online advertising companies. Use sitemap.xml and Google Webmaster tools. Use Google Trends to analyze the volume of searches of certain keywords. Use Google Analytics to analyze weak points and good points of your site, and find new oportunities in keywords. Use tools to find new keywords related with your content. Do you have some internet links, or knowledge about all the tasks that a SEO Expert should do? Could you share some knowledge about what kind of business could be do with another companies (B2B) to increase the search engine position of those product pages. Do you know more tecniques about how to get more inbound links? (i only know the link interchange) Thanks in advance. Best Regards. Jose.

    Read the article

  • Hibernate: How do I link a subclass to its superclass?

    - by Markus
    Hey there! I'm having a little problem setting up my webshop project. Thing is, I have a User() superclass and two subclasses, PrivateUser and BusinessUser. Now, I'm not quite sure how to get my head around storing this relationship via hibernate. For the purpose of this question, the User() class contains only one field: String address; the PrivateUser contains: String firstName; and the BusinessUser contains: String CompanyName; Each field has its getter and setter. As is right now, I would only store and be able to get firstName and companyName. When I fetch a user from my DB using Hibernate I would get a PrivateUser/BusinessUser with a null address. Bottom line is, could someone point me towards a useful tutorial or better yet show a similar example code? Thanks!

    Read the article

  • How Search Engine Bots Crawl Forums?

    - by Waleed Eissa
    If I have a forums site with a large number of threads, will the search engine bot crawl the whole site every time? Say I have over 1,000,000 threads in my site, will they get crawled every time the bot crawls my site? or how does it work? I want my website to be indexed but I don't want the bot to kill my website! In other words I don't want the bot to keep crawling the old threads again and again every time it crawls my website. Also, what about the pages crawled before? Will the bot request them every time it crawls my website to make sure they are still on the site? I'm asking this because I only link to the latest threads, i.e. there's a page that contains a list of all the latest threads, but I don't link to the older threads, they have to be explicitly requested by URL, e.g. http://www.mysite.com/showthread.aspx?threadid=7 , will this work to stop the bot from bringing my site down and consuming all my bandwidth? P.S. The site is still under development but I want to know in order to design the site so that search engine bots don't bring it down. Thanks

    Read the article

  • Full Text Search in SQL Server 2008 shows wrong display_item for Thai language

    - by ensecoz
    I am working with SQL Server 2008. My task is to investigate the issue where FTS cannot find the right result for Thai. First, I have the table which enables the FTS on the column 'ItemName' which is nvarchar. The Catalog is created with the Thai Language. Note that the Thai language is one of the languages that doesn't separate the word by spaces, so '????' '???' '????' are written like this in a sentence: '???????????' In the table, there are many rows that include the word (????); for example row#1 (ItemName: '???????????') On the webpage, I try to search for '????' but SQL Server cannot find it. So I try to investigate it by trying the following query in SQL Server: select * from sys.dm_fts_parser(N'"???????????"', 1054, 0, 0) ...to see how the words are broken. The first one is the text to be broken. The second parameter is to specify that we're using Thai (WorkBreaker, so on). Here is the result: row#1 (display_item: '????', source_item: '???????????') row#2 (display_item: '????', source_item: '???????????') row#3 (display_item: '??', source_item: '???????????') Notice that the first and second row display the wrong display_item '?' in the '????' isn't even Thai characters. '?' in '????' is not a Thai character either. So the question is where did those alien characters come from? I guess this why I cannot search for '????' because the word breaker is broken and keeping the wrong character in the indexes. Please help!

    Read the article

  • How do I share a Hibernate SessionFactory across web applications?

    - by Jer
    I have two web applications that are running on a single Tomcat server and are connected to the same database with Hibernate. I am concerned that having two SessionFactory instances running around might cause some issues. Also, since both web applications share much of the same application logic, I thought it would be a good idea to centralize as much as I could. And since I use Spring for DI and Hibernate configuration it would make sense to have a single ApplicationContext as well. How would I go about doing something like this? Do I need to deploy a headless WAR that creates an ApplicationContext and thus a SessionFactory and allow each application access to it? Is this even a good idea?

    Read the article

  • Full Text Search in MSSQL2008 shows wrong display_item for Thai language

    - by ensecoz
    I am working with MSSQL2008. My task is to investigate the issue where FTS cannot find the right result for Thai. First, I have the table which enables the FTS on the column 'ItemName' which is nvarchar. The Catalog is created with the Thai Language. Note that the Thai language is one of the languages that doesn't separate the word by spaces, so '????' '???' '????' are written like this in a sentence: '???????????' In the table, there are many rows that include the word (????); for example row#1 (ItemName: '???????????') On the webpage, I try to search for '????' but SQLServer cannot find it. So I try to investigate it by trying the following query in SQLServer: select * from sys.dm_fts_parser(N'"???????????"', 1054, 0, 0) ...to see how the words are broken. The first one is the text to be broken. The second parameter is to specify that we're using Thai (WorkBreaker, so on). Here is the result: row#1 (display_item: '????', source_item: '???????????') row#2 (display_item: '????', source_item: '???????????') row#3 (display_item: '??', source_item: '???????????') Notice that the first and second row display the wrong display_item '?' in the '????' isn't even Thai characters. '?' in '????' is not a Thai character either. So the question is where did those alien characters come from? I guess this why I cannot search for '????' because the word breaker is broken and keeping the wrong character in the indexes. Please help!

    Read the article

  • highlighting search results in php/mysql

    - by fusion
    how do i highlight search results from mysql query using php? this is my code: $search_result = ""; $search_result = $_GET["q"]; $result = mysql_query('SELECT cQuotes, vAuthor, cArabic, vReference FROM thquotes WHERE cQuotes LIKE "%' . $search_result .'%" ORDER BY idQuotes DESC', $conn) or die ('Error: '.mysql_error()); function h($s) { echo htmlspecialchars($s, ENT_QUOTES); } ?> <div class="center_div"> <table> <caption>Search Results</caption> <?php while ($row= mysql_fetch_array($result)) { ?> <tr> <td style="text-align:right; font-size:15px;"><?php h($row['cArabic']) ?></td> <td style="font-size:16px;"><?php h($row['cQuotes']) ?></td> <td style="font-size:12px;"><?php h($row['vAuthor']) ?></td> <td style="font-size:12px; font-style:italic; text-align:right;"><?php h($row['vReference']) ?></td> </tr> <?php } ?> </table> </div>

    Read the article

  • How to detect open database connection with Hibernate / JPA?

    - by John K
    I am learning JPA w/Hibernate using a Java SE 6 project. I'd simply like to be able to detect if the connection between Hibernate and my database (MS SQL Server) is open. For example, I'd like to be able to detect this, log it, and try reconnecting again in 60 seconds. This is what I thought would work but isOpen() doesn't appear to be what I want (always is true): EntityManagerFactory emf = Persistence.createEntityManagerFactory("rcc", props); if (emf != null && emf.isOpen()) { EntityManager em = emf.createEntityManager(); if (em == null || !emf.isOpen()) // error connecting to database else ... This seems to me to be a simple problem, but I cannot find an answer!

    Read the article

  • Hibernate constraint ConstraintViolationException. Is there an easy way to ignore duplicate entries?

    - by vincent
    Basically I've got the below schema and I'm inserting records if they don't exists. However when it comes to inserting a duplicate it throws and error as I would expect. My question is whether there is an easy way to make Hibernate to just ignore inserts which would in effect insert duplicates? CREATE TABLE IF NOT EXISTS `method` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(10) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; SEVERE: Duplicate entry 'GET' for key 'name' Exception in thread "pool-11-thread-4" org.hibernate.exception.ConstraintViolationException: could not insert:

    Read the article

  • How to search a PDF in Acrobat Reader AND jump to a certain page via parameter?

    - by agez
    Hi, we are using lucene within a web application to search in a great number of PDF documents. The workflow is like this: A user enters a search term A list of search results is presented to the user. Each search result represents one PDF document and shows the user on which page the search term was found. Each of these pages is represented as a hyperlink. If the user now clicks on such a hyperlink, he directly jumps to that page. But now the user has the problem that the search term isn't highlighted on the page. Therefore the user has to look on his own to find the search term on the page. What we wanted is a way to highlight the search term on the specific page in the PDF. The open parameters for Acrobat Reader allow for either searching a PDF document (with hit highlighting) OR jumping to a specific page. But the combination of both parameters - which we would need - doesn't work. Does anyone have an idea how jumping to a page and highlighting a search term in a pdf document could work? I had a look at the Acrobat SDK but don't see how we can use it (it's terribly documented). Cheers, Helmut

    Read the article

  • Combine Hibernate class with @Bindable for SwingBuilder without Griffon?

    - by Misha Koshelev
    Dear All: I have implemented a back-end for my application in Groovy/Gradle, and am now trying to implement a GUI. I am using Hibernate for my data storage (with HSQLDB) per http://groovy.codehaus.org/Using+Hibernate+with+Groovy (with Jasypt for encryption) and it is working quite well. I was wondering if there are any good tips for using @Bindable with, e.g., an @Entity class such as @Entity class Book { @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long id @OneToMany(cascade=CascadeType.ALL) public Set<Author> authors public String title String toString() { "$title by ${authors.name.join(', ')}" } } or if I am: (i) asking for Griffon (ii) completely on the wrong track? Thank you! Misha

    Read the article

  • C++ find largest BST in a binary tree

    - by fonjibe
    what is your approach to have the largest BST in a binary tree? I refer to this post where a very good implementation for finding if a tree is BST or not is bool isBinarySearchTree(BinaryTree * n, int min=std::numeric_limits<int>::min(), int max=std::numeric_limits<int>::max()) { return !n || (min < n->value && n->value < max && isBinarySearchTree(n->l, min, n->value) && isBinarySearchTree(n->r, n->value, max)); } It is quite easy to implement a solution to find whether a tree contains a binary search tree. i think that the following method makes it: bool includeSomeBST(BinaryTree* n) { if(!isBinarySearchTree(n)) { if(!isBinarySearchTree(n->left)) return isBinarySearchTree(n->right); } else return true; else return true; } but what if i want the largest BST? this is my first idea, BinaryTree largestBST(BinaryTree* n) { if(isBinarySearchTree(n)) return n; if(!isBinarySearchTree(n->left)) { if(!isBinarySearchTree(n->right)) if(includeSomeBST(n->right)) return largestBST(n->right); else if(includeSomeBST(n->left)) return largestBST(n->left); else return NULL; else return n->right; } else return n->left; } but its not telling the largest actually. i struggle to make the comparison. how should it take place? thanks

    Read the article

  • django simple approach to multi-field search

    - by Scott Willman
    I have a simple address book app that I want to make searchable. The model would look something like: class Address(models.Model): address1 = models.CharField("Address Line 1", max_length=128) address2 = models.CharField("Address Line 2", max_length=128) city = models.CharField("City", max_length=128) state = models.CharField("State", max_length=24) zipCode = models.CharField("Zip Code", max_length=24) def __unicode__(self): return "%s %s, %s, %s, %s" % (self.address1, self.address2, self.city, self.state, self.zipCode) class Entry(models.Model): name = models.CharField("Official School Name", max_length=128) createdBy = models.ForeignKey(User) address = models.ForeignKey(Address, unique=True) def __unicode__(self): return "%s - %s, %s" % (self.name, self.address.city, self.address.state) I want the searching to be fairly loose, like: Bank of America Los Angeles 91345. It seems like I want a field that contains all of those elements into one that I can search, but that also seems redundant. I was hoping I could add a method to the Entry model like this: def _getSearchText(self): return "%s %s %s" % (self.name, self.address, self.mascot) searchText = property(_getSearchText) ...and search that as a field, but I suppose that's wishful thinking... How should I approach this using basic Django and SqLite (this is a learning exercise). Thank you!!

    Read the article

  • Is there a way to combine streaming data retrieval with hibernate?

    - by Steve B.
    For the purposes of handling very large collections (and by very large I just mean "likely to throw OutOfMemory exception"), it seems problematic to use Hibernate because normally collection retrieval is done in a block, i.e. List values=session.createQuery("from X").list(), where you monolithically grab all N-million values and then process them. What I'd prefer to do is to retrieve the values as an iterator so that I grab 1000 or so (or whatever's a reasonable page size) at a time. Apart from writing my own iteration (which seems like it's likely to be re-inventing the wheel) is there a hibernate-native way to handle this?

    Read the article

  • How to map a property for HQL usage only (in Hibernate)?

    - by ManBugra
    i have a table like this one: id | name | score mapped to a POJO via XML with Hibernate. The score column i only need in oder by - clauses in HQL. The value for the score column is calculated by an algorithm and updated every 24 hours via SQL batch process (JDBC). So i dont wanna pollute my POJO with properties i dont need at runtime. For a single column that may be not a problem, but i have several different score columns. Is there a way to map a property for HQL use only? For example like this: <property name="score" type="double" ignore="true"/> so that i still can do this: from Pojo p order by p.score but my POJO implementation can look like this: public class Pojo { private long id; private String name; // ... } No Setter for score provided or property added to implementation. using the latest Hibernate version for Java.

    Read the article

  • What should I do in order to be able to work with maven + eclipse + wicket + hibernate + spring in M

    - by spderosso
    I want to create a web app that will use wicket, hibernate and spring frameworks. My IDE of choice is Eclipse, I am using maven for the .war generation and I am running Mac OS. What steps should I follow to correctly install and configure all the tools so as to have a project running that relies on these 3 frameworks. I was able to successfully set up wicket but I am having trouble for setting up hibernate and spring. I went through multiple tutorials but I still couldn't find the solution. Thanks!

    Read the article

  • How does hibernate use an empty string for an equality restriction?

    - by Stephen
    I have a column that potentially has some bad data and I can't clean it up, so I need to check for either null or empty string. I'm doing a Hibernate Criteria query so I've got the following that returns incorrectly right now: Session session = getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); Criteria myCriteria = session.createCriteria(Object); ... myCriteria.add(Restrictions.or(Restrictions.isNull("stringColumn"), Restrictions.eq("stringColumn", ""))); List<Objects> list = myCriteria.list(); I can't get it to properly return the results I'd expect. So as an experiment I changed the second restriction to read: Restrictions.eq("stringColumn", "''") And it started returning the expected results, so is hibernate incorrectly translating my empty string (e.g. "") into a SQL empty string (e.g. ''), or am I just doing this wrong?

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >