'Is it a good idea to pass JPA entities as arguments to other classes?

Is it a good idea to pass JPA entities as arguments to other methods and above all to other classes? I dont think for the next reasons:

  • If dates are mutable objects and thats insecure, the same would applied for JPA entities, right?
  • Passing JPA entities to other classes is risky because they are more than JavaBeans, so if in the new class you access and navigate this object but in the new class there is no transaction, you would have errors.

Do you agree? Any more reasons?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source