
Originally Posted by
mmolesworth
Are you saying that we should remove the Roo generated finders and insert them into the YourEntity.java class?
Exactly.

Originally Posted by
mmolesworth
Where should the public finders be created?
In your entity, you can't make modification to Roo ".aj" generated file.
Example : to put in your entity
Code:
@SuppressWarnings("unchecked")
public static User findUserEntryByEmail(String email) {
List<User> users = User.findUsersByEmail(email).getResultList();
if (users.size() == 1) {
return users.get(0);
}
return null;
}
private static TypedQuery<User> findUsersByEmail(String email) {
if (email == null || email.length() == 0) throw new IllegalArgumentException("The email argument is required");
EntityManager em = User.entityManager();
TypedQuery<User> q = em.createQuery("SELECT o FROM User AS o WHERE LOWER(o.email) = LOWER(:email)", EzUser.class);
q.setParameter("email", email);
return q;
}
If I'm still not clear, ask
.
--
Pascoual