Hi All,
Is it possible to persist an object using hibernate mappings, only if certain condition on the object property is true and the condition is specified in hibernate config? This requirement comes from persisting partial entries of a collection using hibernate. I have the following example. Lets say we have Event Object that has reference to collection of EventTypes. class Event { int eventId; List<EventType> eventTypes; }
class EventType { int eventTypeId; boolean isPublisherEvent; //other eventtype properties }
When calling hibernateTemplate.save(event), I would like to store only those EventTypes that have isPublisherEvent=true. I looked at hibernate filters and HQL, but the extra conditions are applied only during querying of tables, and not during persist/save. Is there anything else in hibernate that I could use to solve this.
Thanks Malay
|