Also, what does the schema for the entity's table look like? On Mon, Jun 22, 2009 at 4:54 PM, Derek Chen-Becker <dchenbec...@gmail.com>wrote:
> Mind posting the snippet of code where you're saving the instance? A merge > should interpret a null ID as a fresh instance, and a persist should just > save it. > > Derek > > > On Mon, Jun 22, 2009 at 1:50 PM, David Persons <dhwpers...@gmail.com>wrote: > >> >> I am using MySql (5). After setting the hibernate.dialect to >> org.hibernate.dialect.MySQLDialect in my persistence.xml file, I get a >> org.hibernate.AssertionFailure: null id :-s >> >> cheers >> >> On 22 jun, 19:18, Derek Chen-Becker <dchenbec...@gmail.com> wrote: >> > That's not accurate, at least with Hibernate. By putting the annotations >> on >> > vars, the compiler ends up putting them on the internal fields, which >> then >> > forces Hibernate into a field-based persistence model and not a >> > getter/setter based one. The SQLGrammarException is most likely what the >> > other people have said. If you're in Oracle or PostgreSQL, for instance, >> you >> > need a sequence set up for the auto identity model. What database are >> you >> > using? >> > >> > Derek >> > >> > On Mon, Jun 22, 2009 at 8:54 AM, Eric Bowman <ebow...@boboco.ie> wrote: >> > >> > > David Persons wrote: >> > > > Hello guys, >> > >> > > > I get a org.hibernate.exception.SQLGrammarException: could not get >> or >> > > > update next value error everytime I try to save the following >> Entity: >> > >> > > > @Entity >> > > > class Scene { >> > > > @Id >> > > > @GeneratedValue(){val strategy = GenerationType.AUTO} >> > > > var id : Long = _ >> > >> > > > @Column{val unique = true, val nullable = false} >> > > > var ordering : Int = _ >> > >> > > > @Column{val unique = true, val nullable = false} >> > > > var name : String = "" >> > >> > > > @ManyToOne{val optional = false} >> > > > var storyBoard : StoryBoard = _ >> > > > } >> > >> > > You almost certainly need some scala.reflect.BeanProperty annotations >> on >> > > your fields. >> > >> > > cheers, >> > > Eric >> > >> > > -- >> > > Eric Bowman >> > > Boboco Ltd >> > > ebow...@boboco.ie >> > >http://www.boboco.ie/ebowman/pubkey.pgp >> > > +35318394189/+353872801532< >> http://www.boboco.ie/ebowman/pubkey.pgp%0A+35318394189/+353872801532> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---