Quoting Dan Bergh Johnsson <[email protected]>:

Hi crowd

I am preparing a new workshop to get more people get their toes wet in Qi4j - including myself.

Last time we ran the tutorial - and did not finish. The ambition this time is get a little bit further, and I would love to do some entity stuff.

So - here I am preparing writing an entity. I have finished it fine and nice, but when I try to create it (in a unit test) the UoW complains that there is no EntityStore contained in that module. I have searched the docs and tutorials but find no example.

Question: How do I get the entity store in place, and what should my beginner-choise be?


Hello,

and welcome back to Qi4j-world. :) You get entity store by adding appropriate entitystore services to your Qi4j assembly. For an unit test, the best entitystore would be MemoryEntityStoreService, which also requires UuidIdentityGeneratorService. You can add these to your assembly manually, or you can use org.qi4j.test.EntityTestAssembler located in project qi4j-core-testsupport.

Speaking of that project, it also provides a very useful org.qi4j.test.AbstractQi4jTest class for Qi4j-related unit tests. Just extend it (and implement abstract methods) in your own project, and you will get access to many Qi4j-related things (like UnitOfWorkFactory, TransientBuilderFactory, etc) in your unit test.



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

Reply via email to