Line
Link Here
|
0 |
-- Base (BASE) |
0 |
++ Locally Modified (Based On LOCAL) |
Lines 327-333
Link Here
|
327 |
modifiedClazz = genUtils.addClassFields(clazz, classFields); |
327 |
modifiedClazz = genUtils.addClassFields(clazz, classFields); |
328 |
modifiedClazz = make.addClassMember(modifiedClazz, idGetter); |
328 |
modifiedClazz = make.addClassMember(modifiedClazz, idGetter); |
329 |
modifiedClazz = make.addClassMember(modifiedClazz, idSetter); |
329 |
modifiedClazz = make.addClassMember(modifiedClazz, idSetter); |
330 |
modifiedClazz = genUtils.addImplementsClause(modifiedClazz, "java.io.Serializable"); |
|
|
331 |
modifiedClazz = genUtils.addAnnotation(modifiedClazz, genUtils.createAnnotation("javax.persistence.Entity")); |
330 |
modifiedClazz = genUtils.addAnnotation(modifiedClazz, genUtils.createAnnotation("javax.persistence.Entity")); |
332 |
|
331 |
|
333 |
String entityClassFqn = typeElement.getQualifiedName().toString(); |
332 |
String entityClassFqn = typeElement.getQualifiedName().toString(); |
Lines 339-346
Link Here
|
339 |
workingCopy.rewrite(clazz, modifiedClazz); |
338 |
workingCopy.rewrite(clazz, modifiedClazz); |
340 |
} |
339 |
} |
341 |
}; |
340 |
}; |
|
|
341 |
Task<WorkingCopy> task2 = new Task<WorkingCopy>() { |
342 |
|
342 |
|
|
|
343 |
@Override |
344 |
public void run(WorkingCopy workingCopy) throws Exception { |
345 |
workingCopy.toPhase(Phase.RESOLVED); |
346 |
TypeElement typeElement = SourceUtils.getPublicTopLevelElement(workingCopy); |
347 |
assert typeElement != null; |
348 |
ClassTree clazz = workingCopy.getTrees().getTree(typeElement); |
349 |
GenerationUtils genUtils = GenerationUtils.newInstance(workingCopy); |
350 |
ClassTree modifiedClazz = genUtils.addImplementsClause(clazz, "java.io.Serializable"); |
351 |
workingCopy.rewrite(clazz, modifiedClazz); |
352 |
} |
353 |
}; |
354 |
|
343 |
targetSource.runModificationTask(task).commit(); |
355 |
targetSource.runModificationTask(task).commit(); |
|
|
356 |
targetSource.runModificationTask(task2).commit(); |
344 |
|
357 |
|
345 |
return entityFo; |
358 |
return entityFo; |
346 |
} |
359 |
} |