So, the way I typically persist an object is to call entityManager.persist(object). Is there a way to persist an object in its own constructor, so I don’t have to create a bunch of factory classes?
Likewise, is there a way to remove an object using an instance method?
Are either of these things good ideas, or should I be using an external class to do this stuff?
This is not a good idea, since Hibernate needs to call the object’s constructor when it instantiates an instance of the object to return to you from a query.
In a clean design, your entity objects / domain model layer would not be aware of the persistence layer at all.