Skip to content

Commit

Permalink
chore[wrapper]: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Jul 1, 2024
1 parent 62290fb commit d86f7b1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public static <PK extends Comparable<PK>, E extends IEntity<PK>> IEntityWrapper<
CtClass enhanceClazz = classPool.makeClass(EnhanceUtils.class.getName() + StringUtils.capitalize(NamespaceHandler.ORM) + UuidUtils.getLocalIntId());
enhanceClazz.addInterface(classPool.get(IEntityWrapper.class.getName()));

// 定义类实现的接口方法name
// 定义类实现的接口方法newEntity
CtMethod newEntityMethod = new CtMethod(classPool.get(IEntity.class.getName()), "newEntity", classPool.get(new String[]{Comparable.class.getName()}), enhanceClazz);
newEntityMethod.setModifiers(Modifier.PUBLIC + Modifier.FINAL);
String newEntityMethodBody = StringUtils.format("{ {} entity = new {}(); entity.{}({}); return entity; }", clazz.getName(), clazz.getName(), setIdMethod.getName(), rawObjectId(idField));
newEntityMethod.setBody(newEntityMethodBody);
enhanceClazz.addMethod(newEntityMethod);

// 定义类实现的接口方法name
// 定义类实现的接口方法versionFieldName
CtMethod versionFieldNameMethod = new CtMethod(classPool.get(String.class.getName()), "versionFieldName", null, enhanceClazz);
versionFieldNameMethod.setModifiers(Modifier.PUBLIC + Modifier.FINAL);
String versionFieldNameMethodBody = versionField == null ? "{ return null; }" : StringUtils.format("{ return \"{}\"; }", entityWrapper.versionFieldName());
Expand Down

0 comments on commit d86f7b1

Please sign in to comment.