Skip to main content

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

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

Back to the top