code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
private @Nullable Element memberMatchingPath( TypeElement entityType, Element candidate, AccessType accessType, StringTokenizer tokens, String token) { final Name memberName = candidate.getSimpleName(); final TypeMirror type = memberType( candidate, accessType, token, memberName ); if (type == null...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
memberMatchingPath
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private @Nullable Element memberForPath( TypeElement entityType, StringTokenizer tokens, DeclaredType type, Name memberName) { final TypeElement memberType = (TypeElement) type.asElement(); memberTypes.put( qualify( entityType.getQualifiedName().toString(), memberName.toString() ), memberType.getQualifiedNam...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
memberForPath
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static @Nullable TypeMirror memberType(Element candidate, AccessType accessType, String token, Name memberName) { final ElementKind kind = candidate.getKind(); if ( accessType == AccessType.FIELD && kind == ElementKind.FIELD ) { return fieldMatches(token, memberName) ? candidate.asType() : null...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
memberType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean fieldMatches(String token, Name fieldName) { return fieldName.contentEquals( token ); }
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
fieldMatches
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean getterMatches(String token, Name methodName) { if ( hasPrefix( methodName, "get" ) ) { return token.equals( decapitalize( methodName.subSequence( 3, methodName.length()).toString() ) ); } else if ( hasPrefix( methodName, "is" ) ) { return token.equals( decapitalize( methodName.subSequ...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
getterMatches
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void addQueryMethod( ExecutableElement method, @Nullable TypeMirror returnType, @Nullable TypeElement containerType, AnnotationMirror mirror, boolean isNative) { // The following is quite fragile! final String containerTypeName; if ( containerType == null ) { if ( returnType != null && r...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
addQueryMethod
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void addQueryMethod( ExecutableElement method, @Nullable TypeMirror returnType, @Nullable String containerTypeName, AnnotationMirror mirror, boolean isNative, AnnotationValue value, String queryString) { final List<String> paramNames = parameterNames(method); final List<String> paramTy...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
addQueryMethod
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private String fullReturnType(ExecutableElement method) { return typeAsString( memberMethodType(method).getReturnType() ); }
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
fullReturnType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static String returnTypeClass(TypeMirror returnType) { switch (returnType.getKind()) { case DECLARED: DeclaredType declaredType = (DeclaredType) returnType; final TypeElement typeElement = (TypeElement) declaredType.asElement(); return typeElement.getQualifiedName().toString(); case INT: ...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
returnTypeClass
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private @Nullable String implicitEntityName(@Nullable DeclaredType resultType) { if ( resultType != null && hasAnnotation(resultType.asElement(), ENTITY) ) { final AnnotationMirror annotation = getAnnotationMirror(resultType.asElement(), ENTITY); if ( annotation == null ) { throw new AssertionFailure("...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
implicitEntityName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private @Nullable TypeElement implicitEntityType(@Nullable TypeElement resultType) { if ( resultType != null && hasAnnotation(resultType, ENTITY) ) { return resultType; } else if ( primaryEntity != null ) { return primaryEntity; } else { return null; } }
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
implicitEntityType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static String entityName(DeclaredType resultType, AnnotationMirror annotation) { final AnnotationValue name = getAnnotationValue(annotation, "name"); if (name != null) { final String explicitName = name.getValue().toString(); if ( !explicitName.isEmpty() ) { return explicitName; } } return ...
Check the type of a parameter of a {@code @Find} method against the field type in the entity class. @return true if the parameter is multivalued (i.e. it's an {@code in} condition)
entityName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static String addFromClauseIfNecessary(String hql, @Nullable String entityType) { if ( entityType == null ) { return hql; } else if ( isInsertUpdateDelete(hql) ) { return hql; } else { final HqlLexer hqlLexer = HqlParseTreeBuilder.INSTANCE.buildHqlLexer( hql ); final List<? extends Token> ...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
addFromClauseIfNecessary
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private @Nullable DeclaredType resultType( ExecutableElement method, @Nullable TypeMirror returnType, AnnotationMirror mirror, AnnotationValue value) { if ( returnType != null && returnType.getKind() == TypeKind.DECLARED ) { final DeclaredType resultType = (DeclaredType) returnType; if ( !resultType.getTypeA...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
resultType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean isInsertUpdateDelete(String hql) { final String trimmed = hql.trim(); final String keyword = trimmed.length() > 6 ? trimmed.substring(0, 6) : ""; return keyword.equalsIgnoreCase("update") || keyword.equalsIgnoreCase("delete") || keyword.equalsIgnoreCase("insert"); }
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
isInsertUpdateDelete
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void validateHql( ExecutableElement method, @Nullable TypeMirror returnType, AnnotationMirror mirror, AnnotationValue value, String hql, List<String> paramNames, List<String> paramTypes) { final SqmStatement<?> statement = Validation.validate( hql, returnType, true, ...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
validateHql
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void validateUpdateHql( ExecutableElement method, @Nullable TypeMirror returnType, AnnotationMirror mirror, AnnotationValue value) { final boolean reactive = isReactive(); if ( !isValidUpdateReturnType( returnType, method, reactive ) ) { message( method, mirror, value, "return type of mu...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
validateUpdateHql
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private boolean isValidUpdateReturnType(@Nullable TypeMirror returnType, ExecutableElement method, boolean reactive) { if ( returnType == null ) { return false; } if ( reactive ) { // for reactive calls, don't use the returnType param, which has been ununi-ed, we want to check the full one final String r...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
isValidUpdateReturnType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void validateSelectHql( ExecutableElement method, @Nullable TypeMirror returnType, AnnotationMirror mirror, AnnotationValue value, SqmSelectStatement<?> statement) { if ( returnType != null ) { final JpaSelection<?> selection = statement.getSelection(); boolean returnTypeCorrect; if ( ...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
validateSelectHql
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void validateSql( ExecutableElement method, AnnotationMirror mirror, String sql, List<String> paramNames, AnnotationValue value) { // for SQL queries check that there is a method parameter for every query parameter ParameterParser.parse(sql, new ParameterRecognizer() { int ordinalCount = 0...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
validateSql
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
@Override public void ordinalParameter(int sourcePosition) { ordinalCount++; if ( ordinalCount > paramNames.size() ) { message(method, mirror, value, "missing method parameter for query parameter " + ordinalCount + " (add a parameter to '" + method.getSimpleName() + "')", Diagnost...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
ordinalParameter
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
@Override public void namedParameter(String name, int sourcePosition) { if ( !paramNames.contains(name) ) { message(method, mirror, value, "missing method parameter for query parameter :" + name + " (add a parameter '" + name + "' to '" + method.getSimpleName() + "')", Diagnostic.Kind...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
namedParameter
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
@Override public void jpaPositionalParameter(int label, int sourcePosition) { if ( label > paramNames.size() ) { message(method, mirror, value, "missing method parameter for query parameter ?" + label + " (add a parameter to '" + method.getSimpleName() + "')", Diagnostic.Kind.ERROR );...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
jpaPositionalParameter
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
@Override public void other(char character) { }
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
other
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean checkConstructorReturn(DeclaredType returnType, JpaSelection<?> selection) { final List<? extends JpaSelection<?>> selectionItems = selection.getSelectionItems(); if ( selectionItems == null ) { // should not occur return true; } final TypeElement typeElement = (TypeElement) returnT...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
checkConstructorReturn
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean constructorMatches( List<? extends JpaSelection<?>> selectionItems, List<? extends VariableElement> parameters) { int itemCount = selectionItems.size(); if ( parameters.size() == itemCount ) { for (int i = 0; i < itemCount; i++ ) { final JpaSelection<?> item = selectionItems.get(...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
constructorMatches
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean parameterMatches(VariableElement parameter, JpaSelection<?> item) { final Class<?> javaType = item.getJavaType(); return javaType != null && parameterMatches( parameter.asType(), javaType, item.getJavaTypeName() ); }
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
parameterMatches
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean parameterMatches(TypeMirror parameterType, Class<?> itemType, String itemTypeName) { final TypeKind kind = parameterType.getKind(); if ( kind == TypeKind.DECLARED ) { final DeclaredType declaredType = (DeclaredType) parameterType; final TypeElement paramTypeElement = (TypeElement) decla...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
parameterMatches
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean checkReturnedArrayType(ArrayType returnType) { final TypeMirror componentType = returnType.getComponentType(); if ( componentType.getKind() == TypeKind.DECLARED ) { final DeclaredType declaredType = (DeclaredType) componentType; final TypeElement typeElement = (TypeElement) declaredType...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
checkReturnedArrayType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private boolean checkReturnedEntity(EntityDomainType<?> model, TypeMirror returnType) { if ( returnType.getKind() == TypeKind.DECLARED ) { final DeclaredType declaredType = (DeclaredType) returnType; final TypeElement typeElement = (TypeElement) declaredType.asElement(); // final AnnotationMirror mirror = get...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
checkReturnedEntity
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void checkParameter( SqmParameter<?> param, List<String> paramNames, List<String> paramTypes, ExecutableElement method, AnnotationMirror mirror, AnnotationValue value) { final SqmExpressible<?> expressible = param.getExpressible(); //same object as param.getAnticipatedType() final String queryParamTyp...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
checkParameter
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void checkOrdinalParameter( SqmParameter<?> param, List<String> paramNames, List<String> paramTypes, ExecutableElement method, AnnotationMirror mirror, AnnotationValue value, String queryParamType) { int position = param.getPosition(); if ( position > paramNames.size() ) { message(method, mirror, v...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
checkOrdinalParameter
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static String stripTypeAnnotations(String argType) { while ( argType.startsWith("@") ) { int index = argType.indexOf(' '); if (index>0) { argType = argType.substring(index+1); } } return argType; }
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
stripTypeAnnotations
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void checkNamedParameter( SqmParameter<?> param, List<String> paramNames, List<String> paramTypes, ExecutableElement method, AnnotationMirror mirror, AnnotationValue value, String queryParamType) { final String name = param.getName(); int index = paramNames.indexOf( name ); if ( index < 0 ) { mes...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
checkNamedParameter
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean isLegalAssignment(SqmParameter<?> param, String argumentType, String queryParamType) { final String argType = stripTypeAnnotations(argumentType); return param.allowMultiValuedBinding() ? isLegalAssignment(argType, LIST + '<' + queryParamType + '>') || isLegalAssignment(argType, SET +...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
isLegalAssignment
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean isLegalAssignment(String argType, String paramType) { return paramType.equals(argType) || paramType.equals(fromPrimitive(argType)); }
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
isLegalAssignment
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static @Nullable String fromPrimitive(String argType) { return switch (argType) { case "boolean" -> Boolean.class.getName(); case "char" -> Character.class.getName(); case "int" -> Integer.class.getName(); case "long" -> Long.class.getName(); case "short" -> Short.class.getName(); case "byte...
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
fromPrimitive
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private List<Boolean> parameterNullability(ExecutableElement method, TypeElement entity) { return method.getParameters().stream() .map(param -> finderParameterNullable(entity, param)) .collect(toList()); }
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
parameterNullability
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private List<String> parameterTypes(ExecutableElement method) { return method.getParameters().stream() .map(param -> typeAsString(parameterType(param))) .collect(toList()); }
In the {@code @Query} annotation we tolerate missing {@code from} clauses to an extent that ORM core does not. For example, we accept {@code select name, age} and {@code select id where year(date)>:year} as a legit queries. (It would be easy to change ORM core to also accept these queries.)
parameterTypes
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private String typeAsString(TypeMirror type) { String result = type.toString(); for ( AnnotationMirror annotation : type.getAnnotationMirrors() ) { final String annotationString = annotation.toString(); result = result // if it has a space after it, we need to remove that too .replace(annotationStri...
Workaround for a bug in Java 20/21. Should not be necessary!
typeAsString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private TypeMirror parameterType(VariableElement parameter) { final ExecutableElement method = (ExecutableElement) parameter.getEnclosingElement(); final TypeMirror type = memberMethodType(method).getParameterTypes() .get( method.getParameters().indexOf(parameter) ); switch ( type.getKind() ) { c...
Workaround for a bug in Java 20/21. Should not be necessary!
parameterType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private ExecutableType memberMethodType(ExecutableElement method) { return (ExecutableType) context.getTypeUtils() .asMemberOf((DeclaredType) element.asType(), method); }
Workaround for a bug in Java 20/21. Should not be necessary!
memberMethodType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static List<Boolean> parameterPatterns(ExecutableElement method) { return method.getParameters().stream() .map(param -> hasAnnotation(param, PATTERN)) .toList(); }
Workaround for a bug in Java 20/21. Should not be necessary!
parameterPatterns
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private List<String> parameterNames(ExecutableElement method, TypeElement entity) { final String idName = hasAnnotation( entity, ID_CLASS ) ? ID_ROLE_NAME // account for special @By("id(this)") hack in Jakarta Data : entity.getEnclosedElements().stream() .filter(member -> hasAnnotation(membe...
Workaround for a bug in Java 20/21. Should not be necessary!
parameterNames
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static List<String> parameterNames(ExecutableElement method) { return method.getParameters().stream() .map(AnnotationMetaEntity::parameterName) .toList(); }
Workaround for a bug in Java 20/21. Should not be necessary!
parameterNames
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static String parameterName(VariableElement parameter) { final AnnotationMirror by = getAnnotationMirror( parameter, "jakarta.data.repository.By" ); final AnnotationMirror param = getAnnotationMirror( parameter, "jakarta.data.repository.Param" ); if ( by != null ) { final String name = castNonNull...
Workaround for a bug in Java 20/21. Should not be necessary!
parameterName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean isNullable(Element member) { switch ( member.getKind() ) { case METHOD: final ExecutableElement method = (ExecutableElement) member; if ( method.getReturnType().getKind().isPrimitive() ) { return false; } case FIELD: case PARAMETER: if ( member.asType().getKind().i...
Workaround for a bug in Java 20/21. Should not be necessary!
isNullable
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private void checkParameters( ExecutableElement method, @Nullable TypeMirror returnType, List<String> paramNames, List<String> paramTypes, AnnotationMirror mirror, AnnotationValue value, String hql) { for (int i = 1; i <= paramNames.size(); i++) { final String param = paramNames.get(i-1); fina...
Workaround for a bug in Java 20/21. Should not be necessary!
checkParameters
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private @Nullable TypeElement explicitEntityType(@Nullable TypeMirror resultType) { if ( resultType != null && resultType.getKind() == TypeKind.DECLARED) { final DeclaredType declaredType = (DeclaredType) resultType; final Element typeElement = declaredType.asElement(); if ( hasAnnotation(typeElement, ENTITY...
Workaround for a bug in Java 20/21. Should not be necessary!
explicitEntityType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean typeNameEquals(TypeMirror parameterType, String typeName) { if ( parameterType.getKind() == TypeKind.DECLARED ) { final DeclaredType declaredType = (DeclaredType) parameterType; final TypeElement typeElement = (TypeElement) declaredType.asElement(); return typeElement.getQualifiedName(...
Workaround for a bug in Java 20/21. Should not be necessary!
typeNameEquals
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean typeNameEqualsArray(TypeMirror parameterType, String typeName) { if ( parameterType.getKind() == TypeKind.ARRAY ) { final ArrayType arrayType = (ArrayType) parameterType; return typeNameEquals( arrayType.getComponentType(), typeName ); } else { return false; } }
Workaround for a bug in Java 20/21. Should not be necessary!
typeNameEqualsArray
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static String typeName(TypeMirror parameterType) { if ( parameterType.getKind() == TypeKind.DECLARED ) { final DeclaredType declaredType = (DeclaredType) parameterType; final TypeElement typeElement = (TypeElement) declaredType.asElement(); return typeElement.getQualifiedName().toString(); } else...
Workaround for a bug in Java 20/21. Should not be necessary!
typeName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean parameterIsMissing(String hql, int i, String param, String type) { return !hasParameter(hql, i, param) && !isSpecialParam(type); }
Workaround for a bug in Java 20/21. Should not be necessary!
parameterIsMissing
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean hasParameter(String hql, int i, String param) { return Pattern.compile(".*(:" + param + "|\\?" + i + ")\\b.*", Pattern.DOTALL) .matcher(hql).matches(); }
Workaround for a bug in Java 20/21. Should not be necessary!
hasParameter
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean usingReactiveSession(String sessionType) { return MUTINY_SESSION.equals(sessionType) || MUTINY_STATELESS_SESSION.equals(sessionType) || UNI_MUTINY_SESSION.equals(sessionType) || UNI_MUTINY_STATELESS_SESSION.equals(sessionType); }
Workaround for a bug in Java 20/21. Should not be necessary!
usingReactiveSession
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean usingStatelessSession(String sessionType) { return HIB_STATELESS_SESSION.equals(sessionType) || MUTINY_STATELESS_SESSION.equals(sessionType) || UNI_MUTINY_STATELESS_SESSION.equals(sessionType); }
Workaround for a bug in Java 20/21. Should not be necessary!
usingStatelessSession
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static boolean usingReactiveSessionAccess(String sessionType) { return UNI_MUTINY_SESSION.equals(sessionType) || UNI_MUTINY_STATELESS_SESSION.equals(sessionType); }
Workaround for a bug in Java 20/21. Should not be necessary!
usingReactiveSessionAccess
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private boolean isLocal(Element methodOrParam) { return switch ( methodOrParam.getKind() ) { case PARAMETER -> element.getEnclosedElements().contains( methodOrParam.getEnclosingElement() ); case METHOD, FIELD -> element.getEnclosedElements().contains( methodOrParam ); default -> true; }; }
Workaround for a bug in Java 20/21. Should not be necessary!
isLocal
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
public void message(Element method, String message, Diagnostic.Kind severity) { if ( isLocal(method) ) { context.message(method, message, severity); } else { context.message(element, messageWithLocation(method, message), severity); } }
Workaround for a bug in Java 20/21. Should not be necessary!
message
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
public void message(Element method, AnnotationMirror mirror, String message, Diagnostic.Kind severity) { if ( isLocal(method) ) { context.message(method, mirror, message, severity); } else { context.message(element, messageWithLocation(method, message), severity); } }
Workaround for a bug in Java 20/21. Should not be necessary!
message
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
public void message(Element method, AnnotationMirror mirror, AnnotationValue value, String message, Diagnostic.Kind severity) { if ( isLocal(method) ) { context.message(method, mirror, value, message, severity); } else { context.message(element, messageWithLocation(method, message), severity); } }
Workaround for a bug in Java 20/21. Should not be necessary!
message
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
private static String messageWithLocation(Element element, String message) { return element.getKind() == ElementKind.PARAMETER ? message + " for parameter '" + element.getSimpleName() + "' of inherited member '" + element.getEnclosingElement().getSimpleName() + "'" : message + " for inherited member '" ...
Workaround for a bug in Java 20/21. Should not be necessary!
messageWithLocation
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
@Override public List<AnnotationMirror> inheritedAnnotations() { if ( jakartaDataRepository ) { return element.getAnnotationMirrors().stream() .filter(annotationMirror -> hasAnnotation(annotationMirror.getAnnotationType().asElement(), "jakarta.interceptor.InterceptorBinding")) .collect(toList());...
Workaround for a bug in Java 20/21. Should not be necessary!
inheritedAnnotations
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
@Override public String javadoc() { if ( jakartaDataRepository ) { return "/**\n * Implements Jakarta Data repository {@link " + qualifiedName + "}\n **/"; } else if ( repository ) { return "/**\n * Implements repository {@link " + qualifiedName + "}\n **/"; } else if ( jakartaDataStaticModel ) { re...
Workaround for a bug in Java 20/21. Should not be necessary!
javadoc
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java
Apache-2.0
@Override public String getAttributeDeclarationString() { return new StringBuilder() .append("\n/**\n * Static metamodel for attribute {@link ") .append( parent.getQualifiedName() ) .append("#") .append( element.getSimpleName() ) .append("}\n **/\n") .append("public static volatile ") .ap...
@author Max Andersen @author Hardy Ferentschik @author Emmanuel Bernard
getAttributeDeclarationString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaMap.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaMap.java
Apache-2.0
public static AnnotationMetaPackage create(PackageElement element, Context context) { return new AnnotationMetaPackage( element, context ); }
Whether the members of this type have already been initialized or not.
create
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final Context getContext() { return context; }
Whether the members of this type have already been initialized or not.
getContext
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public boolean isImplementation() { return false; }
Whether the members of this type have already been initialized or not.
isImplementation
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final String getSimpleName() { return element.getSimpleName().toString(); }
Whether the members of this type have already been initialized or not.
getSimpleName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final String getQualifiedName() { return element.getQualifiedName().toString(); }
Whether the members of this type have already been initialized or not.
getQualifiedName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public @Nullable Element getSuperTypeElement() { return null; }
Whether the members of this type have already been initialized or not.
getSuperTypeElement
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final String getPackageName() { return getPackageName( context, element ); }
Whether the members of this type have already been initialized or not.
getPackageName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
private static String getPackageName(Context context, PackageElement packageOf) { return context.getElementUtils().getName( packageOf.getQualifiedName() ).toString(); }
Whether the members of this type have already been initialized or not.
getPackageName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public List<MetaAttribute> getMembers() { if ( !initialized ) { init(); } return new ArrayList<>( members.values() ); }
Whether the members of this type have already been initialized or not.
getMembers
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public boolean isMetaComplete() { return false; }
Whether the members of this type have already been initialized or not.
isMetaComplete
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final String generateImports() { return importContext.generateImports(); }
Whether the members of this type have already been initialized or not.
generateImports
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final String importType(String fqcn) { return importContext.importType( fqcn ); }
Whether the members of this type have already been initialized or not.
importType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final String staticImport(String fqcn, String member) { return importContext.staticImport( fqcn, member ); }
Whether the members of this type have already been initialized or not.
staticImport
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final PackageElement getElement() { return element; }
Whether the members of this type have already been initialized or not.
getElement
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public String toString() { return new StringBuilder() .append( "AnnotationMetaPackage" ) .append( "{element=" ) .append( element ) .append( '}' ) .toString(); }
Whether the members of this type have already been initialized or not.
toString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
protected final void init() { getContext().logMessage( Diagnostic.Kind.OTHER, "Initializing type " + getQualifiedName() + "." ); addAuxiliaryMembers(); checkNamedQueries(); initialized = true; }
Whether the members of this type have already been initialized or not.
init
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override void putMember(String name, MetaAttribute nameMetaAttribute) { members.put( name, nameMetaAttribute ); }
Whether the members of this type have already been initialized or not.
putMember
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override boolean isRepository() { return false; }
Whether the members of this type have already been initialized or not.
isRepository
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override @Nullable String getSessionType() { return null; }
Whether the members of this type have already been initialized or not.
getSessionType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public boolean isInjectable() { return false; }
Whether the members of this type have already been initialized or not.
isInjectable
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public String scope() { throw new UnsupportedOperationException("operation not supported"); }
Whether the members of this type have already been initialized or not.
scope
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public boolean isJakartaDataStyle() { return false; }
Whether the members of this type have already been initialized or not.
isJakartaDataStyle
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public List<AnnotationMirror> inheritedAnnotations() { return emptyList(); }
Whether the members of this type have already been initialized or not.
inheritedAnnotations
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public String javadoc() { return "/**\n * Static metamodel package {@link " + element.getQualifiedName() + "}\n **/"; }
Whether the members of this type have already been initialized or not.
javadoc
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaPackage.java
Apache-2.0
@Override public final String getMetaType() { return Constants.SINGULAR_ATTRIBUTE; }
@author Max Andersen @author Hardy Ferentschik @author Emmanuel Bernard
getMetaType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaSingleAttribute.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaSingleAttribute.java
Apache-2.0
@Override public List<AnnotationMirror> inheritedAnnotations() { return new ArrayList<>(element.getAnnotationMirrors()); }
@author Max Andersen @author Hardy Ferentschik @author Emmanuel Bernard
inheritedAnnotations
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaSingleAttribute.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaSingleAttribute.java
Apache-2.0
@Override public String getAttributeNameDeclarationString() { throw new UnsupportedOperationException("operation not supported"); }
\n * Static metamodel type for {@link ") .append( annotationMetaEntity.getQualifiedName() ) .append( "}\n *
getAttributeNameDeclarationString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
Apache-2.0
@Override public String getMetaType() { return "org.hibernate.metamodel.model.domain.ManagedDomainType"; }
\n * Static metamodel type for {@link ") .append( annotationMetaEntity.getQualifiedName() ) .append( "}\n *
getMetaType
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
Apache-2.0
@Override public String getPropertyName() { return "class"; }
\n * Static metamodel type for {@link ") .append( annotationMetaEntity.getQualifiedName() ) .append( "}\n *
getPropertyName
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
Apache-2.0
@Override public String getTypeDeclaration() { if ( hasAnnotation(annotationMetaEntity.getElement(), Constants.ENTITY) ) { return "jakarta.persistence.metamodel.EntityType"; } else if ( hasAnnotation(annotationMetaEntity.getElement(), Constants.EMBEDDABLE) ) { return "jakarta.persistence.metamodel.Embeddab...
\n * Static metamodel type for {@link ") .append( annotationMetaEntity.getQualifiedName() ) .append( "}\n *
getTypeDeclaration
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
Apache-2.0
@Override public Metamodel getHostingEntity() { return annotationMetaEntity; }
\n * Static metamodel type for {@link ") .append( annotationMetaEntity.getQualifiedName() ) .append( "}\n *
getHostingEntity
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaType.java
Apache-2.0
@Override public boolean hasTypedAttribute() { return true; }
Captures all information about an annotated persistent attribute. @author Gavin King
hasTypedAttribute
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
Apache-2.0
@Override public boolean hasStringAttribute() { return true; }
Captures all information about an annotated persistent attribute. @author Gavin King
hasStringAttribute
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
Apache-2.0
private boolean isTextual() { return STRING.equals(type); }
Captures all information about an annotated persistent attribute. @author Gavin King
isTextual
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
Apache-2.0
@Override public String getAttributeDeclarationString() { final String className = parent.importType( parent.getQualifiedName() ); final String elementName = element.getSimpleName().toString(); final String memberName = path == null ? elementName : path + '.' + elementName; final String impl = isTextual() ...
Captures all information about an annotated persistent attribute. @author Gavin King
getAttributeDeclarationString
java
hibernate/hibernate-orm
tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
https://github.com/hibernate/hibernate-orm/blob/master/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/DataAnnotationMetaAttribute.java
Apache-2.0