[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-8558) SEAM Entity creator uses Integer for @Version - results in NullPointerException on update
Peter Larsen (JIRA)
jira-events at lists.jboss.org
Mon Apr 18 16:38:33 EDT 2011
[ https://issues.jboss.org/browse/JBIDE-8558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596326#comment-12596326 ]
Peter Larsen commented on JBIDE-8558:
-------------------------------------
Max - the schema was generated from the model - not the other way around. If you add @NotNull to Integer Version you get errors on insert because the value isn't present. If you change the type to int, the column is initialized correct - and it works regardless of the column being null/not null (unless you specify @NotNull the column is created as NULLable).
> SEAM Entity creator uses Integer for @Version - results in NullPointerException on update
> -----------------------------------------------------------------------------------------
>
> Key: JBIDE-8558
> URL: https://issues.jboss.org/browse/JBIDE-8558
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: Seam, UpStream
> Environment: JBDS4
> Reporter: Peter Larsen
> Assignee: Alexey Kazakov
> Fix For: LATER
>
>
> When creating entities from scratch, the "Create SEAM Entity" wizard will generate code with the the following:
> @Version
> private Integer version;
> This construct unfortunately results in new records being created with NULL in the version column. On subsequent updates this then results in NullPointerException.
> Changing Integer to int solves the problem.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list