JPA revisited

2016-10-15 Thread Niclas Hedhman
Gang, last time I brought up JPA, I think the consensus became; too complex to bother. But I think the need for "conventional persistence" interoperability is still an issue for us, and I think it should be tackled. Spring (and others?) are promoting a Repository-pattern for Spring Data JPA[1] and

Design flaw in EntityStore SPI?

2016-10-15 Thread Niclas Hedhman
Hi again, While looking into the feasibility of implementing a Repository EntityStore I realized that the current SPI seems flawed. The TYPE of an entity is stored with the entity and not the entity type that is being processed by the outside world. And then type lookup is used via the current Mod

Re: Design flaw in EntityStore SPI?

2016-10-15 Thread Niclas Hedhman
Ok, so I came to think about one issue that we are always struggling with in ES... polymorphism. I.e. we can fetch entities from the store using any of the declared types and not the "primaryType" used when it is stored. However, that raises the question... Should the following work at all? Perso