Home  >  Hibernate

Learn Hibernate by Examples

Hibernate @Any, @ManyToAny and @AnyMetaDef Annotation Example This page will walk through hibernate @Any, @ManyToAny and @AnyMetaDef annotation example. @Any is ToOne style association and @ManyToAny is ToMany style association from an entity to any entity of several types. Hibernate Make Entity Read Only Example with Session.setDefaultReadOnly(), Session.setReadOnly(), Query.setReadOnly(), Criteria.setReadOnly() and Immutable Entity This page will walk through Hibernate make entity read only example with Session.setDefaultReadOnly(), Session.setReadOnly(), Query.setReadOnly(), Criteria.setReadOnly() and immutable entity. Hibernate HQL Order By and Group By Example On this page we will provide Hibernate HQL Order By and Group By example. Order by orders the data on the basis of given property in ascending or descending order. Hibernate HQL Associations and inner join, left outer join, right outer join, cross join Example On this page we will provide Hibernate HQL Associations and inner join, left outer join, right outer join, cross join example. HQL is Hibernate Query Language. Hibernate Session createCriteria(), contains() and cancelQuery() Example On this page we will provide Hibernate Session createCriteria(), contains() and cancelQuery() example. The method Session.createCriteria() of Hibernate Session returns Criteria instance. Hibernate ScrollableResults and ScrollMode Example On this page, we will provide Hibernate ScrollableResults and ScrollMode example. ScrollableResults is used to scroll large amount of data and ScrollMode provides different modes. Hibernate Bidirectional Mapping Example with @JoinTable Annotation In this page, we will learn hibernate bidirectional mapping example with @JoinTable annotation. Bidirectional mapping means two entities are associated in a way that one can be fetched from another entity. Hibernate @Filter and @FilterJoinTable Annotation Example In this page we will learn in detail how to use hibernate @Filter and @FilterJoinTable annotation. Filtering in hibernate is like creating a view in database. We need to create filter definition using @FilterDef annotation. Hibernate Session: evict() and merge() Example This page will provide hibernate session evict() and merge() example. In our hibernate development, sometimes we need to detach the session object because we need to change it and it may take time while changing. LockOptions, Session.buildLockRequest() and LockRequest in Hibernate In this page we will learn LockOptions, Session.buildLockRequest() and LockRequest in hibernate. LockOptions represents different lock mode to lock entity object using Session.buildLockRequest(). Hibernate Session: save(), update() and saveOrUpdate() Example In this page we will learn the use and differences of save(), update() and saveOrUpdate() methods of hibernate Session object. save() method runs the insert query, update() method runs the update query and saveOrUpdate(). Hibernate Object States
December 04, 2013
In hibernate an entity or object has three states. It can be persistent, detached or transient. All the states are defined with hibernate session. Persistent state object resides in session...
Example of @CollectionId in Hibernate
May 31, 2013
@CollectionId is used to create a collection id. And that id will work as primary key. Bag collections id do efficiently removal and insertion of rows... Example of @ForeignKey in Hibernate
May 30, 2013
Hibernate allows to keep foreign key name. Hibernate overrides the foreign key name by @ForeignKey. It has the attribute name that should be defined... Example of @NotFound in Hibernate
May 30, 2013
@NotFound in hibernate is used when entities are associated to each other by ManyToOne, OneToMany etc. Suppose joined subclass... Example of @OptimisticLock in Hibernate
May 29, 2013
@OptimisticLock in hibernate stops version. Versioning is done for dirty checking. But in some case like in collection , if we need not dirty check, we can use @OptimisticLock... Example of @Target in Hibernate
May 29, 2013
@Target forces the entity field to return specified class. By default reflection returns the object of the class as return type. Suppose a field has a return type an interface... Example of @Generated in Hibernate
May 28, 2013
Hibernate provides the facility to update the entity for those database values which are generated at insert or row update time. @Generated belongs to org.hibernate.annotations... Example of @OnDelete in Hibernate
May 28, 2013
@OnDelete in hibernate is used when there are joined sub class. @OnDelete decides whether deleting an entry from database will delete the rows represented by joined sub class or not... Example of @Index in Hibernate
May 27, 2013
@Index applies the index at property level. If the property of an entity is annotated with @Index, an index with the given name will be applied on the column... Example of @Where in Hibernate
May 27, 2013
@Where in hibernate can be applied at entity level. With the help of @Where, we can use where class to fetch the data. The entity will be populated only for those data for which @Where... Example of CascadeType.ALL in Hibernate
May 27, 2013
In case we want to cascade in all above situation, then we need to use CascadeType.ALL. If we annotate our property in an entity by CascadeType.ALL, then for every action, cascading will be achieved... Example of CascadeType.DETACH in Hibernate
May 27, 2013
In Hibernate CascadeType.DETACH plays the role when more than one entity is associated to each other. CascadeType.DETACH cascades the detach operation to all associated entities detach... Example of CascadeType.REFRESH in Hibernate
May 27, 2013
In Hibernate CascadeType.REFRESH plays the role when more than one entity is associated to each other. CascadeType.REFRESH cascades... Example of CascadeType.REMOVE in Hibernate
May 27, 2013
In Hibernate CascadeType.REMOVE plays the role when more than one entity is associated to each other. CascadeType.REMOVE cascades the remove operation of entity from hibernate session... Example of CascadeType.MERGE in Hibernate
May 27, 2013
In Hibernate CascadeType.MERGE plays the role when more than one entity is associated to each other. CascadeType.MERGE cascades the merge operation to all associated entities merge... Example of CascadeType.PERSIST in Hibernate
May 27, 2013
In Hibernate CascadeType.PERSIST plays the role when more than one entity is associated to each other. If we persist data in one entity...
POSTED BY
ARVIND RAI
ARVIND RAI
FIND MORE TUTORILAS








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us