For reasons that have never been clear to me, @Basic(optional = false) does not affect column nullability. I am actually completely uncertain as to what it DOES do.
You want: @Column(name = "url", nullable = false) Best, Laird On Fri, Nov 19, 2010 at 3:08 PM, Radim Kolář [via OpenJPA] < [email protected]<ml-node%[email protected]> > wrote: > I have following entity class: > > @Entity > @Table(name="queue") > > public class QueueEntry { > > @Id > @GeneratedValue > private int id; > > @Basic(optional=false) > private String url; > > @Version > private long version; > } > > SQL statement used for table creation (i use H2 database) is: > CREATE TABLE queue (id INTEGER NOT NULL, URL VARCHAR(255), version INTEGER, > PRIMARY KEY (id)); > > note NOT NULL on URL column is missing. > > ------------------------------ > View message @ > http://openjpa.208410.n2.nabble.com/Basic-optional-false-not-mapped-to-NOT-NULL-tp5756491p5756491.html > To start a new topic under OpenJPA Users, email > [email protected]<ml-node%[email protected]> > To unsubscribe from OpenJPA Users, click > here<http://openjpa.208410.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=208411&code=bGpuZWxzb25AZ21haWwuY29tfDIwODQxMXw4OTk4MzY1OTI=>. > > -- View this message in context: http://openjpa.208410.n2.nabble.com/Basic-optional-false-not-mapped-to-NOT-NULL-tp5756491p5756496.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
