HHH-16633 add @see annotations to generated code

This commit is contained in:
Gavin King 2023-06-17 18:51:29 +02:00
parent c6658fbb84
commit 3211cb8e9b
2 changed files with 18 additions and 2 deletions

View File

@ -41,7 +41,13 @@ public abstract class AnnotationMetaAttribute implements MetaAttribute {
@Override
public String getAttributeDeclarationString() {
return new StringBuilder().append( "public static volatile " )
return new StringBuilder()
.append("\n/**\n * @see ")
.append(parent.getQualifiedName())
.append("#")
.append(element.getSimpleName())
.append("\n **/\n")
.append( "public static volatile " )
.append( parent.importType( getMetaType() ) )
.append( "<" )
.append( parent.importType( parent.getQualifiedName() ) )

View File

@ -12,6 +12,7 @@ import org.hibernate.jpamodelgen.model.Metamodel;
import java.util.List;
import static org.hibernate.internal.util.StringHelper.join;
import static org.hibernate.jpamodelgen.util.StringUtil.getUpperUnderscoreCaseFromLowerCamelCase;
/**
@ -56,7 +57,16 @@ public class QueryMethod implements MetaAttribute {
@Override
public String getAttributeDeclarationString() {
StringBuilder declaration = new StringBuilder();
declaration.append("public static ");
declaration
.append("\n/**\n * @see ")
.append(annotationMetaEntity.getQualifiedName())
.append("#")
.append(methodName)
.append("(")
.append(join(",", paramTypes.stream().map(annotationMetaEntity::importType).toArray()))
.append(")")
.append("\n **/\n")
.append("public static ");
StringBuilder type = new StringBuilder();
if (containerTypeName != null) {
type.append(annotationMetaEntity.importType(containerTypeName));