Re: [Beankeeper-discussion] Enforcing uniqueness constraints?
Brought to you by:
demonsystem
From: Brautigam R. <de...@ne...> - 2009-05-15 08:23:40
|
Jules írta: > I have a need to ensure that only one bean exists with a property set to > any specific value. If I were using SQL directly, I'd usually approach > this by adding a constraint to the table that the column was unique, but > there doesn't seem to be any way of making beankeeper do this. > > I've implemented it by locking the class, checking for existing values > with the attribute in question and then only creating if none exist, but > I'm not particularly happy with this. Is there a better way? I'm currently not aware of a more appropriate method to do this unfortunately. Robert. |