开发者

db4o: Same class, different java projects

I have two different Java Applications A and B. They should use the same Database for user management (If the User has an account in Application A, he also has an account in Application B and vice versa).

Both Application A and B have exactly the same User class. But when I create an User in Application A I can't retrieve this same User in Application B and vice-versa.

I've read in a forum:

db4o is able to do this. Different application can use the same database and access data of others "if you provi开发者_C百科de refferences" to the projects. I mean if you put your entity in a class library and add it as references to projects it wont be a problem

How could I achieve this?

Thanks in advance for any help.


db4o stores the fully qualified name of classes so if you want to access the same database from two (or more) different apps (with different package structures for the model classes) you have basically 2 options:

  • Have your model classes as a separate project used by the applications;
  • Configure aliases

Hope this helps.

Adriano

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜