openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Pyeron (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (OPENJPA-2032) Derived keys not expresable in XML
Date Mon, 18 Jul 2011 21:09:57 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067298#comment-13067298
] 

Jason Pyeron edited comment on OPENJPA-2032 at 7/18/11 9:09 PM:
----------------------------------------------------------------

Test Case from page 285 of Pro JPA 2 ISBN-13: 978-1-4302-1956-9

will fail if done in xml

Listing 10-12. Project with Dependent Identifier
@Entity
@IdClass(ProjectId.class)
public class Project {
@Id private String name;
@Id
@ManyToOne
private Department dept;
}

      was (Author: jpyeron):
    Test Case from page 285 of Pro JPA 2 ISBN-13: 978-1-4302-1956-9

will fail

Listing 10-12. Project with Dependent Identifier
@Entity
@IdClass(ProjectId.class)
public class Project {
@Id private String name;
@Id
@ManyToOne
private Department dept;
}
  
> Derived keys not expresable in XML
> ----------------------------------
>
>                 Key: OPENJPA-2032
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2032
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>         Environment: windows 64bit sun/oracle jdk 1.6 oracle 11g openjpa 2.1 / IBM WebSphere
Application Server 7
>            Reporter: Jason Pyeron
>              Labels: xmlschema
>
> @Id @ManyToOne @JoinColumn(name = "CLM_VERS_ID", referencedColumnName =
> "CLM_VERS_ID") private ClaimVersion claimVersion;
>   
> <id name="claimVersion"> <join-column name="CLM_VERS_ID"
> referenced-column-name="CLM_VERS_ID" /> </id>
> Jul 18, 2011 4:30:08 PM org.apache.openjpa.lib.log.CommonsLogFactory$LogAdapter
> warn
> WARNING: An exception was thrown while attempting to perform class file transformation
on
> "com/carefirst/fep/local/commons/model/claim/BillingProviderSecondaryId":
> <openjpa-2.1.0-SNAPSHOT-r422266:1057903 nonfatal general error>
> org.apache.openjpa.util.GeneralException: org.xml.sax.SAXException:
> file:/C:/Documents%20and%20Settings/All%20Users/workspace/testing/bin/META-INF/o
> rm-claim.xml [Location: Line: 16, C: 76]: org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.a: Invalid content was found starting with element 'join-column'.
One of '{"http://java.sun.com/xml/ns/persistence/orm":column,
> "http://java.sun.com/xml/ns/persistence/orm":generated-value,
> "http://java.sun.com/xml/ns/persistence/orm":temporal,
> "http://java.sun.com/xml/ns/persistence/orm":table-generator,
> "http://java.sun.com/xml/ns/persistence/orm":sequence-generator}' is expected.
> 	at
> org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML(PersistenceMe
> taDataFactory.java:295)
> 	at
> org.apache.openjpa.persistence.PersistenceMetaDataFactory.load(PersistenceMetaDa
> taFactory.java:228)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepositor
> y.java:580)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepositor
> y.java:400)
> 	at
> org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:3
> 84)
> 	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:283)
> 	at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:254)
> 	at
> org.apache.openjpa.enhance.PCClassFileTransformer.transform0(PCClassFileTransfor
> mer.java:144)
> 	at
> org.apache.openjpa.enhance.PCClassFileTransformer.transform(PCClassFileTransform
> er.java:124)
> 	at
> sun.instrument.TransformerManager.transform(TransformerManager.java:169)
> 	at
> sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
> 	at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
> 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
> 	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> Caused by: java.io.IOException: org.xml.sax.SAXException:
> file:/C:/Documents%20and%20Settings/All%20Users/workspace/testing/bin/META-INF/o
> rm-claim.xml [Location: Line: 16, C: 76]: org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.a: Invalid content was found starting with element 'join-column'.
One of '{"http://java.sun.com/xml/ns/persistence/orm":column,
> "http://java.sun.com/xml/ns/persistence/orm":generated-value,
> "http://java.sun.com/xml/ns/persistence/orm":temporal,
> "http://java.sun.com/xml/ns/persistence/orm":table-generator,
> "http://java.sun.com/xml/ns/persistence/orm":sequence-generator}' is expected.
> 	at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser
> .java:396)
> 	at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:334)
> 	at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:311)
> 	at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:284)
> 	at
> org.apache.openjpa.persistence.XMLPersistenceMetaDataParser.parse(XMLPersistence
> MetaDataParser.java:365)
> 	at
> org.apache.openjpa.persistence.PersistenceMetaDataFactory.parseXML(PersistenceMe
> taDataFactory.java:293)
> 	... 23 more
> Caused by: org.xml.sax.SAXException:
> file:/C:/Documents%20and%20Settings/All%20Users/workspace/testing/bin/META-INF/o
> rm-claim.xml [Location: Line: 16, C: 76]: org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.a: Invalid content was found starting with element 'join-column'.
One of '{"http://java.sun.com/xml/ns/persistence/orm":column,
> "http://java.sun.com/xml/ns/persistence/orm":generated-value,
> "http://java.sun.com/xml/ns/persistence/orm":temporal,
> "http://java.sun.com/xml/ns/persistence/orm":table-generator,
> "http://java.sun.com/xml/ns/persistence/orm":sequence-generator}' is expected.
> 	at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.getException(XMLMetaDataParser.jav
> a:675)
> 	at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.error(XMLMetaDataParser.java:434)
> 	at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWr
> apper.java:134)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorRep
> orter.java:384)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorRep
> orter.java:318)
> 	at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.r
> eportError(XMLSchemaValidator.java:417)
> 	at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(
> XMLSchemaValidator.java:3182)
> 	at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement
> (XMLSchemaValidator.java:1806)
> 	at
> com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSc
> hemaValidator.java:725)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElemen
> t(XMLNSDocumentScannerImpl.java:377)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentC
> ontentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentS
> cannerImpl.java:648)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocum
> entScannerImpl.java:140)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocum
> ent(XMLDocumentFragmentScannerImpl.java:511)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configu
> ration.java:808)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configu
> ration.java:737)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
> 	at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXPa
> rser.java:1205)
> 	at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXPar
> serImpl.java:522)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
> 	at
> org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser
> .java:393)
> 	... 28 more

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message