Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Metamodel and isOptional

isOptional is for the option attribute of the @Basic, @ManyToOne and
@OneToOne annotations.



Mike Key-3 wrote:
> 
> I am trying to figure out how the isOptional() method on a
> SingularAttribute
> works for the JPA MetaModel.
> 
> I made an apparently bad assumption that setting the a column to
> nullable=false would accomplish this.  However isOptional is still always
> true.
> 
> A sample of what I have:
> 
> @Entity
> @Table(name = "account")
> public class Account {
> 
>     @Column(name = "first_name", nullable=false, length = 50)
>     private String firstName;
> 
>     ....
> }
> 
> However if I grab the metamodel and check isOptional() it is still true.
> 
> Using Eclipselink 2.2.
> 
> Thanks for any pointers.
> 
> Mike Key
> 
> 


-----
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/Metamodel-and-isOptional-tp32039058p32108038.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top