public String getAnnotation() { StringBuilder annotation = new StringBuilder("@GeneratedValue"); annotation.append("(strategy=").append("GenerationType.").append(generationType.toString()); annotation.append(", generator=\"").append(generator).append("\""); annotation.append(")"); super.addPackage(EngineUtils.getPackageByEnumType(generationType)); return annotation.toString(); }
public String getAnnotation() { StringBuilder annotation = new StringBuilder("@ManyToOne("); if (fetchType != null) { annotation.append("fetch = FetchType.").append(fetchType.toString()).append(", "); super.addPackage(fetchType.getClass().getPackage().toString()); } if (cascadeType != null) { annotation.append("cascade = CascadeType.").append(cascadeType.toString()).append(", "); super.addPackage(cascadeType.getClass().getPackage().toString()); } if (optional != null) annotation.append("orphanRemoval = ").append(optional).append("\""); annotation.append(")"); String value = annotation.toString(); value = value.replace(", )", ")"); return value; }
public AnnotationGeneratedValue(String generator, GenerationType strategy) { super.addPackage(GeneratedValue.class.getPackage().getName()); this.generationType = strategy; this.generator = generator; }
public AnnotationManyToOne() { super.addPackage(ManyToOne.class.getPackage().getName()); }