Object Relational Mappers: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 3: | Line 3: | ||
* If you specify a many-to-one or one-to-many mapping, be sure to use the same mapping as the Java collection interface. A Set mapping won't work with a List collection, for example. | * If you specify a many-to-one or one-to-many mapping, be sure to use the same mapping as the Java collection interface. A Set mapping won't work with a List collection, for example. | ||
* In Hibernate, lazy loading is on by default for collections. This means the collections are fetched from the database only when they are used (never if they are not used). '''Warning:''' if the loading appears when the Hibernate session is already closed, it will | * In Hibernate, lazy loading is on by default for collections. This means the collections are fetched from the database only when they are used (never if they are not used). '''Warning:''' if the loading appears when the Hibernate session is already closed, it will '''fail.''' |
Revision as of 15:52, 22 March 2007
Java: Hibernate
- If you specify a many-to-one or one-to-many mapping, be sure to use the same mapping as the Java collection interface. A Set mapping won't work with a List collection, for example.
- In Hibernate, lazy loading is on by default for collections. This means the collections are fetched from the database only when they are used (never if they are not used). Warning: if the loading appears when the Hibernate session is already closed, it will fail.