| Summary: | DynamicTypeBuilder needs an addUnidirectionalOneToManyMapping-method | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Frank Schwarz <fs5> |
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | eclipselink.orm-inbox, michael.f.obrien |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Bug Depends on: | 325699 | ||
| Bug Blocks: | |||
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
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