This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes JPA Annotation @Column + column defination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA Annotation @Column + column defination" Watch "JPA Annotation @Column + column defination" New topic
Author

JPA Annotation @Column + column defination

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
Hi,

There is a JPA Annotation @Column which has the attribute columnDefination



But then if my database does not support VARCHAR2 datatype my method for recreating schema will fail...

So is there any annotation in hibernate for defination of column which i can use for creating tables. As well as i can map my java datatype with database's data type.. ?


Jigar Naik


Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
Not sure what you want to define here: columnDefinition is, by design, non-portable database specific DDL. The @Column annotation has a few attributes, for example, length, that you can use for portable customization.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JPA Annotation @Column + column defination