我有以下课程:
@Entity(name = "focusoc_orbit")
@Data
public class OrbitAdapter extends Adapter{
@Id
private String id;
...
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
...
}
和,
@Entity(name = "focusoc_conjunction")
@Data
public class ConjunctionAdapter extends Adapter {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne
@JoinColumn(name = "target_id")
private OrbitAdapter target;
@ManyToOne
@JoinColumn(name = "chaser_id")
private OrbitAdapter chaser;
...
public OrbitAdapter getTarget(){
return target;
}
public void setTarget(OrbitAdapter target){
this.target = target;
}
public String getChaserId(){
return chaserId;
}
public void setChaser(OrbitAdapter chaser){
this.chaser = chaser;
}
...
}
我还定义了存储库:
public interface ConjunctionRepository extends PagingAndSortingRepository<ConjunctionAdapter, Long> {
public ConjunctionAdapter findByTargetAndChaserAndTimeOfCloseApproach(String target, String chaser, Date timeOfCloseApproach);
}
当我尝试拨打电话时,
ConjunctionAdapter c = conjunctionRepository.findByTargetAndChaserAndTimeOfCloseApproach(targetId, chaserId, timeOfCloseApproach());
它返回错误:
org.hibernate.property.access.spi.PropertyAccessException:通过持久属性 [gcs.fds.focusoc.adapter.OrbitAdapter# 的反射访问字段 [private java.lang.String gcs.fds.focusoc.adapter.OrbitAdapter.id] 时出错id]:02035A”
我尝试了很多不同的解决方案,但发现它对我不起作用。有什么帮助吗?
元芳怎么了
相关分类