【发布时间】:2018-07-26 20:08:43
【问题描述】:
为了完成另一项任务,我需要重新定义我的 pojos 类并使用属性访问来利用我提到的类中的 JavaFX 属性,但我遇到了这个错误。
org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: deposito, for columns: [org.hibernate.mapping.Column(productoses)]
我已经尝试了org.hibernate.MappingException: Could not determine type for: java.util.Set 和org.hibernate.MappingException: Could not determine type for: java.util.List 中提到的解决方案,但仍然无法成功。
Here 是我的 OneToMany 实体类,here 是我的 ManyToOne 类。
这是堆栈跟踪。
org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: deposito, for columns: [org.hibernate.mapping.Column(productoses)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:455)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:422)
at org.hibernate.mapping.Property.isValid(Property.java:226)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:597)
at org.hibernate.mapping.RootClass.validate(RootClass.java:265)
at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:329)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:451)
at org.hibernate.boot.internal.MetadataImpl.buildSessionFactory(MetadataImpl.java:170)
at ajfmo.inventario.utils.HibernateUtil.getSessionFactory(HibernateUtil.java:19)
at ajfmo.inventario.DAO.ProductDAO.<init>(ProductDAO.java:20)
at ajfmo.inventario.view.MainView.<init>(MainView.java:60)
编辑
This 是我的 HibernateUtil 类。 This 一个是出现在堆栈跟踪中的 DAO。
提前谢谢你,这是我第一个使用 hibernate 的项目......或者我的第一个项目。
【问题讨论】:
-
所以查看堆栈跟踪问题似乎在
HibernateUtil类中。它由ProductDAOclass 调用,由MainView类调用。您应该发布那些而不是您发布的课程。这会有很大帮助。另请查看this 以帮助人们解决您的问题。 -
@MarkusK 感谢您的评论。我编辑了帖子并添加了这两个类,但我认为问题不是来自那里,我认为是注释但仍然没有找到解决方法。
标签: jpa javafx annotations javafx-8