hi roland, in jcr there is no constraint for uniqueness of a property. given the inheritance of nodetypes this is a slightly more complicated idea than with tables of an rdbms.
also i find it questionable to introduce a constraint to check uniqueness of a title (i assume a string property) a bit questionable on the data layer (the repository, in this case). i would suggest to do this on an application layer. what do you think? regards, david On 11/21/05, Roland Kofler <[EMAIL PROTECTED]> wrote: > Hi all, we would like to introduce a constrain for our Title property > that asserts its uniqueness. > We want to do this as close to the datalayer as possible - in analogy to > column constrains in rdbms'. > The only method we came up to, is binding an Listener to the > ObserverManager. > a) Are there better ways to constrain properties? > b) If not, what is the best way to get the property that fired the event? > Is there a way to get the item that fired the event in the callback > method? Didn't find a solution for this. > By now we register the event to the second ancestor node 'pages', > which contains a 'page' and > look up in the callback if a 'title' change fired the event. > so we get a path "/s1:pages/page[2]/s1:title" among other property > changes. > Thank you for your help!! > > Roland Kofler > > > > > > > -- ---------------------------------------------------------------------- http://jcr.day.com JSR-170 in Action! ---------------------------------------< [EMAIL PROTECTED] >--- This message is a private communication. If you are not the intended recipient, please do not read, copy, or use it, and do not disclose it to others. Please notify the sender of the delivery error by replying to this message, and then delete it from your system. Thank you. The sender does not assume any liability for timely, trouble free, complete, virus free, secure, error free or uninterrupted arrival of this e-mail. For verification please request a hard copy version. mailto:[EMAIL PROTECTED] http://www.day.com David Nuescheler Chief Technology Officer Day Software AG Barfuesserplatz 6 / Postfach 4001 Basel Switzerland T 41 61 226 98 98 F 41 61 226 98 97
