openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From saidulu chitipolu <csai_in...@yahoo.co.in>
Subject OpenJPA problem wtih Sequence generator & many to one mapping samples required
Date Sat, 21 Apr 2007 11:09:49 GMT
Hi,
   
  We are using openjpa-0.9.6-incubating,we have situation need to work with
   
  sequence-generator in orm file.
   
  facing the problem in persisting data using sequence generator. How to resolve this without
using a sequence generator in mapped-superclass.
   
    Exception in thread "main" org.springframework.transaction.CannotCreateTransactionException:
Could not open JPA EntityManager for transaction; nested exception is <4|true|0.9.6-incubating>
org.apache.openjpa.persistence.ArgumentException: Superclass field "java.lang.Object.id" is
mapped in the metadata for subclass "com.abc.xyz.mno.Header", but is not a persistent field.
  Caused by: <4|true|0.9.6-incubating> org.apache.openjpa.persistence.ArgumentException:
Superclass field "java.lang.Object.id" is mapped in the metadata for subclass "com.abc.xyz.mno.Header",
but is not a persistent field.
        at org.apache.openjpa.meta.ClassMetaData.getSuperclassField(ClassMetaData.java:894)
        at org.apache.openjpa.meta.ClassMetaData.resolveDefinedSuperclassFields(ClassMetaData.java:1186)
        at org.apache.openjpa.meta.ClassMetaData.defineSuperclassFields(ClassMetaData.java:1162)
        at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(MappingRepository.java:306)
        at org.apache.openjpa.meta.MetaDataRepository.preMapping(MetaDataRepository.java:600)
        at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:487)
        at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:283)
        at org.apache.openjpa.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:271)
        at org.apache.openjpa.jdbc.meta.MappingTool.getMapping(MappingTool.java:660)
        at org.apache.openjpa.jdbc.meta.MappingTool.buildSchema(MappingTool.java:732)
        at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:630)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:161)
        at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:127)
        at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:164)
        at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:139)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:187)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:140)
        at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:52)
        at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:378)
        at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:302)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:349)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:255)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy15.save(Unknown Source)
        at com.abc.xyz.xxx.repxxx.delegate.RepxxxxxDelegateImpl.schedule(RepxxxxxDelegateImpl.java:114)
        at com.abc.xyz.xxx.repxxx.RepxxxxxxImpl.schedule(RepxxxxImpl.java:61)
        at dao.execute.Repxxxxxxxx.main(Repxxxxxxx.java:200)

   
   
  Could you share any samples available for persisting data uses sequence-generator of database
and foreigkey constraint with may-to- one mapping.
   
  Thanks in advance for your help.
   
  Regards
  Saidulu



       
---------------------------------
 Check out what you're missing if you're not on Yahoo! Messenger 
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message