Hi,
I'm no guru and didn't completely understand the error,
but anyway it's weird you have mapped the
Code:
@Column( name = "sub_task" ), @Column( name = "parent_task" )
to int values, they should be a reference to the entity, as a set or other collection.
I think that because of this he isn't understanding them as FKs;
you may have other problems there but maybe this is confusing things a bit;
maybe you get a better error message if you fix that.
Also as you choose ManyToMany you will need a bridge-table, so I don't think you should have FKs in the subtask table.
regards,
Sanne