public static AssociationType getAssociationType(Field persistentField, byte persistenceMode) {
AssociationType result = AssociationType.NONE;
if (PERSIST_MODE_DELETE == persistenceMode) {
PersistentAttribute att = persistentField.getAnnotation(PersistentAttribute.class);
if (att != null) {
result = att.removeAssociationType();
} else {
result = persistentField.getAnnotation(AssociatedEntityList.class).removeAssociationType();
}
} else if (PERSIST_MODE_SAVE == persistenceMode) {
PersistentAttribute att = persistentField.getAnnotation(PersistentAttribute.class);
if (att != null) {
result = att.saveAssociationType();
} else {
result = persistentField.getAnnotation(AssociatedEntityList.class).saveAssociationType();
}
} else if (PERSIST_MODE_UPDATE == persistenceMode) {
PersistentAttribute att = persistentField.getAnnotation(PersistentAttribute.class);
if (att != null) {
result = att.updateAssociationType();
} else {
result = persistentField.getAnnotation(AssociatedEntityList.class).updateAssociationType();
}
}