Paul Merlin a écrit :
Hey,

I had in mind to implement an optional EntityFinder that works against a MongoDB EntityStore. I had hope it shouldn't need a StateChangeListener and could query the EntityStore data directly.

MongoDB EntityStore, like many other ones, relies on JSONMapEntityStore helper and simply translate the JSON as BSON that is natively supported by MongoDB. So all the data needed for querying should be here. But JSONEntityState is build with only the first Entity type, not the list of the Entity types (see JSONMapEntityStoreMixin#newEntityState(..)).

Without any core change I would have to add a StateChangeListener that add a 'types' key to the EntityStore data to circumvent the limitation. But it feels awkward to me.

From reading through the code it seems that the type information stored in JSONEntityState is never used. What would you think of changing 'type' to 'types' and putting there all the Entity types?

/Paul

Hum, it's not that simple. It seems that I overlooked some aspects of my wonderings and need to dive deeper in MapEntityStore and JSONMapEntityStore code. I'll come back later with this one.

/Paul


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to