Hibernate is the best ORM in Java. It provides a wrapper in .NET also as NHiberate.But it can be tough when you have alot of entities to create manually and create a reference between them. The most comprehensive task is to manually develop the relationship between them. Yes there is database-approach also which generates all the things from the database, We are currently supposing model first approach and then connect database with it.
Eclipse provides many tools to generate the simple POJO classes by a simple visualizer. Texo is one of the good plugin in Eclipse that generate entities from EMF ecore models. When you connect the texo generated entities with hibernate via mapping in XML files. It pop out an error that
无法创建sessionFactory object.java.lang.ClassCastException:java.util.ArrayList无法转换为java.util.Set
因为Texo会生成具有LIST类型的实体,并且休眠会给出错误。 我们可以将所有Collection对象生成为SET来解决问题。
要解决此问题,我们必须生成ORM ANNOTATED MODEL并将所有集合属性“使用列表”属性设置为false
from: https://dev.to//shanalikhan/use-hibernate-with-texo-model-entities-4ip1