相关疑难解决方法(0)

mappedBy引用未知的目标实体属性

我在注释对象中设置一对多关系时遇到问题.

我有以下内容:

@MappedSuperclass
public abstract class MappedModel
{
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="id",nullable=false,unique=true)
    private Long mId;
Run Code Online (Sandbox Code Playgroud)

那么这个

@Entity
@Table(name="customer")
public class Customer extends MappedModel implements Serializable
{

    /**
   * 
   */
  private static final long serialVersionUID = -2543425088717298236L;


  /** The collection of stores. */
    @OneToMany(mappedBy = "customer", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  private Collection<Store> stores;
Run Code Online (Sandbox Code Playgroud)

还有这个

@Entity
@Table(name="store")
public class Store extends MappedModel implements Serializable
{

    /**
   * 
   */
  private static final long serialVersionUID = -9017650847571487336L;

  /** many stores have a single …
Run Code Online (Sandbox Code Playgroud)

java orm hibernate hibernate-annotations

64
推荐指数
2
解决办法
9万
查看次数

标签 统计

hibernate ×1

hibernate-annotations ×1

java ×1

orm ×1