}
}
itr.remove();
}
}
Annotation inheritance = new Annotation(Inheritance.class.getName(), constantPool);
ClassPool pool = ClassPool.getDefault();
pool.importPackage("javax.persistence");
pool.importPackage("java.lang");
EnumMemberValue strategy = (EnumMemberValue) Annotation.createMemberValue(constantPool, pool.makeClass("InheritanceType"));
strategy.setType(InheritanceType.class.getName());
strategy.setValue(InheritanceType.SINGLE_TABLE.name());
inheritance.addMemberValue("strategy", strategy);
annotationsAttribute.addAnnotation(inheritance);
if (myInfo.getDiscriminatorName() != null) {
Annotation discriminator = new Annotation(DiscriminatorColumn.class.getName(), constantPool);
StringMemberValue name = new StringMemberValue(constantPool);
name.setValue(myInfo.getDiscriminatorName());
discriminator.addMemberValue("name", name);
EnumMemberValue discriminatorType = (EnumMemberValue) Annotation.createMemberValue(constantPool, pool.makeClass("DiscriminatorType"));
discriminatorType.setType(DiscriminatorType.class.getName());
discriminatorType.setValue(myInfo.getDiscriminatorType().name());
discriminator.addMemberValue("discriminatorType", discriminatorType);
IntegerMemberValue length = new IntegerMemberValue(constantPool);
length.setValue(myInfo.getDiscriminatorLength());
discriminator.addMemberValue("length", length);
annotationsAttribute.addAnnotation(discriminator);
}
classFile.addAttribute(annotationsAttribute);
ByteArrayOutputStream bos = new ByteArrayOutputStream();