Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //The entity with mapping: TargetClass.class, this class containes externalAttendee externalAttendee field bind to @Column("AttendeeID")
- //Table with structure AttendeeId | key | value: AttendeeProperties
- ClassDescriptor cd = session.getClassDescriptor(TargetClass.class);
- DirectMapMapping dmm = new DirectMapMapping();
- dmm.dontUseIndirection();
- dmm.setReferenceTableName("AttendeeProperties");
- dmm.setDirectKeyFieldName("AttendeeProperties.key");
- dmm.setDirectFieldName("AttendeeProperties.value");
- dmm.setAttributeName("externalAttendee");
- dmm.addReferenceKeyFieldName("AttendeeID", "AttendeeID");
- cd.addMapping(dmm);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement