You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "David Wisneski (JIRA)" <ji...@apache.org> on 2009/07/20 21:22:15 UTC

[jira] Created: (OPENJPA-1186) @DataStoreId(strategy=GenerationType.IDENTITY) does not work in DB2

@DataStoreId(strategy=GenerationType.IDENTITY) does not work in DB2
-------------------------------------------------------------------

                 Key: OPENJPA-1186
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1186
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
         Environment: DB2 
            Reporter: David Wisneski


Entity is defined as follows.   Table is created corrected with IDENTITY generate value for column "ID" 
When entity is persisted,  an Exception is thrown at flush saying database returned  null value for ID which is incorrect.

@Entity
@Table(name="NodeHistory")
@DataStoreId(strategy=GenerationType.IDENTITY)   // default column name = ID
public class History {
	long time;  //time 
	@Column(length=80)
	String entry;
	@OneToOne(cascade={CascadeType.PERSIST})
	History previous;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.