if (JPADoclet.isHibernatePresent)
lookupSequence();
}
private void lookupSequence() {
AnnotationDesc generatedValue = Utils.findAnnotation(property, GeneratedValue.class);
if (generatedValue == null)
return;
String generator = (String) Utils.getAnnotationValue(generatedValue, "generator");
if (generator == null)
return;
Class<?> genericGeneratorClass;
try {
genericGeneratorClass = Class.forName("org.hibernate.annotations.GenericGenerator");
} catch (ClassNotFoundException e) {
return;
}
List<AnnotationDesc> genericGenerators = Utils.findAnnotations(property.containingClass(), genericGeneratorClass);
AnnotationDesc genericGenerator = null;
for (AnnotationDesc gen : genericGenerators) {
String name = (String) Utils.getAnnotationValue(gen, "name");
if (name != null && name.equals(generator)) {
genericGenerator = gen;
}