jQAssistant / extended-objects

eXtended Objects - Lightweight and flexible datastore mapping of Java domain objects
Apache License 2.0
22 stars 7 forks source link

Support for multi indexes #89

Closed RickRainerLudwig closed 10 years ago

RickRainerLudwig commented 10 years ago

Currently only single indexes are allowed on types. Relating to compound primary key, but also needed for other purposes, the support multi indexes are needed.

For Titan, using also properties for discriminators, this is essential to support multiple types on one node.

RickRainerLudwig commented 10 years ago

I just recognized, that this ticket somewhat overlaps ticket #82 and that this needs to clarified:

1) Ticket #82 is about querying entities by compound keys, for example the movie stars graph: I want to search for a combination of first and last name. This needs to be done by a kind of "compound primary key". 2) This ticket is about having the possibility to mark multiple properties within the entity as indexed. I want to have these properties marked to check during data store initialization for the presence of these indexes and if they are not present and auto-creation is configured, to create them.

Currently, the @Indexed annotation is used for entity retrieval and also for the indexes. Maybe this should be separated? Like @Id (JPA's primary key annotation) and @Indexed for indexed properties?

DirkMahler commented 10 years ago

First draft of example API is working, please review "com.buschmais.xo.neo4j.test.find.FindByExampleTest" if the proposed concept meets the requirement.

CrystalMethod commented 10 years ago

Do you plan to release different artifacts for java7 vs. java8? Or what is the recommended procedure to include src/main/java7/* vs src/main/java8/*? My IDE complains about duplicated class Example.java

DirkMahler commented 10 years ago

The "find by example" feature is targeted to lambda expressions of Java 8 - therefore it will be necessary to provide different artifacts. I see that the current approach has some disadvantages

I'm currently thinking of one build using Java 8 and retrolambda to convert classes to language specification level 1.7 for attaching them with a dediated classifier. This would only hold for the XO core artifacts, i.e. xo.api, xo.spi and xo.impl - datastore may stick to Java 7.