final String msg
= getMsg(Msg.ERR_TRANSIENT_CLASS_WITH_PERSISTENT_FIELD,
new String[]{
clazz.getName(),
field.getName() });
throw new EnhancerMetaDataUserException(msg);
}
if (field.isTransactional() && clazz.isTransient()) {
// non-persistent classes cannot have transactional fields
final String msg
= getMsg(Msg.ERR_TRANSIENT_CLASS_WITH_TRANSACTIONAL_FIELD,
new String[]{
clazz.getName(),
field.getName() });
throw new EnhancerMetaDataUserException(msg);
}
if (!field.isKnownTransient() && !field.isManaged()) {
// unspecified persistence modifier
final String msg
= getMsg(Msg.ERR_UNSPECIFIED_FIELD_PERSISTENCE_MODIFIER,
new String[]{
clazz.getName(),
field.getName() });
throw new EnhancerMetaDataUserException(msg);
}
// check annotation type
if (!field.isAnnotated() && field.isManaged()) {
// unspecified annotation type
final String msg
= getMsg(Msg.ERR_UNSPECIFIED_FIELD_ANNOTATION_TYPE,
new String[]{
clazz.getName(),
field.getName() });
throw new EnhancerMetaDataUserException(msg);
}
if (field.isAnnotated() && !field.isManaged()) {
// non managed field with annotation type
final String msg
= getMsg(Msg.ERR_NON_MANAGED_ANNOTATED_FIELD,
new String[]{
clazz.getName(),
field.getName() });
throw new EnhancerMetaDataUserException(msg);
}
if (field.isAnnotated() && clazz.isTransient()) {
// a non-persistent class cannot have an annotated field
final String msg
= getMsg(Msg.ERR_TRANSIENT_CLASS_WITH_ANNOTATED_FIELD,
new String[]{
clazz.getName(),
field.getName() });
throw new EnhancerMetaDataUserException(msg);
}
}
}