SDN 2.1.0.RELEASE + Cross-store + Scala + AspectJ - questions and issues
I've a number of questions re. the subject, but first let me roughly say what I would like to accomplish.
In essence I'd love to be able to:
- write my domain classes using Scala's case classes to take advantage of Scala's pattern matching and such
- have some of those annotated with @NodeEntity(partial = true)
- make use of the goodies of SDN's GraphRepository
Also, I've set up a maven project roughly guided by ideas found here, even though I am not planning to do cross-store with Mongo but with JPA.
I've looked at the restaurants-social and also at the tests in spring-data-neo4j-cross-store and I've seen that in every case the Java annotated POJOs are all weaved using AspectJ.
Questions & issues:
- is it possible at all not to weave my Scala classes (when doing cross-store I mean...)?
- tried weaving (org.codehaus.mojo:aspectj-maven-plugin:1.4 with aspectj 1.7.1) the bytecode produced by scalac (net.alchim31.maven:scala-maven-plugin:3.1.0) using case classes first, got ajc issues. javap shows injected methods but domain class is not implementing NodeBacked... (looks like the "declare parents" issue mentioned in the plugin comment here)
- reading Michael's comment, decided to revert to normal Scala classes. Again, same as above, albeit ajc issues change slightly
- tried not to weave Scala classes... and, since I get no free beer then (i.e. no .persist() method on my domain classes) and finding also ...cumbersome?... to have a @Transactional method doing both the saves (JPA and Neo4J, albeit it looks like it's the only way to go in both restaurants-social and in the cross-store examples)... I gave a shot at a single call: repository.persist(domainObject), where repository is the Spring-injected class implementing GraphRepository. Interestingly, it appears that it does fire all the JDBC stuff, although it then fails after, since it tries to cast my domain class into a NodeBacked...
I know it turned out to be a long post and probably also not so immediate to follow but I can provide any further info and, if needed, a sample project to reproduce each (i.e. points 2, 3, 4)