idPropertyName
)
);
}
String generator = JandexHelper.getValueAsString( generatedValueAnn, "generator" );
IdGenerator idGenerator = null;
if ( StringHelper.isNotEmpty( generator ) ) {
idGenerator = meta.getIdGenerator( generator );
if ( idGenerator == null ) {
throw new MappingException(
String.format(
"@GeneratedValue on %s.%s refering an undefined generator [%s]",
configuredClass.getName(),
idName,
generator
)
);
}
entityBinding.getEntityIdentifier().setIdGenerator( idGenerator );
}
GenerationType generationType = JandexHelper.getValueAsEnum(
generatedValueAnn,
"strategy",
GenerationType.class
);
String strategy = IdGeneratorBinder.generatorType(
generationType,
meta.getOptions().useNewIdentifierGenerators()
);
if ( idGenerator != null && !strategy.equals( idGenerator.getStrategy() ) ) {
//todo how to ?
throw new MappingException(
String.format(
"Inconsistent Id Generation strategy of @GeneratedValue on %s.%s",
configuredClass.getName(),
idName
)
);
}
else {
idGenerator = new IdGenerator( "NAME", strategy, new HashMap<String, String>() );
entityBinding.getEntityIdentifier().setIdGenerator( idGenerator );
}
}