hi Emmanuel
thanks for your reply.
Let me explain to you in a clearer way what I'd would like to do:
There is a objects hierarchy (A), but we have created a subset (B)of it because we are not interested in persisting the whole hierarchy.
By subset , I mean the following:
We have this class in the objects hierarchy A
Code:
public class Segment{
private String destination
private String origin
private String airlineCode;
// getters/setters for this fields
}
We're only interested in persisting attributes :destination and origin, and we want to persist also a new attribute Date
Therefore, we end up having the following:
Code:
public class MySegment extends Segment{
private Date departureDate;
// getter/setter for this field
}
And we have the mapping for this object which is MySegment.hbm.xml
which will contain mapping for following attributes:
Segment.destination
Segment.origin
MySegment.departureDate
now, when we want to update MySegment, we retrieve the persistent version of it, and then we are able to set new values for all attributes, including those that are not included in the mapping (which is NOT what we want) and then update the object.
Therefore, I was looking for a way to sort of disable the setting of non-mapped attributes.
am i making myself clearer? if not, just let me know what it is not clearly explained....
any help would be much appreciated
Patria
Code:
Code:
Code: