Submitted by heartin on Fri, 08/16/2013 - 04:19
There might be situations where you would want to modify the attributes of the embedded class (eg. Address) within an embedding class (eg. User), for instance, changing the database column name for a field. You can do this within the embedded class itself. But what if you don’t have access to the embedded class or if you want different behavior for two different instances of the embedded class; you will have to override the embedded class behavior in the embedding class.
Submitted by heartin on Fri, 08/16/2013 - 03:26
An entity class can refer to other entity classes or embed value types. An entity is a type on its own and has an existence of its own like a Course and its students. A value type is a type which doesn't have existence of its own, but belongs to an entity like an user and his address. Value types are always completely owned by their containing entity. Once you delete the entity, its associated value types are also deleted. But when you delete an entity, referenced entities still exist: when you delete a Course entity, you don't delete all its students.
Submitted by heartin on Fri, 08/16/2013 - 02:03
Here we will discuss most commonly used basic annotations in hibernate3 - @Entity, @Table, @Id, @GeneratedValue, @Basic, @Transient, @Temporal and @Lob.
@Entity
@Entity annotation (javax.persistence.Entity/org.hibernate.annotations.Entity) over the class tell hibernate to treat this class as our entity class that needs to be saved.
@Entity (name=”XYZ”)
Submitted by heartin on Tue, 08/13/2013 - 11:33
We will write a simple hibernate3 application to get started with hibernate3.
Before starting, you should:
Submitted by heartin on Mon, 08/12/2013 - 12:03
Hibernate 4 jars can be downloaded from the SourceForge web site at http://sourceforge.net/projects/hibernate/files/hibernate4. If this url doesn’t work or get changed, just search ‘hibernate 4 jars download sourceforge’ in Google. The distribution version downloaded here is 4.2.4. Except for the version numbers, the jar names and folder structure should be same across any version of hibernate4 distribution.
Pages