Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

db4o: Same class, different java projects

Tags:

db4o

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 provide 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.

like image 365
jcborges Avatar asked Nov 04 '22 16:11

jcborges


1 Answers

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

like image 80
Vagaus Avatar answered Dec 01 '22 06:12

Vagaus