开发者

Using Stripersist with a test database

I am trying to write comprehensive unit and i开发者_开发问答ntegration tests for my project, but the integration database has a different connection string that the main database. I have loaded the persistence object and tweaked the appropriate settings to create an EntityManagerFactor, but I can't find a way to do this for stripersist.

I could create a duplicate persistence.xml, but that kinda sucks. I was hoping for a tidier way to do it.

I'd like to be able to initialize Stripersist with different connection settings, or find a way to have Stripes use my dedicated EntityManager.


There isn't anything built into Stripersist to allow you to easily switch between persistence.xml files. I'd recommend subclassing Stripersist to make it load your custom EntityManager. It should be fairly easy as Stripersist is mostly just glue between JPA and Stripes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜