Hi,

I've a problem using castor with key generators. Let me explain it on the
castor test project using a MS SQL Server.

database.xml:

<database name="test" engine="sql-server">
        
  <driver class-name="com.microsoft.jdbc.sqlserver.SQLServerDriver"
 
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=castor;SelectMet
hod=Cursor">
    <param name="user" value="sa" />
    <param name="password" value="" />
  </driver>
  
  <mapping href="mapping.xml" />
 
</database>

Now running the example Test.java everything fine. If I change the
mapping.xml from:

  <class name="myapp.ProductGroup" identity="id" >

to:

  <class name="myapp.ProductGroup" identity="id" key-generator="MAX">

the new product can't be saved because the foreign key (group_id) is
NULL!!!!!

Can everybody help me?

Stefan

<<attachment: winmail.dat>>

Reply via email to