Search in sources :

Example 1 with Supertype

use of com.querydsl.codegen.Supertype in project querydsl by querydsl.

the class ExtendedTypeFactory method createEntityType.

@Nullable
private EntityType createEntityType(TypeMirror typeMirror, List<String> key, boolean deep) {
    entityTypeCache.put(key, null);
    Type value = visitor.visit(typeMirror, deep);
    if (value != null) {
        EntityType entityType = null;
        if (value instanceof EntityType) {
            entityType = (EntityType) value;
        } else {
            entityType = new EntityType(value, variableNameFunction);
            typeMappings.register(entityType, queryTypeFactory.create(entityType));
        }
        entityTypeCache.put(key, entityType);
        if (deep) {
            for (Type superType : getSupertypes(typeMirror, deep)) {
                entityType.addSupertype(new Supertype(superType));
            }
        }
        return entityType;
    } else {
        return null;
    }
}
Also used : EntityType(com.querydsl.codegen.EntityType) ErrorType(javax.lang.model.type.ErrorType) EntityType(com.querydsl.codegen.EntityType) DeclaredType(javax.lang.model.type.DeclaredType) SimpleType(com.querydsl.codegen.utils.model.SimpleType) WildcardType(javax.lang.model.type.WildcardType) ArrayType(javax.lang.model.type.ArrayType) Type(com.querydsl.codegen.utils.model.Type) ExecutableType(javax.lang.model.type.ExecutableType) NoType(javax.lang.model.type.NoType) NullType(javax.lang.model.type.NullType) PrimitiveType(javax.lang.model.type.PrimitiveType) Supertype(com.querydsl.codegen.Supertype) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

EntityType (com.querydsl.codegen.EntityType)1 Supertype (com.querydsl.codegen.Supertype)1 SimpleType (com.querydsl.codegen.utils.model.SimpleType)1 Type (com.querydsl.codegen.utils.model.Type)1 ArrayType (javax.lang.model.type.ArrayType)1 DeclaredType (javax.lang.model.type.DeclaredType)1 ErrorType (javax.lang.model.type.ErrorType)1 ExecutableType (javax.lang.model.type.ExecutableType)1 NoType (javax.lang.model.type.NoType)1 NullType (javax.lang.model.type.NullType)1 PrimitiveType (javax.lang.model.type.PrimitiveType)1 WildcardType (javax.lang.model.type.WildcardType)1 Nullable (org.jetbrains.annotations.Nullable)1