Quote:
Caused by: javax.persistence.PersistenceException: org.hibernate.MappingException: broken column mapping for: cmd.id of: spider2.config.Filter
The Exception says that the problem is in
FilterCommand cmd field mapping in
Filter class, where you have @OneToOne annotation.
I think you should use @ManyToOne annotation, since the same FilterCommand object can be used from several Filter objects. Because
FilterCommand cmd field also maps to same database column (command_name) as Id field
String filter, it should not be used for inserts (insertable=false, updatable=false).
Try this one and see if it works.
Code:
@Entity
@IdClass(FilterPK.class)
@Table(name="filter")
public class Filter {
@Id
@Column(name="share_path")
private String path;
@Id
@Column(name="command_name")
private String filter;
@Column(name="filter_order")
private int order;
@ManyToOne
@JoinColumn(name="command_name", referencedColumnName="name", insertable=false, updatable=false)
private FilterCommand cmd;
}