Glassfish说是不完整的

Glassfish说是不完整的,glassfish,web-deployment,Glassfish,Web Deployment,我使用了复合键,但我改变了主意,在NetBeans的web应用程序中删除了这种键。但Glassfish表示:由于JoinColumns内容无效,该模块尚未部署 Exception Description: The @JoinColumns on the annotated element [field client] from the entity class [class x.ClientOrder] is incomplete. When the source entity class us

我使用了复合键,但我改变了主意,在NetBeans的web应用程序中删除了这种键。但Glassfish表示:由于JoinColumns内容无效,该模块尚未部署

Exception Description: The @JoinColumns on the annotated element [field client] from the entity class [class x.ClientOrder] is incomplete. When the source entity class uses a composite primary key, a @JoinColumn must be specified for each join column using the @JoinColumns. Both the name and the referencedColumnName elements must be specified in each such @JoinColumn.
我已经从数据库中删除了所有的表,重新启动了容器,对项目调用了“Clean and Build”命令(成功了)。但是EJB部署失败了。我应该为容器做些什么忘记过去

实体的源代码:

@Entity
@Getter
@Setter
@Inheritance( strategy = InheritanceType.JOINED )
@DiscriminatorColumn( name = "roleType", discriminatorType = DiscriminatorType.STRING, length = 10 )
@NamedQuery( name=UserRole.QUERYNAME_GET_ROLE_BY_USERID_AND_TYPE, query = "SELECT ur FROM UserRole ur WHERE ur.userWR.id = :userID AND ur.roleType = :roleType" )
abstract public class UserRole implements Serializable
{
  private static final long serialVersionUID = 1L;
  public static final String QUERYNAME_GET_ROLE_BY_USERID_AND_TYPE = "userRole_getRoleByUserIDAndType";

  @Id
  @GeneratedValue( strategy = GenerationType.AUTO )
  private int id;

  @Column
  private String roleType;

  @Id
  @ManyToOne
  @JoinColumn( name="user_id", referencedColumnName = "id" )
  private UserWithRoles userWR;

}


@Entity
@Data
@NamedQuery( name = Client.QUERYNAME_GET_ALL_CLIENTS, query="SELECT c FROM Client c" )
public abstract class Client extends UserRole
{
  public static final String QUERYNAME_GET_ALL_CLIENTS = "client_GetAllClients";

}


@Entity
@Data
@NamedQuery( name=ClientOrder.QUERYNAME_GET_CLIENT_ORDERS, query = "SELECT co FROM ClientOrder co WHERE co.client = :userID" )
public class ClientOrder implements Serializable
{
  private static final long serialVersionUID = 1L;
  public static final String QUERYNAME_GET_CLIENT_ORDERS = "clientOrders_getClientOrders";

  @Id
  @GeneratedValue( strategy = GenerationType.AUTO )
  private int id;

  private String name;

  @ManyToOne
  @JoinColumn( name = "client_id", referencedColumnName = "id" )
  private Client client;

  @OneToMany( mappedBy = "clientOrder" )
  private List<ClientOrderItem> orderItems;

}
@实体
@吸气剂
@塞特
@继承(策略=InheritanceType.JOINED)
@鉴别器列(name=“roleType”,鉴别器类型=鉴别器类型.STRING,长度=10)
@NamedQuery(name=UserRole.QUERYNAME\u GET\u ROLE\u通过用户id和类型,query=“从用户角色中选择用户,其中ur.userWR.id=:USERID和ur.roleType=:roleType”)
抽象公共类UserRole实现了可序列化
{
私有静态最终长serialVersionUID=1L;
公共静态最终字符串QUERYNAME\u GET\u ROLE\u由用户标识和类型=“userRole\u getrolebyuseriandtype”;
@身份证
@GeneratedValue(策略=GenerationType.AUTO)
私有int-id;
@纵队
私有字符串角色类型;
@身份证
@许多酮
@JoinColumn(name=“user\u id”,referencedColumnName=“id”)
私用UserWithRoles userWR;
}
@实体
@资料
@NamedQuery(name=Client.QUERYNAME\u获取所有客户机,query=“从客户机c中选择c”)
公共抽象类客户端扩展用户角色
{
公共静态最终字符串QUERYNAME\u GET\u ALL\u CLIENTS=“client\u GetAllClients”;
}
@实体
@资料
@NamedQuery(name=ClientOrder.QUERYNAME\u GET\u CLIENT\u ORDERS,query=“从ClientOrder co中选择co,其中co.CLIENT=:userID”)
公共类ClientOrder实现可序列化
{
私有静态最终长serialVersionUID=1L;
公共静态最终字符串QUERYNAME\u GET\u CLIENT\u ORDERS=“clientOrders\u getClientOrders”;
@身份证
@GeneratedValue(策略=GenerationType.AUTO)
私有int-id;
私有字符串名称;
@许多酮
@JoinColumn(name=“client\u id”,referencedColumnName=“id”)
私人客户;
@OneToMany(mappedBy=“clientOrder”)
私人物品清单;
}

好的。UserRole表中出现错误。我忘了删除userWR字段上的第二个@Id注释。在我删除它并重新构建应用程序后,它将再次部署