Doesn't look right. The id is the primary key - it could now be inserted with a value of 100, always. I can do an insert here with @Id @GeneratedValue(){val strategy = GenerationType.AUTO}
Still works without GeneratedValue being present. My pom dependencies are <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>net.sourceforge.jtds</groupId> <artifactId>jtds</artifactId> <version>1.2</version> </dependency> Properties in persistance.xml <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/> <property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/> <property name="hibernate.connection.username" value="xx"/> <property name="hibernate.connection.password" value="xx"/> <property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://localhost:1433/fred"/> <property name="hibernate.max_fetch_depth" value="3"/> <property name="hibernate.show_sql" value="true"/> </properties> On Tue, Sep 9, 2008 at 9:37 AM, Tim Perrett <[EMAIL PROTECTED]> wrote: > > I managed to fix it in the end by reading some really really old post > in the hibernate archive. > > Effectively, if you define something, a class property that has no > initial value (in our case, _ ) then it bones the inserting for some > reason. Quite knows what it does that but it does...... and with very > little error as well :-( > > For completeness sake, here is the final Author class: > > @Entity > @Table(){val name="authors", val schema="dbo"} > class Author { > @Id > @GeneratedValue(){val strategy = GenerationType.IDENTITY} > @Column(){val insertable = false, val unique = true} > var id : Long = 100 > > var name : String = "" > > @OneToMany(){val mappedBy = "author", val targetEntity = > classOf[Book]} > var books : java.util.Set[Book] = new java.util.HashSet[Book]() > } > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---