JPA does not allow this as it requires foreign keys to reference the full primary key for identity purposes, and it might not work well with caching. If you can, I would recommend switching to a more traditional model using a relation table that uses the actual primary keys.
If your provider allows mapping partial pks (I believe Hibernate does), what you would do is make two 1:M mappings each using a JoinColumn instead of JoinTable, but mark the one on Node->Authority as insertable=false, updatable=false
For example, something like:
public class Node {
@Id
private Integer id;
private String nameNode;
@OneToMany
@JoinColumn(name = "idAuthorites", referencedColumnName = "idAuthorites", insertable=false, updatable=false)
private Set<Authority> authorities;
...
public class Authority {
@Id
private AuthorityPK pk;
private String person;
@OneToMany
@JoinColumn(name = "idAuthorites", referencedColumnName = "idAuthorites")
private Set<Node> nodes;
...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…