我有一個TestEntity,並且此實體可以具有父TestEntity。 Spring數據JPA說無法確定類型:abc.entity.TestEntity,在表:test_entity,爲列:[org.hibernate.mapping.Column(parent)],我該如何解決這個問題?沒有在互聯網上找到任何東西,或者我搜索了錯誤的東西。Spring Data JPA無法確定屬於同一類對象的屬性的類型
package abc.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class TestEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String name;
private TestEntity parent;
public TestEntity(String name, TestEntity parent) {
this.name = name;
this.parent = parent;
}
public long getId() {
return id;
}
public String getName() {
return name;
}
public TestEntity getParent() {
return parent;
}
}
答案不,我不是,我只是錯誤地編輯的計算器包名。我修好了,謝謝! – phip1611