Skip to content

sreekanthsnair/hibernate-goodies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##hibernate-goodies

Collection of API's to support in hibernate development

###Goodie No : 1 SequenceIdGenerator

This can be used as your hibernate id creation strategy, if you wish to use sequence per table. This will automatically generate db sequence for every entity and will take care of supplying new id. The generated seqence will be either picked from Entity's @Table annotation's name value or Entity class name and affix with seq_

NOTE : Now this won't support when using JOIN table Inheritence strategy

eg:

@Table(name="my_table")
public class MyClass { .... }

the generated sequence name will be seq_my_table.

####Usage

Annote your primary key entity field with

@Id
@GenericGenerator(name="seq_id", strategy="org.java.hibernate.support.SequenceIdGenerator")
@GeneratedValue(generator="seq_id")

About

Collection of API's to support in hibernate development

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages