Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Correct programmatic way to determine whether an attribute is unique?

The meta-model does not provide complete accessed to the JPA meta-data, it
provides mainly only items required for use with the criteria API.

You can either get the meta-data directly from Java reflection, or access
the EclipseLink ClassDescriptor and mappings to access the information from
the EntityManager's Session.



ljnelson wrote:
> 
> Having a spin through the metamodel API (and trying to stay awake) and
> wanted to know what the appropriate recipe is to figure out that an
> entity's
> basic, say, String attribute is annotated with unique="true".
> 
> I'm not seeing programmatic methods in here that would allow me to get at
> whatever is encoded in either the @Column annotation or its xml override,
> so
> that makes me think I'm looking in the wrong place.
> 
> Best,
> Laird
> 
> -- 
> http://about.me/lairdnelson
> 
> 


-----
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.nabble.com/EclipseLink-f26430.html 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/Correct-programmatic-way-to-determine-whether-an-attribute-is-unique--tp32647264p32725266.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top