| Summary: | Allow JPA classes to use both static and dynamic mappings | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Tom Ware <tom.ware> | ||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | NEW --- | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | ||||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 184615 [details]
Rough Patch
Attached a rough patch that address issues with our metadata processing code that disallows coexistence of static and dynamic fields
Still requires investigation: Having propertiesMap only contain dynamic fields Weaving: DynamicEntityImpl implements weaving interfaces. How will weaving of the static class interact with this? The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
This enhancement is to allow a class that contains both attributes that use PROPERTIES/FIELDS that are physically defined on the class along with attributes that are defined using dynamic JPA. e.g. public class Customer extends DynamicEntityImpl { private int id; private String name; public static DynamicPropertiesManager DPM = new DynamicPropertiesManager(); public Customer(){ super(); } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public DynamicPropertiesManager fetchPropertiesManager(){ return DPM; } } <?xml version="1.0" encoding="UTF-8"?> <entity-mappings version="2.1" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_1.xsd"> <entity class="test.model.Customer" access="VIRTUAL"> <attributes> <id name="id" access="FIELD"> </id> <basic name="name" access="FIELD"> </basic> <basic name="company" attribute-type="String" access="VIRTUAL"> </basic> </attributes> </entity> </entity-mappings> Notice that <basic name="company" attribute-type="String" access="VIRTUAL"> defines a virtual field and that Customer subclasses DynamicEntityImpl