Hibernate spring integration session factory null pointer exception
I am developing a Struts 2-Spring 3-Hibernate 4 integrated web application.Whenever I run the application on web server it is always giving Null Pointer exception because of Session Factory being null....
View ArticleReduce number of queries when using bags
Code: <hibernate-mapping package="sandbox"> <class name="person" table="PERSON"> <id name="id" /> <property name="name" /> <joined-subclass name="child"...
View ArticleHibernate Spring Struts Integration Problem
I am integrating Struts 2-Spring 3-Hibernate 4 application. Please suggest some solution. I am getting following error: Stacktrace org.springframework.beans.factory.BeanCreationExce ption: Error...
View ArticleProblem in mapping multiples databse tables with same schema to single pojo...
I hava a pojo class in which I am using Hibernate annotation. In my database I have two tables with similiar schema. I want to know whether there is any way in hibernate annotation so that same pojo...
View ArticleHibernate annotation non auto increment primary key column
I want to map a column from my database as primary key which is not auto-increment. Please suggest me how to create hibernate annotation for this column
View ArticleHow can i do?
hi all i am so new to work with hibernate and in the first steps this is the guidance of the tutorial but i dont know how i can do so: Installing Hibernate Once you downloaded and unzipped the latest...
View Articleis order important?
hi all is it important to care about matching the order of defining the properties in xml file of each class as the order of attributes of table in DB?
View ArticleWhat is ServiceRegistry in Hibernate 4??
Configuration config=new Configuration(); config.configure(); ServiceRegistry registry=new ServiceRegistryBuilder().applySettings(config.getP roperties()).buildServiceRegistry(); SessionFactory...
View ArticleWhy not use sets and/or map but Hibernate?
Hi to all, I'm new to Hibernate thus what I can do is to pose a newbie question :D: My question is: why not use Java data structures instead of Hibernate? Hibernate guarantees persistence of data on...
View ArticleAdvantages of advanced J2EE
Hi, 3 concepts available in the advanced J2EE, 1) STruts 2) Hibernate 3) Spring 1) STruts replacing the JSP concepts. Struts has separate tags like HTML so its called as framework and also opensource...
View Articleloading on demand in a new session
Hello! Consider getting a collection of entities within an opened session. We only get collection , but not loading data from it(by performing load operations:e.g. iterate on collection). After close...
View ArticleMany-to-many with extra columns
Hi! I have mapping like : Code: @Entity @Table(name = "exit_codes") public class ExitCodesEntity { private Integer exitId; private String description; private...
View Article[Hibernate] data isn't showed at JSP page
Hi, Today happened a strange problem in my app. Hibernate accessed the database correctly (without errors), but NOTHING was showed in my screen (JSP). So, I accessed the tomcat server and "stoped" the...
View ArticleError ORA-01795 "maximum number of expressions in a list is 1000"
Hi the team, I'm facing a problem which cannot find its solution. I have a query which must contain a big set of values, greater than 100. With Java and Hibernate, if i want to filter my value, i have...
View ArticleSpring/Hibernate + java.lang.StackOverflowError?
I have an app with a many-to-many relationship between entities (Product, Order) , the intermediary table is ProductOrder Code: for(Item item : items) { ProductOrder po = new...
View ArticleAdvantage Hibernate over JDBC
The question is simple. Where is the advantage when using Hibernate over JDBC? Infact I see JDBC code is more systematic and clearer than Hibernate code. How does having Hibernate less amount of code...
View ArticleHow to select database at runtime in hibernate
I am working on web application which is in hibernate and jsp, servlet . There are different database for each user.I have to modify it in a way that on user login it should select database which is...
View ArticleSolve LazyInitializationException in spring, hibernate ?
I have a Spring app , many to many relationship between Order and Product with intermediary ProductOrder. If I save the ProductOrder directly to the db, it works fine, but I don't think that's the...
View ArticleHibernate Mappings
My question is: In the different types of mappings(one-one, one-many, many-one, many-many) the extra column should be on which side of the relationship? No tutorial seems to explain it. Is there any...
View ArticleWill HQL query use Hibernate Secondary cache
I would like to clarify some points regrading the secondary level cache of hibernate. The point to clarify is, will the HQL queries always hit the database (at least for getting ids). Consider we have...
View Article