DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCRDBMS-527
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Christian Ernst
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

mapping strategy complete-table causes SchemaTool to fail on certain models

Created: 18/May/11 02:19 PM   Updated: 17/Jun/11 05:09 PM   Resolved: 11/Jun/11 03:33 PM
Component/s: ORM
Affects Version/s: 3.0.0.m4
Fix Version/s: 3.0.0.m5

File Attachments: 1. Zip Archive GhostInstancesInQueryResult.zip (2 kB)
2. Zip Archive InvalidMetadataCompleteTableMapping.zip (12 kB)


Datastore: MySQL


 Description  « Hide
With a certain model the Schematool fails when mapping strategy complete-table is used.
------------------
public class A {
private int a;
private List<A> list = new ArrayList<A>();
}

public class B extends A{
private int b;
}
------------------
<jdo>
  <package name="model">
   <class name="A">
   <inheritance strategy="complete-table"/>
            <field name="list" embedded="true">
         <collection element-type="A"/>
         </field>
        </class>
        <class name="B" persistence-capable-superclass="model.A"/>
  </package>
</jdo>
------------------
INFO: ================= Persistence Configuration ===============
18.05.2011 14:14:06 org.datanucleus.NucleusContext logConfiguration
INFO: DataNucleus Persistence Factory - Vendor: "DataNucleus" Version: "3.0.0.m4"
18.05.2011 14:14:06 org.datanucleus.NucleusContext logConfiguration
INFO: DataNucleus Persistence Factory initialised for datastore URL="jdbc:mysql://gambit/dbbench" driver="com.mysql.jdbc.Driver" userName="dbbench"
18.05.2011 14:14:06 org.datanucleus.NucleusContext logConfiguration
INFO: ===========================================================
18.05.2011 14:14:06 org.datanucleus.api.jdo.metadata.JDOMetaDataManager <init>
INFO: Registering listener for metadata initialisation
18.05.2011 14:14:06 org.datanucleus.store.schema.SchemaTool getFileMetaDataForInput
INFO: DataNucleus SchemaTool : Input Files
18.05.2011 14:14:06 org.datanucleus.store.schema.SchemaTool getFileMetaDataForInput
INFO: >> C:\work\workspaces\experimental-workspace-3.6\InvalidMetadataCompleteTableMapping\bin\model\A.class
18.05.2011 14:14:06 org.datanucleus.store.schema.SchemaTool getFileMetaDataForInput
INFO: >> C:\work\workspaces\experimental-workspace-3.6\InvalidMetadataCompleteTableMapping\bin\model\B.class
18.05.2011 14:14:06 org.datanucleus.store.schema.SchemaTool getFileMetaDataForInput
INFO: >> C:\work\workspaces\experimental-workspace-3.6\InvalidMetadataCompleteTableMapping\bin\model\package.jdo
18.05.2011 14:14:06 org.datanucleus.store.schema.SchemaTool getFileMetaDataForInput
INFO: >> C:\work\workspaces\experimental-workspace-3.6\InvalidMetadataCompleteTableMapping\bin\test\Test.class
18.05.2011 14:14:06 org.datanucleus.store.schema.SchemaTool getFileMetaDataForInput
INFO: >> C:\work\workspaces\experimental-workspace-3.6\InvalidMetadataCompleteTableMapping\src\model\package.jdo
18.05.2011 14:14:06 org.datanucleus.metadata.MetaDataManager loadClasses
INFO: Class "test.Test" has no MetaData or annotations.
18.05.2011 14:14:06 org.datanucleus.store.StoreDataManager registerStoreData
INFO: Managing Persistence of Class : model.A [Table : `A`, InheritanceStrategy : complete-table]
18.05.2011 14:14:06 org.datanucleus.store.StoreDataManager registerStoreData
INFO: Managing Persistence of Class : model.B [Table : `B`, InheritanceStrategy : complete-table]
An exception was thrown during the operation of SchemaTool. Please refer to the log for full details. The following may help : The column "LIST_A_ID_OID" exists in table "`B`" and has invalid metadata. The existing column is "<column/>
"
18.05.2011 14:14:06 org.datanucleus.store.schema.SchemaTool main
SCHWERWIEGEND: An exception was thrown during the operation of SchemaTool. Please refer to the log for full details. The following may help : The column "LIST_A_ID_OID" exists in table "`B`" and has invalid metadata. The existing column is "<column/>
"
The column "LIST_A_ID_OID" exists in table "`B`" and has invalid metadata. The existing column is "<column/>
"
org.datanucleus.exceptions.NucleusUserException: The column "LIST_A_ID_OID" exists in table "`B`" and has invalid metadata. The existing column is "<column/>
"
at org.datanucleus.store.rdbms.table.AbstractTable.addDatastoreField(AbstractTable.java:281)
at org.datanucleus.store.rdbms.table.ClassTable.runSpecifiedCallbacks(ClassTable.java:1304)
at org.datanucleus.store.rdbms.table.ClassTable.runCallBacks(ClassTable.java:1143)
at org.datanucleus.store.rdbms.table.ClassTable.postInitialize(ClassTable.java:402)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.initializeClassTables(RDBMSStoreManager.java:2462)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTablesAndValidate(RDBMSStoreManager.java:2333)
at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:1983)
at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)
at org.datanucleus.store.rdbms.RDBMSStoreManager.createSchema(RDBMSStoreManager.java:3101)
at org.datanucleus.store.schema.SchemaTool.createSchema(SchemaTool.java:395)
at org.datanucleus.store.schema.SchemaTool.main(SchemaTool.java:330)
------------

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 23/May/11 06:31 PM
SVN trunk allows classes with unidir FK relations to be remapped by multiple owner classes in schema generation

Christian Ernst added a comment - 10/Jun/11 03:18 PM
This is a test for the bug originaly reported in (NUCRDBMS-533) ghost twin objects returned by Query when using complete-table mapping.
Please reopen this bug.

Andy Jefferson added a comment - 11/Jun/11 03:33 PM - edited
SVN trunk passes on that test also; could easily have been seen by just looking at the SQL invoked