-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: help : CompositeCustomType schema generating error
PostPosted: Thu Jun 09, 2005 7:16 am 
Regular
Regular

Joined: Tue Jul 13, 2004 2:27 am
Posts: 73
Location: Singapore
Hibernate version: 2.1.6

Mapping documents:
<property name="workflowStatus" column="WORKFLOW_STATUS" type="net.canal.app.workflow.persistence.WorkflowStatusType"/>

Full stack trace of any exception that occurs:
-------------------------------------------------------
Schema text failed: Could not determine type for column WORKFLOW_STATUS of type net.sf.hibernate.type.CompositeCustomType: java.lang.ArrayIndexOutOfBoundsException
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:146)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Caused by: net.sf.hibernate.MappingException: Could not determine type for column WORKFLOW_STATUS of type net.sf.hibernate.type.CompositeCustomType: java.lang.ArrayIndexOutOfBoundsException
at net.sf.hibernate.mapping.Column.getAutoSqlType(Column.java:97)
at net.sf.hibernate.mapping.Column.getSqlType(Column.java:115)
at net.sf.hibernate.mapping.Table.sqlCreateString(Table.java:170)
at net.sf.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:514)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:59)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getSchemaExport(SchemaExportTask.java:209)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:136)
... 10 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at net.sf.hibernate.mapping.Column.getAutoSqlType(Column.java:94)
... 16 more
--- Nested Exception ---
net.sf.hibernate.MappingException: Could not determine type for column WORKFLOW_STATUS of type net.sf.hibernate.type.CompositeCustomType: java.lang.ArrayIndexOutOfBoundsException
at net.sf.hibernate.mapping.Column.getAutoSqlType(Column.java:97)
at net.sf.hibernate.mapping.Column.getSqlType(Column.java:115)
at net.sf.hibernate.mapping.Table.sqlCreateString(Table.java:170)
at net.sf.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:514)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:59)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getSchemaExport(SchemaExportTask.java:209)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:136)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.Main.runBuild(Main.java:673)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at net.sf.hibernate.mapping.Column.getAutoSqlType(Column.java:94)
... 16 more

Hi,
I am getting the above error when I try to generate database scheme.
The error happens after I added the CompositeCustomType.

Here is my class:
public class WorkflowStatus extends BaseObject {
private Integer currentStatus;
private Calendar initialDate;
private Calendar closeDate;
private Calendar dueDate;
private Set approverStatus = new HashSet();

public WorkflowStatus () {

}
.....
}

then I added :
public class WorkflowStatusType implements CompositeUserType {
......

}

I have no idea now what causes the error.

appreciate any help
thanks
lixin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 09, 2005 7:21 am 
Regular
Regular

Joined: Tue Jul 13, 2004 2:27 am
Posts: 73
Location: Singapore
figured out why: public String[] getPropertyNames () and public Type[] getPropertyTypes () did not return the right value.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.