473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Can I have join between entities in openJPA with transaction-type="RESOURCE_LOCAL" in

TECHNOLOGY: openJPA(ORM)

ISSUE:
I have a (one to many relationship)join between two entities. When I try to fetch the entities, it's throwing an error "It is not managed by a mapping that supports joins." What do I need to change for this program to work?

I am running the program using POJO java program and not on any appserver. Do i need to put my entities on appserver to join them?




EXCEPTION:
Exception in thread "main" <openjpa-2.0.0-r422266:935683 fatal user error> org.apache.openjpa.persistence.ArgumentException: You cannot join on column "taccount_new.account_cd". It is not managed by a mapping that supports joins.
at org.apache.openjpa.jdbc.meta.ClassMapping.assertJo inable(ClassMapping.java:283)
at org.apache.openjpa.jdbc.meta.ClassMapping.isForeig nKeyObjectId(ClassMapping.java:347)
at org.apache.openjpa.jdbc.meta.strats.RelationFieldS trategy.initialize(RelationFieldStrategy.java:264)
at org.apache.openjpa.jdbc.meta.FieldMapping.initiali zeMapping(FieldMapping.java:545)
at org.apache.openjpa.jdbc.meta.FieldMapping.resolve( FieldMapping.java:463)
at org.apache.openjpa.jdbc.meta.ClassMapping.initiali zeMapping(ClassMapping.java:905)
at org.apache.openjpa.meta.ClassMetaData.resolve(Clas sMetaData.java:1796)
at org.apache.openjpa.meta.MetaDataRepository.resolve Mapping(MetaDataRepository.java:760)
at org.apache.openjpa.meta.MetaDataRepository.resolve (MetaDataRepository.java:631)
at org.apache.openjpa.meta.MetaDataRepository.getMeta DataInternal(MetaDataRepository.java:385)
at org.apache.openjpa.meta.MetaDataRepository.getMeta Data(MetaDataRepository.java:358)
at org.apache.openjpa.meta.MetaDataRepository.getMeta Data(MetaDataRepository.java:439)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuild er.getClassMetaData(JPQLExpressionBuilder.java:176 )
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuild er.resolveClassMetaData(JPQLExpressionBuilder.java :152)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuild er.getCandidateMetaData(JPQLExpressionBuilder.java :242)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuild er.getCandidateMetaData(JPQLExpressionBuilder.java :212)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuild er.getCandidateType(JPQLExpressionBuilder.java:205 )
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuild er.access$200(JPQLExpressionBuilder.java:81)
at org.apache.openjpa.kernel.jpql.JPQLExpressionBuild er$ParsedJPQL.populate(JPQLExpressionBuilder.java: 2387)
at org.apache.openjpa.kernel.jpql.JPQLParser.populate (JPQLParser.java:61)
at org.apache.openjpa.kernel.ExpressionStoreQuery.pop ulateFromCompilation(ExpressionStoreQuery.java:154 )
at org.apache.openjpa.kernel.QueryImpl.newCompilation (QueryImpl.java:671)
at org.apache.openjpa.kernel.QueryImpl.compilationFro mCache(QueryImpl.java:652)
at org.apache.openjpa.kernel.QueryImpl.compileForComp ilation(QueryImpl.java:618)
at org.apache.openjpa.kernel.QueryImpl.compileForExec utor(QueryImpl.java:680)
at org.apache.openjpa.kernel.QueryImpl.compile(QueryI mpl.java:587)
at org.apache.openjpa.persistence.EntityManagerImpl.c reateQuery(EntityManagerImpl.java:985)
at org.apache.openjpa.persistence.EntityManagerImpl.c reateQuery(EntityManagerImpl.java:971)
at org.apache.openjpa.persistence.EntityManagerImpl.c reateQuery(EntityManagerImpl.java:100)
at com.rbc.boa.EntityBroker.getAllParty(EntityBroker. java:51)
at com.rbc.boa.JPAMain.party(JPAMain.java:49)
at com.rbc.boa.JPAMain.main(JPAMain.java:20)
Sep 17 '10 #1
0 1326

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: csk | last post by:
Hopefully someone will have some ideas on how to do this. I'm officially stumped. I have two entities to join. Simplified descriptions follow: The first has names and addresses...
8
by: niceguy | last post by:
I'm trying to select records from two tables. the following code works for what i want to to: set RSMain = conn.execute ( "select top 20 product, prodcode, edition, ( select count(id) from...
9
by: deko | last post by:
I need to create a Recordset of all records that appear in one table but do NOT appear in another. To get the records that appear in BOTH tables, I can do this: SELECT tblEntity.Entity_ID...
1
by: Tim Arnold | last post by:
I'm confused about why I get this error: UnicodeError: ASCII encoding error: ordinal not in range(128) when I try to load a wddx file containing this string: <string>The image file,...
4
by: Rares Vernica | last post by:
Hi, How can I unescape HTML entities like "&nbsp;"? I know about xml.sax.saxutils.unescape() but it only deals with "&amp;", "&lt;", and "&gt;". Also, I know about htmlentitydefs.entitydefs, but not...
2
by: Jean-François Michaud | last post by:
Hello, I was wondering if anybody could point me in the right direction regarding this. I have unicode entities in an XML in hexadecimal format and I need to be able to convert to ISO...
3
by: Martin Bless | last post by:
Hi friends, I've been OFF-Python now for quite a while and am glad being back. At least to some part as work permits. Q: What's a good way to encode and decode those entities like &euro; or € ?...
3
by: bsagert | last post by:
Some web feeds use decimal character entities that seem to confuse Python (or me). For example, the string "doesn't" may be coded as "doesn’t" which should produce a right leaning apostrophe....
6
by: BD | last post by:
Hi, all. I need to enforce a one-to-many relationship on 2 tables, with a join table. Say the join table contains account information. It has cust_no and acct_no. Both cust_no and acct_no are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.