[
https://issues.apache.org/jira/browse/OPENJPA-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855583#action_12855583
]
Diddle edited comment on OPENJPA-1481 at 4/12/10 2:17 AM:
----------------------------------------------------------
I see the same behaviour with annotations:
//bi-directional one-to-one association to Result
@OneToOne
// @JoinColumn(name="id", nullable=false, insertable=false,
updatable=false)
@JoinColumn(name="id", referencedColumnName="protocol_schedule_id",
nullable=false, insertable=false, updatable=false)
public Result getResult() {
return this.result;
}
<openjpa-1.2.2-r422266:898935 fatal user error>
org.apache.openjpa.persistence.ArgumentException:
"com.hjb.socrates.jpa.ProtocolSchedule.result" declares a column that is not
compatible with the expected type "blob". Column details:
Full Name: protocol_schedule.id
Type: bigint
Size: 0
Default: null
Not Null: true
at
org.apache.openjpa.jdbc.meta.MappingInfo.mergeColumn(MappingInfo.java:662)
at
org.apache.openjpa.jdbc.meta.MappingInfo.mergeJoinColumn(MappingInfo.java:1443)
at
org.apache.openjpa.jdbc.meta.MappingInfo.createJoins(MappingInfo.java:1206)
at
org.apache.openjpa.jdbc.meta.MappingInfo.createForeignKey(MappingInfo.java:968)
at
org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:104)
at
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.map(RelationFieldStrategy.java:157)
at
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)
at
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)
at
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.map(RelationFieldStrategy.java:100)
at
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)
at
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)
at
org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:840)
at
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1647)
at
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:812)
at
org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:772)
at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:650)
at
org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:393)
at
org.apache.openjpa.meta.MetaDataRepository.getMetaDataLocking(MetaDataRepository.java:366)
at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:360)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:253)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:224)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:192)
at
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:121)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:310)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
at com.hjb.socrates.test.jpa.Entities.setUp(Entities.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I haven't yet tested this entity to see if it still works as this error
occurred during testing of related entities.
I just know if I remove the referencedColumnName="protocol_schedule_id" it
compiles and the other entity tests work
Postgresql ddl:
CREATE TABLE webscore.result
(
id bigserial NOT NULL,
protocol_schedule_id bigint NOT NULL,
question integer NOT NULL,
response integer NOT NULL,
CONSTRAINT result_pkey PRIMARY KEY (id),
CONSTRAINT result_protocol_schedule_id_fkey FOREIGN KEY (protocol_schedule_id)
REFERENCES webscore.protocol_schedule (id) MATCH FULL
ON UPDATE CASCADE ON DELETE NO ACTION
)
was (Author: diddle):
I see the same behaviour with annotations:
//bi-directional one-to-one association to Result
@OneToOne
// @JoinColumn(name="id", nullable=false, insertable=false,
updatable=false)
@JoinColumn(name="id", referencedColumnName="protocol_schedule_id",
nullable=false, insertable=false, updatable=false)
public Result getResult() {
return this.result;
}
<openjpa-1.2.2-r422266:898935 fatal user error>
org.apache.openjpa.persistence.ArgumentException:
"com.hjb.socrates.jpa.ProtocolSchedule.result" declares a column that is not
compatible with the expected type "blob". Column details:
Full Name: protocol_schedule.id
Type: bigint
Size: 0
Default: null
Not Null: true
at
org.apache.openjpa.jdbc.meta.MappingInfo.mergeColumn(MappingInfo.java:662)
at
org.apache.openjpa.jdbc.meta.MappingInfo.mergeJoinColumn(MappingInfo.java:1443)
at
org.apache.openjpa.jdbc.meta.MappingInfo.createJoins(MappingInfo.java:1206)
at
org.apache.openjpa.jdbc.meta.MappingInfo.createForeignKey(MappingInfo.java:968)
at
org.apache.openjpa.jdbc.meta.ValueMappingInfo.getTypeJoin(ValueMappingInfo.java:104)
at
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.map(RelationFieldStrategy.java:157)
at
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)
at
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)
at
org.apache.openjpa.jdbc.meta.strats.RelationFieldStrategy.map(RelationFieldStrategy.java:100)
at
org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(FieldMapping.java:121)
at
org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(RuntimeStrategyInstaller.java:80)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(FieldMapping.java:454)
at
org.apache.openjpa.jdbc.meta.FieldMapping.resolve(FieldMapping.java:419)
at
org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(ClassMapping.java:840)
at
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1647)
at
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:812)
at
org.apache.openjpa.meta.MetaDataRepository.resolveMapping(MetaDataRepository.java:772)
at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:650)
at
org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:393)
at
org.apache.openjpa.meta.MetaDataRepository.getMetaDataLocking(MetaDataRepository.java:366)
at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:360)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:253)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:224)
at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:192)
at
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:121)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:310)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
at com.hjb.socrates.test.jpa.Entities.setUp(Entities.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
java.lang.NullPointerException
at com.hjb.socrates.test.jpa.Entities.tearDown(Entities.java:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I haven't yet tested this entity to see if it still works as this error
occurred during testing of related entities.
I just know if I remove the referencedColumnName="protocol_schedule_id" it
compiles and the other entity tests work
> metadata preload thinks a varchar column is a blob
> --------------------------------------------------
>
> Key: OPENJPA-1481
> URL: https://issues.apache.org/jira/browse/OPENJPA-1481
> Project: OpenJPA
> Issue Type: Bug
> Components: jpa
> Affects Versions: 1.2.2
> Reporter: David M. Karr
> Attachments: jpatestcase.zip, OPENJPA-1481--test.zip,
> TEST-com.att.ecom.dynamiccontent.content.CategoryJPATest.txt
>
>
> Without metadata preload on, my application is working fine. When I turned on
> metadata preload, creating the factory fails with an error like this:
> -------------------
> Caused by: <openjpa-1.2.2-r422266:898935 fatal user error>
> org.apache.openjpa.persistence.ArgumentException:
> "com.att.ecom.dynamiccontent.domain.pricelist.PriceListFolder.childItems<element:class
> com.att.ecom.dynamiccontent.domain.pricelist.PriceList>" declares a column
> that is not compatible with the expected type "blob". Column details:
> Full Name: DCS_PRICE_LIST.PRICE_LIST_ID
> Type: varchar
> Size: 255
> Default: null
> Not Null: false
> -------------------
> This error message is from the unit test output, which uses Derby. My
> application normally uses Oracle. The only difference in the error message
> between the unit test with Derby and at runtime with Oracle is the type is
> "varchar2" (Derby only has varchar).
> The excerpt from the orm.xml for this property is this:
> <id name="id">
> <column name="PRICE_LIST_ID"/>
> </id>
> And from the domain class:
> @Id
> private String id;
> I'm going to attach the "TEST" output file from the build which shows the
> error message and stack trace. I'm also going to attach a zip file
> containing an Eclipse project, but the "lib" and "libtest" directories will
> only have a "jars.lst" text file containing the names of the jars that were
> in that directory (almost all of which have a version number in the name).
> Note that not all of the jars in those lists are required for the unit test
> to complete. Some of the jars in the list are required for the CXF and
> Spring portion of the application, so wouldn't be necessary for this test
> case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira