Hi, Sorry for the late reply. This was indeed a bug in JCROM, as per this issue: http://code.google.com/p/jcrom/issues/detail?id=30
I've fixed this in release 1.3 which should be out in the coming weeks. In 1.3 you will not need to use the mixin type String array in the DAO. For a full list of changes in 1.3, see here: http://code.google.com/p/jcrom/issues/list?can=1&q=label%3AMilestone-Release1.3 In the future, please post any JCROM related questions on the JCROM user list at http://groups.google.com/group/jcrom, as I monitor that list much more closely and will be faster to respond. Thanks for using JCROM! Regards, OGG rokham wrote: > > Hi all, > > I have discovered what I was doing wrong. All I had to do was to pass in a > string array > private static final String[] MIXIN_TYPES = {"mix:versionable"}; > > to AbstractJcrDAO's constructor (as a 4th parameter). > > > rokham wrote: >> >> Hi all, >> >> I'm trying to use Jcrom to map my POJOs onto Jackrabbit. I've used >> Jcrom's annotation to indicate that my persistent object is versionable >> like: >> >> @JcrNode(mixinTypes = {"mix:versionable"}) >> public class CurnitOtmlImpl{ .....} >> >> I use Jcrom to create the object and once it's created, I set some more >> properties on the object and call update on it. The reason I have to do >> that is because once the object is created certain information is set for >> the object (eg, UUID, object path) which I'm interested to save in >> jackrabbit. >> >> My problem is this: >> >> When I step into the code for >> public abstract class AbstractJcrDAO<T> implements JcrDAO<T> {...} >> abstract class, I get to this method: >> >> protected String update( Node node, T entity, String childNodeFilter, int >> maxDepth ) throws Exception { >> if ( isVersionable ) { >> node.checkout(); >> } >> String name = jcrom.updateNode(node, entity, childNodeFilter, >> maxDepth); >> session.save(); >> if ( isVersionable ) { >> node.checkin(); >> } >> return name; >> } >> >> In the update method above, I realized that "isVersionable" is false and >> therefore my node is not versioned in jackrabbit. >> >> Does anyone happen to know if there's a bug in Jcrom? Is there a quick >> fix I could use to get my stuff working? I believe the problem is with >> Jcrom interpreting the class annotation, indicating that this object is >> versionable. >> >> I really really appreciate any help. I'm under a deadline and like to get >> this done ASAP. >> >> Thank you all in advance, >> >> Rokham >> > > -- View this message in context: http://www.nabble.com/Versioning-with-Jcrom-tp16758079p16824716.html Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
