Toplink - Many-to-Many Mapping issue
Hi
I have the following tables
User
Place
Team
User : uid , name (where uid is primay key)
Place : uid , pid( where uid and pid are composite primary keys)
Team : tid , name , pid( where tid is primary key)
Here the following mappings :
one user is belongs to many places
one user have many teams( by place)
user have many teams
i have created many to many mapping between place(or user) and team tables using intermediate table user_team( uid ,tid). But when i try to retrieve the teams for user id then i m getting all the teams. Here i need to filter the teams by only place id instead getting all the teams.
For example:
if user id is belongs to place id 101 then i need to get only teams belongs to place id 101. But i m getting all the places(101,102) teams for same user id which belongs to place id 101.
Please help me out how i can create valide mapping between all the tables to retrieve valid data. i m using toplink workbench(10g - 9.0.4).
Your model seems confused, you may wish to re-think you model. It seems odd that a place would have a user id, seems more like it is a m-m join table between user and team, but then it should have a team id not a place id.
You can use a selectionCriteria() on a ManyToManyMapping to define complicated m-m joins, but you would probably be better re-thinking your model. What object model are you trying to do exactly? Go from there, then define your data-model.
-- James : http://www.eclipselink.org
Similar Messages
-
Inheritance and One-To-Many Mapping Issue
Are there any known issues with TopLink 4.6 mapping a one-to-many relationship where the classes in the list span more than 2 levels deep in the inheritance chain? We seem to notice that TopLink creates the class that is 2 levels deep before the owning class.
Sorry for the delayed response to your post. I'm not sure I follow what you mean by "owning class". You have a 1-M mapping where the M has inheritance. Are you mapping to the root of the inhertance hierarchy, or to a leaf class? I.e., do you have a 1-M "Company - Employee" or a 1-M "Company - SalariedEmployee". In this example, what would you call the "owning class"?
- Don -
OLAP issue with MANY TO MANY mapping
Hi All,
We have a requirement where we have to pull specific measures & associated dimensions data from an OLAP to SQL tables. The source cube has almost 80 % of MANY TO MANY mappings.
When we pull this data to SQL tables either by writing MDX or DMX dimension level metric values are not matching with what OLAP browsing is providing.
When we pull this measure with only regular dimensions metric values with all dimensions exactly match. The mismatch issue comes when we have at least 1 MANY TO MANY dimension part of MDX or DMX query. Further to this we have pulled all intermediate facts
& dimensions involved in MANY TO MANY mapping into SQL tables & tried a number of JOINS but the metric values haven’t match up.
We are very close on delivery dates & are not sure on any resolution. Could you please guide us on next steps here.
Thanks is advance.Hi All,
We have a requirement where we have to pull specific measures & associated dimensions data from an OLAP to SQL tables. The source cube has almost 80 % of MANY TO MANY mappings.
When we pull this data to SQL tables either by writing MDX or DMX dimension level metric values are not matching with what OLAP browsing is providing.
When we pull this measure with only regular dimensions metric values with all dimensions exactly match. The mismatch issue comes when we have at least 1 MANY TO MANY dimension part of MDX or DMX query. Further to this we have pulled all intermediate facts
& dimensions involved in MANY TO MANY mapping into SQL tables & tried a number of JOINS but the metric values haven’t match up.
We are very close on delivery dates & are not sure on any resolution. Could you please guide us on next steps here.
Thanks is advance. -
Mapping issue, "many to many" mapping
Hi specialists!
I have to map this structure:
source
segment_1 (1...n)
key_1
aaa
bbb
segment_2 (1...n)
key_2
ccc
ddd
Target:
segment_2
ccc
ddd
The condition is segment_1=>key1 = segment_2=>key2
The problem is that I need to check each segment_1 with each segment_2.
Is it possible using standard mapping functions?Dani_K,
This can be done with standard mapping if your source.segment_1.key_1 is unique. If it is not, you could end up with a many to many mapping which would be difficult no matter how you map.
Try this:
For segment_2
source.segment_1.key_1 (right click, context, source) ---> sort --->
source.segment_2.key_2 (right click, context, source) ---> sort --->
equalsS ---> ifWithoutElse --->
source.segment_2 (then)
removeContexts (after the If Then)---> target.segment_2
For ccc
source.segment_1.key_1 (right click, context, source) ---> sort --->
source.segment_2.key_2 (right click, context, source) ---> sort --->
equalsS ---> ifWithoutElse --->
source.segment_1.ccc (right click, context, source) (then)
removeContexts (after the If Then)---> SplitByValue(Each Value) ---> target.segment_2.ccc
For ddd
source.segment_1.key_1 (right click, context, source) ---> sort --->
source.segment_2.key_2 (right click, context, source) ---> sort --->
equalsS ---> ifWithoutElse --->
source.segment_1.ddd (right click, context, source) (then)
removeContexts (after the If Then)---> SplitByValue(Each Value) ---> target.segment_2.ddd
Ideally, the segment_1.Key_1 and segment_2.key_2 are sorted before you process the message. If so, remove the sort above. -
Hi,
I'm working with two classes Car and Customer. The Car class has a Vector of Customers and the Customer class has a Vector of Car. Both are related by a many to many mapping.
I have noticed that I have to set one of the vector to read only to avoid the error message "More than one writable many-to-many mapping can not use the same relation table" in the mapping workbench.
I can understand that but is there a way to work around, I mean to be able to add a car to a customer and add a customer to a car with the both vectors?
Is there something to do with the cache?
I use Vector for the collection or Map class, have I to do otherwise?Hello Vladislav, I understand your first question in this thread, but I'm not sure I follow the rest, so let me respond to your first post:
"I have noticed that I have to set one of the vector to read only to avoid the error message "More than one writable many-to-many mapping can not use the same relation table" in the mapping workbench.
I can understand that but is there a way to work around, I mean to be able to add a car to a customer and add a customer to a car with the both vectors?"
The issue here is that with a Many to Many mapping the mapping is responsible for writing to the association table. So, you have a "CAR_CUST" association table. Imagine you add a Car "101" to a customer "501" and the requisite customer "501" to that car "101" in your object model. Then the association table should only be updated once, with an entry of "101, 501". But since the M-M is mapped in both directions, you need to tell TopLink which of these to consider as the "master" when updating the database.
If you didn't make one of the M-M mappings "read only", then TopLink would insert "101, 501" twice in the association table, and then at a later date you would see that the customer 501 had two 101 cars!
We do have a feature that allows for TopLink to maintain bidirectional relationships such that if you add or remove a target from one relationship, TopLink will automatically add/remove it from the opposite direction. In my opinion this is lazy programming! A good Java developer should insist on keeping his model up to date on his own. This feature was added because it's part of the EJB spec, not necessarily because it's a good idea ;)
- Don
Is there something to do with the cache?
I use Vector for the collection or Map class, have I to do otherwise? -
Key Method in one to many mapping
I have problem in one to many mapping. I use a composite key and use get method of that key as Key Method, toplink seems not to realize this change, and can't acommodate that.
any one had same problem?Could you explain in more detail what it is you are tyring to do? By 'Key Method' do you mean you are using a Map as the collection type of a OneToMany mapping? What do you mean by change? Are you changing the composit key?
--Gordon -
Setting criteria on one-to-many mapping
Hello,
A quick question. Let's say you have two tables, TABLE A and TABLE B. TABLE A- which has a one to many relationship with TABLE B.
When I do a query to get an object from TABLE A, I also get back a collection of TABLE B objects. I'd like to be able to alway be able to restrict the TABLE B objects I get back by adding an additional criteria like "where TABLE_B.DRAFT = 'N'" so that I always only get back TABLE B objects that are not drafts. Is there anyway to add this to the DirectToField Mapping or anywhere else in the Toplink Project so that I don't have to specifically setup the query in my DAO code?
Thanks in advance for any help,
MarkThis is a follow-on to the previous question. I've been asked to create a domain object, Member, that would have two relationships with the child table Rec (Recommendations), a one-to-one mapping with the only record in the Rec table that has is "approved", and a one-to-many mapping with all the records for the Member. I realize from the answer received above that putting criteria in a mapping isn't recommended, but did want to see if it was even doable in case it was needed. Unfortunately, I get this error below:
"A non-read-only mapping must be defined for the sequence number field."
Below are my relevant mappings. Any thoughts on this?
Thanks,
Mark
OneToOneMapping approvedRecInfoMapping = new OneToOneMapping();
approvedRecInfoMapping.setAttributeName("approvedRecInfo");
approvedRecInfoMapping.setGetMethodName("getApprovedRecInfoHolder");
approvedRecInfoMapping.setSetMethodName("setApprovedRecInfoHolder");
approvedRecInfoMapping.setReferenceClass(domain.Rec.class);
approvedRecInfoMapping.useBasicIndirection();
approvedRecInfoMapping.readOnly();
approvedRecInfoMapping.addForeignKeyFieldName("PROM_REC.PRM_ID", "PROM_REC_MEMBER.ID");
approvedRecInfoMapping.setSelectionCriteria(new ExpressionBuilder().get("approved").equal("true"));
descriptor.addMapping(approvedRecInfoMapping);
OneToManyMapping publicRecsMapping = new OneToManyMapping();
publicRecsMapping.setAttributeName("publicRecs");
publicRecsMapping.setGetMethodName("getPublicRecs");
publicRecsMapping.setSetMethodName("setPublicRecs");
publicRecsMapping.setReferenceClass(domain.Rec.class);
publicRecsMapping.useTransparentCollection();
publicRecsMapping.readOnly();
publicRecsMapping.useCollectionClass(oracle.toplink.indirection.IndirectList.class);
publicRecsMapping.addTargetForeignKeyFieldName("REC.PRM_ID", "MEMBER.ID");
descriptor.addMapping(publicRecsMapping); -
Simple one to many mapping question
Hi,
In the Toplink tutorial there is a one to many relation between Employee and PhoneNumber, and one to one between PhoneNumber and Employee.
If I don't require can I eliminate the one to one relationship between PhoneNumber and Employee. Or Toplink requires it?
Thanks
-ManiHi,
The purpose of creating one-to-one back reference mapping in the target is so that the foreign key information can be written when the target object is saved. Alternatives to the one-to-one mapping back reference include:
Use a direct-to-field mapping to map the foreign key and maintain its value in the application. Here the object model does not require a back reference, but the data model still requires a foreign key in the target table.
Use a many-to-many mapping to implement a logical one-to-many. This has the advantage of not requiring a back reference in the object model and not requiring a foreign key in the data model. In this model the many-to-many relation table stores the collection. It is possible to put a constraint on the join table to enforce that the relation is a logical one-to-many relationship.
Raanan. -
Having trouble with the following poblem.. specially how to code getChildren??????? Help urgent
Create a class called Families which creates a one-to-many mapping of parent name (String) to Child objects. Create any needed member variables and write the two specified methods. (You do not need to write the Child class.)
class Families {
public void addToFamily( String parent, Child child) {
public List getChildren( String parent) {
I have done the following..
import java.util.ArrayList;
import java.util.List;
class Families {
private String parentName;
List <child> children = new ArrayList();
public Families(String name){
this.parentName = name;
public void addToFamily( String parent, child kid) {
Families f = new Families(parent);
f.children.add(kid);
public List<child> getChildren( String parent) {
return this.children;
}Having trouble with the following poblem.. specially
how to code getChildren??????? Help urgent
Create a class called Families which creates a
one-to-many mapping of parent name (String) to Child
objects. Create any needed member variables and write
the two specified methods. This key:
(You do not need to write the Child class.)How can the following line possibly work?
List <child> children = new ArrayList();It's not syntactically correct, AND you're not writing the Child class.
% -
Loading FLat file data using FDMEE having 1 to many mapping
Hi All,
I need to load a data from Flat file to hyperion planning applcation using FDMEE having one to many mapping
For e.g Data file has 2 records
Acc Actual Version1 Scene1 1000
Acc Actual Version1 Scene2 2000
now target application has 5 dimension and data need to be load as
acc Actual Version1 entity1 Prod2 1000
Acc Actual Version1 Entity2 Prod2 2000
Please suggest
Regards
AnubhavFrom your exmple I don't see the one too many mapping requirement. You have one source data line that maps to a single target intersection. Where is the one to many mapping requirement in your example?
-
How can I filter to find photos NOT pinned to a map? I have 28,000 phots with many mapped and many not. The Search function does not include GPS data. I haven't found way to search metadata inside or out of Elements.
How can I filter to find photos NOT pinned to a map? I have 28,000 phots with many mapped and many not. The Search function does not include GPS data. I haven't found way to search metadata inside or out of Elements.
-
Take2 - Many-to-Many mapping on a single object/table via an external table.
Plaease ignore the previous entry. Finger trouble on the keyboard
accidentally posted prior to completion!
Any takers on this one? If its simple, then great.
I currently have a problem making the correct meta-data via xdoclet for a
collection with a many-to-many mapping between an enhanced class and an
xref table (which does not have an enhanced class associated with it.)
Although page 184 of the Kodo JDO 3.01 Developers guide does spell out in
fairly academic terms what has to be done, it still seems fairly
impenetrable, after much mangling and hacking.
As far as I can see the significantly questionable attributes are:-
element-column.<pk column>*
and
ref-column.<pk column>*
The asterisks and the associated texts indicate that these entries can be
specified more than once.
Here is my Meta data.
* @jdo.field collection-type="collection"
element-type="com.letsys.erespond.business.model.event.Condition"
* @jdo.field-vendor-extension vendor-name="kodo" key="jdbc-field-map"
value="many-many"
* @jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/table" value="EventConditionConditionXref"
* @jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/element-column.ID" value="EVENTCONDITIONID"
* @jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/ref-column.EVENTCONDITIONID" value="ID"
private Collection groupsToConditions;
Here is the basic table which I wish to use for the xref
create table EventConditionConditionXref(
EventConditionId NUMBER(10) NOT NULL primary key,
EventConditionIdGroupTo NUMBER(10) NOT NULL primary key
The EventCondition class and table uses a field 'id' as its primary key.
The intention is the xref table will hold many-many associations between
multiple EventCondition.id instances in the underlying database.
Thus the joing condition would be :
select
EventConditionIdGroupTo
from
EventCondition ec, EventConditionConditionXref ecx
where
ec.id = ecx.EventConditionId
There are numerous variations that I have squeezed through it, but the net
effect has always been
BUILD FAILED
file:C:/dev/projectm/build.xml:303:
kodo.jdbc.meta.MappingInfoNotFoundException: The mapping for fie
ld "com.letsys.erespond.business.model.event.Condition.groupsToConditions"
is missing information on
how to link the fields table to its owning class table, or the given
information is invalid.
I have tried many interpretations as to how
element-column.<pk column>*
and
ref-column.<pk column>*
should be represented, but always with the same 'not enough info' message.
Am I missing something obvious, and/or not understanding something?
Cheers Ed.Ed-
I think what you want is:
@jdo.field collection-type="collection"
element-type="com.letsys.erespond.business.model.event.Condition"
@jdo.field-vendor-extension vendor-name="kodo" key="jdbc-field-map"
value="many-many"
@jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/table" value="EventConditionConditionXref"
@jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/ref-column.ID" value="EVENTCONDITIONID"
@jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/element-column.ID" value="EVENTCONDITIONIDGROUPTO"
Basically, the "ref-column.<primary key>" specifies the column in the
join table that holds the primary key of the source side of the relation
(the current class), and the "element-column.<primary key>" specifies
the column in the join table that holds the primary key of the
destination side of the relation (the content of the Collection field).
Since it appears that you want the relation to be from Condition to
Condition (i.e., have a relation it itself), the primary key in both
cases will be the 'ID' column.
Let us know if you still have problems with this. You might want to
check out our graphical mapping workbench in 3.1, which helps greatly
simplify composing your mappings.
In article <[email protected]>, Ed Bett wrote:
Plaease ignore the previous entry. Finger trouble on the keyboard
accidentally posted prior to completion!
Any takers on this one? If its simple, then great.
I currently have a problem making the correct meta-data via xdoclet for a
collection with a many-to-many mapping between an enhanced class and an
xref table (which does not have an enhanced class associated with it.)
Although page 184 of the Kodo JDO 3.01 Developers guide does spell out in
fairly academic terms what has to be done, it still seems fairly
impenetrable, after much mangling and hacking.
As far as I can see the significantly questionable attributes are:-
element-column.<pk column>*
and
ref-column.<pk column>*
The asterisks and the associated texts indicate that these entries can be
specified more than once.
Here is my Meta data.
* @jdo.field collection-type="collection"
element-type="com.letsys.erespond.business.model.event.Condition"
* @jdo.field-vendor-extension vendor-name="kodo" key="jdbc-field-map"
value="many-many"
* @jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/table" value="EventConditionConditionXref"
* @jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/element-column.ID" value="EVENTCONDITIONID"
* @jdo.field-vendor-extension vendor-name="kodo"
key="jdbc-field-map/ref-column.EVENTCONDITIONID" value="ID"
private Collection groupsToConditions;
Here is the basic table which I wish to use for the xref
create table EventConditionConditionXref(
EventConditionId NUMBER(10) NOT NULL primary key,
EventConditionIdGroupTo NUMBER(10) NOT NULL primary key
The EventCondition class and table uses a field 'id' as its primary key.
The intention is the xref table will hold many-many associations between
multiple EventCondition.id instances in the underlying database.
Thus the joing condition would be :
select
EventConditionIdGroupTo
from
EventCondition ec, EventConditionConditionXref ecx
where
ec.id = ecx.EventConditionId
There are numerous variations that I have squeezed through it, but the net
effect has always been
BUILD FAILED
file:C:/dev/projectm/build.xml:303:
kodo.jdbc.meta.MappingInfoNotFoundException: The mapping for fie
ld "com.letsys.erespond.business.model.event.Condition.groupsToConditions"
is missing information on
how to link the fields table to its owning class table, or the given
information is invalid.
I have tried many interpretations as to how
element-column.<pk column>*
and
ref-column.<pk column>*
should be represented, but always with the same 'not enough info' message.
Am I missing something obvious, and/or not understanding something?
Cheers Ed.
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
MappingInfoNotFoundException with one-many mapping to horizontal PC subclass
Hi,
I have a nasty niggling problem with a one-many mapping where the many
side is a horizontally-mapped persistent subclass:
kodo.util.FatalUserException: kodo.jdbc.meta.MappingInfoNotFoundException:
The reference mappings for one-to-many field "Invoice.openTrades" are not
in the table of the field's related persistent element
type.[Invoice.openTrades [kodo.jdbc.meta.OneToManyFieldMapping]]
at
kodo.runtime.PersistenceManagerImpl.attach(PersistenceManagerImpl.java:4363)...
NestedThrowablesStackTrace:
kodo.jdbc.meta.MappingInfoNotFoundException: The reference mappings for
one-to-many field "Invoice.openTrades" are not in the table of the field's
related persistent element type.[Invoice.openTrades
[kodo.jdbc.meta.OneToManyFieldMapping]]
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:134)
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:120)
at
kodo.jdbc.meta.OneToManyFieldMapping.fromMappingInfo(OneToManyFieldMapping.java:94)
at
kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:198)
at
kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:470)
at
kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:991)
at
kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:971)
at
kodo.jdbc.meta.AbstractClassMapping.getMappings(AbstractClassMapping.java:934)
at
kodo.jdbc.meta.AbstractClassMapping.getDeclaredFieldMappings(AbstractClassMapping.java:654)
at
kodo.jdbc.meta.AbstractClassMapping.resolve(AbstractClassMapping.java:796)
at kodo.jdbc.meta.MappingRepository.resolve(MappingRepository.java:431)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:349)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:177)
at
kodo.jdbc.meta.MappingRepository.getMetaData(MappingRepository.java:165)
at
kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2423)
at
kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2375)
at kodo.runtime.AttachManager.makePersistent(AttachManager.java:410)
at kodo.runtime.AttachManager.attach(AttachManager.java:279)
at kodo.runtime.AttachManager.attach(AttachManager.java:56)
at
kodo.runtime.PersistenceManagerImpl.attach(PersistenceManagerImpl.java:4349)
I have another one-many mapping on the "one" class which is fine and is
almost identical to the invalid mapping - it joins on the same
columns/foreign key. The only real difference is that my invalid "many"
side is a horizontally mapped subclass (parent class mapped to different
table). When I took that class out of its hierarchy and mapped it as base,
it works. I don't know why Kodo is saying the mapping for the join is not
found, as the "many" side has an invoice field mapped as one-one. The
superclass does not have a relation to invoice mapped. A slight
complication is that Invoice itself has a persistent superclass persisted
in the same table, but nothing refers to that so I don't think it is
relevant.
Class diagram is roughly like this:
BaseTrade
|
Invoice 1-* Trade
BaseReceipt
|
Invoice 1-* Receipt
Invoice mapped to Invoice table; Trade mapped to Trade table but its
superclass mapped to diff BaseTrade table; Receipt and its superclass
BaseReceipt mapped to Receipt table.
I saw an earlier posting on the same exception that mentioned "collection
element-type" - mine is specified as "Trade", ie the subclass.
Is there any reason why this should not work?
I can provide you with .jdo and .mapping files if necessary.
Many thanks,
AlexAlex-
Can you post your mapping? I just ran a test with a one-many relation to
a subclass of a horizontally mapped class, and it worked fine.
FYI, the example mapping I was using was:
<?xml version="1.0" encoding="UTF-8"?>
<mapping>
<package name="horizmany">
<class name="HorizManyOwner">
<jdbc-class-map type="base" pk-column="JDOID"
table="BUG1174OWNER"/>
<jdbc-version-ind type="version-number"
column="JDOVERSION"/>
<jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
<field name="relation">
<jdbc-field-map type="one-many"
ref-column.JDOID="OWNER_JDOID" table="BUG1174RELATIONSUB"/>
</field>
</class>
<class name="HorizManyRelationSub">
<jdbc-class-map type="base" pk-column="JDOID"
table="BUG1174RELATIONSUB"/>
<jdbc-version-ind type="version-number"
column="JDOVERSION"/>
<jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
<field name="horizmany.HorizManyRelationSuper.superString">
<jdbc-field-map type="value" column="SUPERSTRING"/>
</field>
<field name="owner">
<jdbc-field-map type="one-one"
column.JDOID="OWNER_JDOID"/>
</field>
<field name="subString">
<jdbc-field-map type="value" column="SUBSTRING0"/>
</field>
</class>
<class name="HorizManyRelationSuper">
<jdbc-class-map type="horizontal"/>
</class>
</package>
</mapping>
In article <[email protected]>, Alex Robbins wrote:
Hi,
I have a nasty niggling problem with a one-many mapping where the many
side is a horizontally-mapped persistent subclass:
kodo.util.FatalUserException: kodo.jdbc.meta.MappingInfoNotFoundException:
The reference mappings for one-to-many field "Invoice.openTrades" are not
in the table of the field's related persistent element
type.[Invoice.openTrades [kodo.jdbc.meta.OneToManyFieldMapping]]
at
kodo.runtime.PersistenceManagerImpl.attach(PersistenceManagerImpl.java:4363)...
NestedThrowablesStackTrace:
kodo.jdbc.meta.MappingInfoNotFoundException: The reference mappings for
one-to-many field "Invoice.openTrades" are not in the table of the field's
related persistent element type.[Invoice.openTrades
[kodo.jdbc.meta.OneToManyFieldMapping]]
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:134)
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:120)
at
kodo.jdbc.meta.OneToManyFieldMapping.fromMappingInfo(OneToManyFieldMapping.java:94)
at
kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:198)
at
kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:470)
at
kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:991)
at
kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:971)
at
kodo.jdbc.meta.AbstractClassMapping.getMappings(AbstractClassMapping.java:934)
at
kodo.jdbc.meta.AbstractClassMapping.getDeclaredFieldMappings(AbstractClassMapping.java:654)
at
kodo.jdbc.meta.AbstractClassMapping.resolve(AbstractClassMapping.java:796)
at kodo.jdbc.meta.MappingRepository.resolve(MappingRepository.java:431)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:349)
at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:177)
at
kodo.jdbc.meta.MappingRepository.getMetaData(MappingRepository.java:165)
at
kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2423)
at
kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2375)
at kodo.runtime.AttachManager.makePersistent(AttachManager.java:410)
at kodo.runtime.AttachManager.attach(AttachManager.java:279)
at kodo.runtime.AttachManager.attach(AttachManager.java:56)
at
kodo.runtime.PersistenceManagerImpl.attach(PersistenceManagerImpl.java:4349)
I have another one-many mapping on the "one" class which is fine and is
almost identical to the invalid mapping - it joins on the same
columns/foreign key. The only real difference is that my invalid "many"
side is a horizontally mapped subclass (parent class mapped to different
table). When I took that class out of its hierarchy and mapped it as base,
it works. I don't know why Kodo is saying the mapping for the join is not
found, as the "many" side has an invoice field mapped as one-one. The
superclass does not have a relation to invoice mapped. A slight
complication is that Invoice itself has a persistent superclass persisted
in the same table, but nothing refers to that so I don't think it is
relevant.
Class diagram is roughly like this:
BaseTrade
|
Invoice 1-* Trade
BaseReceipt
|
Invoice 1-* Receipt
Invoice mapped to Invoice table; Trade mapped to Trade table but its
superclass mapped to diff BaseTrade table; Receipt and its superclass
BaseReceipt mapped to Receipt table.
I saw an earlier posting on the same exception that mentioned "collection
element-type" - mine is specified as "Trade", ie the subclass.
Is there any reason why this should not work?
I can provide you with .jdo and .mapping files if necessary.
Many thanks,
Alex
Marc Prud'hommeaux
SolarMetric Inc. -
LSMW - 1 to many mapping ?
I want to create an LSMW mapping where my data file will contain a legacy equipment # that could create 1-many equipments in SAP. how can I do a 1 - many mapping? Whre do I handle that in LSMW workbench?
I'm not 100% I understand your question.
I'm pretty sure I've seen something similar done before with IDOCs. Basically we wanted to bundle all the same MARC segments for the same material into a single IDOC. You basically define two files, one with the complete data and a second with a list of unique material numbers. Then you map the second file to the header record and the first file to the detail records in the IDOC.
Otherwise, well it depends on how you are trying to load the load in. If it's by IDOC, then it's just an extra segment. -
Many forms issues in one spool
Hello,
Can we have many forms issues(smartforms) in one spool?
I need to send one print stream / PCL format not multiple spools.
Best Regards,Hello everybody,
Thanks for your replies.
I found another way to resolve this situation.
For many invoices who are saved in nast. We initialize no_dialog to space.
After in the loop at the invoices : for the first one no_close to 'X' and the last one with no_close parameter to space.
After the call FM(Smartform) we pass 'X' to no_open .
I hope that answered for all.
ls_control_param-no_dialog = space.
LOOP AT t_nast INTO nast.
AT FIRST.
ls_control_param-no_close = 'X'.
ENDAT.
AT LAST.
Close spool file
ls_control_param-no_close = space.
ENDAT.
PERFORM processing.
ENDLOOP.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
output_options = ls_output_options
user_settings = space
v_exemple = v_exemple
s_nast = s_nast
IMPORTING
job_output_info = ls_ssfcrescl
TABLES:
t_komv = t_komv
t_ekpo = t_ekpo
t_ekkn = t_ekkn
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5 .
ls_control_param-no_open = 'X'.
Best Regards
Thanks
Maybe you are looking for
-
TCP/IP connection in a loop
Dear Friends, I am trying to make my computer with labview to communicate with another computer running VB.net application. I am basically trying to set up a TCP/IP listener. I want the VI to continuously run and send the values based on a command bu
-
LR2.3 images too bright after import even with flat or no development opt. checked
Hi, was always experiencing too dark prints from LR in different version (currently I have 2.3 installed), done all screen calibrations whatsoever, and now that I tried to get to the bottom of the issue, I found that LR seems to brigten up images eve
-
Editing Music to Video in Final Cut Pro HD
Hey all, Im pretty new to this software so hopefully u guys can help. I want to stip the music off various types of video but keep dialogue and eventually add my own music. Is this possible using Final Cut? What about Soundtrack? Does it have to be a
-
Exchange Rate from Exchange Rate Table
Dear All, Is there any way to make the system to take the exchange rate from the Exchange Rate table and not from the base document when we are "Copy To" functionality instead of "Copy From"? I unchecked "Use Document Exchange Rate When Copying to Ta
-
Hello, with build 36, I had a desktop application which uses spring framework. There is an XML file that is read from the classpath, using the ClassPathXmlApplicationContext from spring. The XML file is in the root of my jar file. JNLP is used to rel