Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Custom Sequence JPA Example not complete

EclipseLink auto converts between most basic types.

To convert to UUID or perform other type conversions you can use a Converter
(see @Converter).
You could also make your id the String value of the UUID to avoid the
conversion.

Not that EclipseLink 2.4 trunk currently has support for a UUIDGenerator.


Aaron Whiteside-2 wrote:
> 
> http://wiki.eclipse.org/EclipseLink/Examples/JPA/CustomSequencing
> 
> getGeneratedValue() returns String.
> 
> Whereas the example @Id field is int.
> 
> Also the example does not address how to convert to and from custom types.
> Say you want to use java.util.UUID in your entity and convert to and from
> a CHAR or BLOB field in the database. How would one achieve that?
> 
> Regards,
> 
> Aaron Whiteside
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.eclipse.org/forums/index.php?t=thread&frm_id=111&S=1b00bfd151289b297688823a00683aca
EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
Blog:  http://java-persistence-performance.blogspot.com/ Java Persistence
Performance 
-- 
View this message in context: http://old.nabble.com/Custom-Sequence-JPA-Example-not-complete-tp33297201p33379340.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top