Hi,
I've reverse engineered a database, and then tried to create the basic web app. When I run the app using "mvn tomcat:run", I get an error and the web app is not loaded. The long stack trace ends with
The datatype in the Oracle database is CHAR(16).Code:Caused by: org.hibernate.HibernateException: Wrong column type in PDR.ATTR for column attr_abbr. Found: char, expected: varchar2(16) at org.hibernate.mapping.Table.validateColumns(Table.java:284) at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1174) at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:389) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:891) ... 55 more
The generated code by roo isCode:CREATE TABLE ATTR ( ATTR_ID NUMBER NOT NULL, ATTR_NAME VARCHAR2(255) NOT NULL, ATTR_ABBR CHAR(16), ATTR_DESC VARCHAR2(4000), STRG_TYPE_ID CHAR(1), REQD_CHK CHAR(1), LOV_CHK CHAR(1), RNGE_CHK CHAR(1), RNGE_MIN_N_VAL NUMBER(5 , 2), RNGE_MAX_N_VAL NUMBER(5 , 2), PREC_N_VAL NUMBER(5 , 2), PRNT_TYPE_ID NUMBER, INDX_ID NUMBER, CNST_ID NUMBER ) PCTFREE 0 PCTUSED 0 LOGGING;
Code:@Column(name = "ATTR_ABBR", length = 16) private String Attr.attrAbbr;
Below are the roo commands I've run.
I'm just running the code roo is generating, and I'm not making any other modifications. Do I need to modify the code roo generates to get it to work?Code:project --topLevelPackage org.neoninc.pdr persistence setup --provider HIBERNATE --database ORACLE database properties set --key database.username --value pdr database properties set --key database.password --value ******* database properties set --key database.url --value jdbc:oracle:thin:@dpdb003:1521:dev_pdr database reverse engineer --schema PDR --package org.neoninc.db controller all --package ~.web perform package perform eclipse
DJ Spiess


Reply With Quote