I'm using Eclipse 4.5.0 for an EclipseLink 2.5 project. Eclipse is generating the metamodel for my entities, which works fine except for this case:
Entity:
public class User implements Serializable {
private String id;
private Set<String> groupNames;
}
Mapping:
<attributes>
<id name="id" />
<element-collection name="groupNames" fetch="EAGER" target-class="java.lang.String">
<column name="USERGROUP_NAME"/>
<collection-table name="USER_GROUP_MEMBERSHIP">
<join-column name="MEMBERS_ID" referenced-column-name="ID"/>
</collection-table>
</element-collection>
</attributes>
The generated model looks like this:
public class User_ {
public static volatile SingularAttribute<User, String> id;
public static volatile SetAttribute<User, Object> groupNames;
}
Even though I explicitly defined the target class to be a String, the model suggests groupNames to be Set<Object>
rather than Set<String>
Did I miss anything? Is there any way to force the metamodel generation to use String instead of Object?