[jboss-user] [JBoss jBPM] - subclassing TaskInstance and setting up hibernate mapping fo
rossputin
do-not-reply at jboss.com
Tue Sep 25 10:57:29 EDT 2007
Hi guys,
as per the CustomTaskInstance example, I am subclassing TaskInstance, and adding a couple of simple properties, I have created a new class subclassing TaskInstance, and the hibernate mapping field to go with it...
What I am unsure about, is how the hibernate mapping file relates to my MySQL database, do I need to modify the original TaskInstance table in MySQL to reflect the changes (fields added) in my new extended class, or do I create a new table JBPM_NEWTASKINSTANCE that is a duplicate of JBPM_TASKINSTANCE table but with the new fields added.
My hibernate mapping file is listed below...
| <?xml version="1.0"?>
|
| <!DOCTYPE hibernate-mapping PUBLIC
| "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
| "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
| <hibernate-mapping default-access="field">
|
| <subclass name="com.mycomp.taskinstance.NewTaskInstance"
| extends="org.jbpm.taskmgmt.exe.TaskInstance"
| discriminator-value="C">
|
| <property name="someVariable1" column="SOMEVARIABLE1_" />
|
| </subclass>
|
| </hibernate-mapping>
|
When I run my unit test I see...
| INFO Configuration : Reading mappings from resource : com/mycomp/taskinstance/NewTaskInstance.hbm.xml
|
| INFO HbmBinder : Mapping subclass: com.mycomp.taskinstance.NewTaskInstance -> JBPM_TASKINSTANCE
|
I suppose the NewTaskInstance should map to either a modified JBPM_TASKINSTANCE or to JBPM_NEWTASKINSTANCE ?
And finally of course the test bombs out with...
| WARN JDBCExceptionReporter : SQL Error: 1054, SQLState: 42S22
| ERROR JDBCExceptionReporter : Unknown column 'newtaskins0_.SOMEVARIABLE1_' in 'field list'
|
because I either have not added the new field to JBPM_TASKINSTANCE, or have not added the new table required.. (not sure which).
If someone could give me a pointer as to the process of adding the new field in the table, or adding a new table I would appreciate it,
thanks
Ross
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088456#4088456
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088456
More information about the jboss-user
mailing list