Alternative entity representation table=”ITEM_ENTITY”> … … Obviously, you

Alternative entity representation table=”ITEM_ENTITY”> … Obviously, you also need the two classes, model.ItemPojo and model.UserPojo, that implement the properties of these entities. You still base the many-to-one and one-to-many associations between the two entities on logical names. Hibernate will primarily use the logical names from now on. For example, the following code does not work: UserPojo user = new UserPojo(); … ItemPojo item1 = new ItemPojo(); … ItemPojo item2 = new ItemPojo(); … Collection itemsForSale = new ArrayList(); … session.save(user); The preceding example creates a few objects, sets their properties, and links them, and then tries to save the objects through cascading by passing the user instance to save(). Hibernate inspects the type of this object and tries to figure out what entity it is, and because Hibernate now exclusively relies on logical entity names, it can t find a mapping for model.UserPojo. You need to tell Hibernate the logical name when working with a mixed representation mapping: … session.save(”UserEntity”, user); Once you change this line, the previous code example works. Next, consider loading, and what is returned by queries. By default, a particular SessionFactory
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.