Spring Roo App with multiple datasources
My Roo application needs to access two different db.
The main is a mysql db, setted up by Roo shell persistence command.
The other one is a mssql db and I use it for reading the users details. I create a reference to this datasource in applicationContext. Then I've created by hand the User class in my domain package setting the datasource defined in applicationContext. Then I've created the controller and the views, so I can show for example the list of all the users in user table.
Now, in my Job entity (stored in the main db), i need to put a reference to the User.
But when I run the project I get this error:
@ManyToOne(targetEntity = User.class)
private User user;
So I put the @Entity annotation in the User class but i got this error:
Invocation of init method failed; nested exception is org.hibernate.AnnotationException: @OneToOne or @ManyToOne on domain.Job.client references an unknown entity: domain.User.
What I do wrong?
Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: domain.User
Is this the best way for handling multiple datasources in Roo?
Thank you for any reply