473,424 Members | 1,708 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,424 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 1333

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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.