don't generate "auxiliary" members for Jakarta Data static metamodel
since it doesn't seem like these are very usueful with the repository programming model
This commit is contained in:
parent
c517833758
commit
cf626df3db
|
@ -187,6 +187,7 @@ public abstract class AnnotationMeta implements Metamodel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAuxiliaryMembersForMirror(AnnotationMirror mirror, String prefix) {
|
private void addAuxiliaryMembersForMirror(AnnotationMirror mirror, String prefix) {
|
||||||
|
if ( !isJakartaDataStyle() ) {
|
||||||
mirror.getElementValues().forEach((key, value) -> {
|
mirror.getElementValues().forEach((key, value) -> {
|
||||||
if ( key.getSimpleName().contentEquals("name") ) {
|
if ( key.getSimpleName().contentEquals("name") ) {
|
||||||
final String name = value.getValue().toString();
|
final String name = value.getValue().toString();
|
||||||
|
@ -196,9 +197,10 @@ public abstract class AnnotationMeta implements Metamodel {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private NameMetaAttribute auxiliaryMember(AnnotationMirror mirror, String prefix, String name) {
|
private NameMetaAttribute auxiliaryMember(AnnotationMirror mirror, String prefix, String name) {
|
||||||
if ( !isJakartaDataStyle() && "QUERY_".equals(prefix) ) {
|
if ( "QUERY_".equals(prefix) ) {
|
||||||
final AnnotationValue resultClass = getAnnotationValue( mirror, "resultClass" );
|
final AnnotationValue resultClass = getAnnotationValue( mirror, "resultClass" );
|
||||||
// if there is no explicit result class, we will infer it later by
|
// if there is no explicit result class, we will infer it later by
|
||||||
// type checking the query (this is allowed but not required by JPA)
|
// type checking the query (this is allowed but not required by JPA)
|
||||||
|
@ -207,7 +209,7 @@ public abstract class AnnotationMeta implements Metamodel {
|
||||||
resultClass == null ? JAVA_OBJECT : resultClass.getValue().toString(),
|
resultClass == null ? JAVA_OBJECT : resultClass.getValue().toString(),
|
||||||
"jakarta.persistence.TypedQueryReference", null );
|
"jakarta.persistence.TypedQueryReference", null );
|
||||||
}
|
}
|
||||||
else if ( !isJakartaDataStyle() && "GRAPH_".equals(prefix) ) {
|
else if ( "GRAPH_".equals(prefix) ) {
|
||||||
return new TypedMetaAttribute( this, name, prefix, getQualifiedName(),
|
return new TypedMetaAttribute( this, name, prefix, getQualifiedName(),
|
||||||
"jakarta.persistence.EntityGraph", null );
|
"jakarta.persistence.EntityGraph", null );
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,11 @@ class NameMetaAttribute implements MetaAttribute {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAttributeNameDeclarationString() {
|
public String getAttributeNameDeclarationString() {
|
||||||
return new StringBuilder()
|
final StringBuilder declaration = new StringBuilder();
|
||||||
.append("public static final ")
|
if ( !annotationMetaEntity.isJakartaDataStyle() ) {
|
||||||
|
declaration.append( "public static final " );
|
||||||
|
}
|
||||||
|
return declaration
|
||||||
.append(annotationMetaEntity.importType(String.class.getName()))
|
.append(annotationMetaEntity.importType(String.class.getName()))
|
||||||
.append(' ')
|
.append(' ')
|
||||||
.append(prefix)
|
.append(prefix)
|
||||||
|
|
Loading…
Reference in New Issue