I have never worked with annotations but I think it should be something like:
@Entity
@Table(name = "EVENT")
public class Event {
@OneToMany(cascade = CascadeType.ALL,CascadeType.DELETE_ORPHAN)
@JoinColumn(name = "ACTIVITYID")
public List<ActivityParam> activityParam;
@Id
@GeneratedValue
@Column(name = "ID")
private long id;
----
-----------
}
-------------------------------
EventParam.java
@Entity
@Table(name = "ACTIVITY_PARAM")
public class EventParam {
@PrimaryKeyJoinColumn(name =EVENTID",
referencedColumnName = "ID")
public Event event;
@Id
@GeneratedValue
@Column(name = "ID")
private long id;
@Column(name = "EVENTID")
private long eventId;
.....
.........
}
http://www.hibernate.org/hib_docs/annot ... ec-cascade