Examples of OneToManyMapping


Examples of org.eclipse.persistence.mappings.OneToManyMapping

                }
                return associations;
            }

            public void setAttributeValueInObject(Object object, Object value) {
                OneToManyMapping mapping = (OneToManyMapping)object;
                List associations = (List)value;
                mapping.setSourceKeyFields(NonSynchronizedVector.newInstance(associations.size()));
                mapping.setTargetForeignKeyFields(NonSynchronizedVector.newInstance(associations.size()));
                Iterator iterator = associations.iterator();
                while (iterator.hasNext()) {
                    Association association = (Association)iterator.next();
                    mapping.getSourceKeyFields().add((DatabaseField)association.getValue());
                    mapping.getTargetForeignKeyFields().add((DatabaseField)association.getKey());
                }
            }
        });
        sourceToTargetKeyFieldAssociationsMapping.setAttributeName("sourceToTargetKeyFieldAssociations");
        sourceToTargetKeyFieldAssociationsMapping.setXPath(getSecondaryNamespaceXPath() + "target-foreign-key/" + getSecondaryNamespaceXPath() + "field-reference");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.