just want to point out that I have a variable of ModuleType defined in the Module class.
ok I fixed it by moving the @OneToMany annotation over the field rather than the getter method.
You cannot mix and match your mapping declarations between field and getter methods.
You placed the @Id on a field, so the mapper is expecting that all your mapping information is placed on fields
Thanks for the clarification.
EJB Persistence spec section 2.1.1
When annotations are used, the placement of the mapping annotations on either the persistent fields or persistent properties of the entity class specifies the access type as being either field- or property-based access respectively.