I have created a POJO class in morphia to save data object to MongoDB ,
I have a property called 'unitPrice', i want to keep this as read only property, mean not allow to modify DB value once it save to mongo,
Is there a morphia annotation to do this or else,
Is it possible to bind @NotSaved annotation to the property at run time ?
This is my POJO
@Entity("items")
public class Items {
private int id;
private int sequence;
private int unitPrice;
}
Thanks
BR
Ero
I don't know of a way to bind @NotSaved
at runtime, but I could think of a (hacky) workaround:
It ain't pretty, but it should get the job done.