Community
Participate
Working Groups
Build Identifier: Trunk DynamicTypeBuilder is missing a method to add an *unidirectional* one-to-many-mapping. A normal one-to-many-mapping when applied unidirectionally will miss foreign key updates. public UnidirectionalOneToManyMapping addUnidirectionalOneToManyMapping( String name, DynamicType refType, String... fkFieldNames) { if (fkFieldNames == null || getType().getDescriptor().getPrimaryKeyFields().size() != fkFieldNames.length) { throw new IllegalArgumentException("Invalid FK field names: " + fkFieldNames + " for target: " + refType); } UnidirectionalOneToManyMapping mapping = new UnidirectionalOneToManyMapping(); mapping.setAttributeName(name); mapping.setReferenceClass(refType.getJavaClass()); for (int index = 0; index < fkFieldNames.length; index++) { String targetField = getType().getDescriptor().getPrimaryKeyFields().get(index).getName(); mapping.addTargetForeignKeyFieldName(fkFieldNames[index], targetField); } mapping.useTransparentList(); return (UnidirectionalOneToManyMapping) addMapping(mapping); } Reproducible: Always
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink