From: Michael B. (JIRA) <web...@jp...> - 2006-10-02 18:05:58
|
URI or UUID as a primary key when the containing class is the target of a relationship results in schema errors --------------------------------------------------------------------------------------------------------------- Key: CORE-3002 URL: http://www.jpox.org/servlet/jira/browse/CORE-3002 Project: Core Type: Bug Components: RDBMS Datastore Support, Schema tool, Java Type Support Versions: 1.1.2 Environment: Windows XP SP2, Java 5 r 06.. Same schema error on MySQL, postgresql and ms-sql. Reporter: Michael Brown If a persistent class uses URI or UUID as a primary key, and is involved in a relationship, i.e. a foreign key at the database level, jpox errors whilst mapping to the datastore. The application is un-able to persist such entities as a result. URI and UUID work fine as a primary key if there are no foreign key references to the table, and the class can be persisted. Interestingly Enum, which seems to use the same mapping technique, works fine in the same circumstances. I will attach a test case that reproduces the problem in a simple situation. Below is the exception. I found no additionally usefull information in the logs. The java type java.net.URI (jdbc-type="VARCHAR", sql-type="") cant be mapped for this datastore. No mapping is available. javax.jdo.JDOFatalException: The java type java.net.URI (jdbc-type="VARCHAR", sql-type="") cant be mapped for this datastore. No mapping is available. at org.jpox.store.rdbms.mapping.RDBMSMappingManager.getDatastoreMappingClass(RDBMSMappingManager.java:359) at org.jpox.store.rdbms.mapping.RDBMSMappingManager.createDatastoreMapping(RDBMSMappingManager.java:474) at org.jpox.store.mapping.PersistenceCapableMapping.prepareDatastoreMapping(PersistenceCapableMapping.java:254) at org.jpox.store.mapping.PersistenceCapableMapping.initialize(PersistenceCapableMapping.java:139) at org.jpox.store.mapping.MappingFactory.createMapping(MappingFactory.java:88) at org.jpox.store.mapping.AbstractMappingManager.getMapping(AbstractMappingManager.java:231) at org.jpox.store.rdbms.table.ClassTable.addFieldMetaData(ClassTable.java:457) at org.jpox.store.rdbms.table.ClassTable.manageClass(ClassTable.java:396) at org.jpox.store.rdbms.table.ClassTable.initializeForClass(ClassTable.java:830) at org.jpox.store.rdbms.table.ClassTable.initialize(ClassTable.java:268) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://www.jpox.org/servlet/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |