Announcement Announcement Module
Collapse
No announcement yet.
Roo not generating auto-increment ID field? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo not generating auto-increment ID field?

    Hello all,

    I'm new, so please be kind.

    I am using:
    • apache-maven-3.0.3
    • spring-roo-1.1.5.RELEASE
    • sts-2.8.1.RELEASE
    • vfabric-tc-server-developer-2.6.1.RELEASE

    I have a single table (to experiment with):

    CREATE TABLE PRODUCT (
    PRODUCT_ID BIGINT PRIMARY KEY,
    NAME VARCHAR(255) NOT NULL,
    DESCRIPTION VARCHAR(1000),
    PRICE DOUBLE
    );

    Here's my log.roo :


    project --topLevelPackage com.crmco.crm --projectName crm --java 6
    persistence setup --database H2_IN_MEMORY --provider HIBERNATE
    database properties set --key database.url --value jdbc:h2:tcp://localhost/~/roo_crm
    database reverse engineer --package ~.domain --schema PUBLIC
    controller all --package ~.web


    When I try to create a new row, using the web interface, I get the following error:


    2011-12-20 11:41:14,587 [tomcat-http--22] ERROR org.hibernate.util.JDBCExceptionReporter - NULL not allowed for column "PRODUCT_ID"; SQL statement:
    insert into PUBLIC.PRODUCT (PRODUCT_ID, DESCRIPTION, NAME, PRICE) values (null, ?, ?, ?) [23502-155]


    Shouldn't Spring Roo be generating code to auto-increment the PRODUCT_ID field?

    Thanks,

    Spring Roll
Working...
X