Package com.mysema.codegen.model

Examples of com.mysema.codegen.model.SimpleType


    @SuppressWarnings("unchecked")
    @Before
    public void setUp() {
        // type
        Type typeModel = new SimpleType(TypeCategory.ENTITY, "com.mysema.query.DomainClass", "com.mysema.query", "DomainClass", false, false);
        type = new EntityType(typeModel);

        // property
        type.addProperty(new Property(type, "entityField", type));
        type.addProperty(new Property(type, "collection", new ClassType(TypeCategory.COLLECTION, Collection.class, typeModel)));
View Full Code Here


                    transformed = true;
                }
            }
        }
        if (transformed) {
            return new SimpleType(type, params);
        } else {
            return type;
        }
    }
View Full Code Here

        } else if (category == TypeCategory.STRING || category == TypeCategory.BOOLEAN) {
            return exprType;

        } else {
            if (rawParameters) {
                type = new SimpleType(type);
            }
            if (!type.isFinal() && extend) {
                type = new TypeExtends(type);
            }
            return new SimpleType(exprType, type);

        }
    }
View Full Code Here

        NamingStrategy namingStrategy = new DefaultNamingStrategy();
        String packageName = "com.myproject.domain";
        String tableName = "vwServiceName";
        String className = namingStrategy.getClassName(tableName);
       
        Type classTypeModel = new SimpleType(TypeCategory.ENTITY, packageName + "." + className, packageName, className, false, false);
        classModel = new EntityType(classTypeModel);
//        classModel.addAnnotation(new TableImpl(namingStrategy.normalizeTableName(tableName)));
        classModel.getData().put("table", namingStrategy.normalizeTableName(tableName));
    }
View Full Code Here

        String packageName = type.getPackageName();
        String simpleName = prefix + normalizeName(type.getFullName()
                .substring(packageName.length()+1)) + suffix;       
        packageName = (packageName.startsWith("java") ? "ext." : "")
                + packageName + packageSuffix;
        return new SimpleType(type.getCategory(), packageName+"."+simpleName,
                packageName, simpleName, false, false);
    }
View Full Code Here

                packageName, simpleName, false, false);
    }
   
    private Type createWithoutPackage(Type type) {
        String simpleName = prefix + normalizeName(type.getFullName()) + suffix;
        return new SimpleType(type.getCategory(), simpleName, "", simpleName, false, false);
    }
View Full Code Here

        } else if (Number.class.isAssignableFrom(cl) && Comparable.class.isAssignableFrom(cl)) {
            value = new ClassType(TypeCategory.NUMERIC, cl, parameters);
        } else if (entity) {
            value = createOther(cl, entity, annotationHelper, annotation, parameters);
        } else if (Map.class.isAssignableFrom(cl)) {
            value = new SimpleType(Types.MAP, parameters[0], asGeneric(parameters[1]));
        } else if (List.class.isAssignableFrom(cl)) {
            value = new SimpleType(Types.LIST, asGeneric(parameters[0]));
        } else if (Set.class.isAssignableFrom(cl)) {
            value = new SimpleType(Types.SET, asGeneric(parameters[0]));
        } else if (Collection.class.isAssignableFrom(cl)) {
            value = new SimpleType(Types.COLLECTION, asGeneric(parameters[0]));
        } else {
            value = createOther(cl, entity, annotationHelper, annotation, parameters);
        }

        if (genericType instanceof TypeVariable) {
View Full Code Here

    private Type asGeneric(Type type) {
        if (type.getParameters().size() == 0) {
            int count = type.getJavaClass().getTypeParameters().length;
            if (count > 0) {
                return new SimpleType(type, new Type[count]);
            }
        }
        return type;
    }
View Full Code Here

TOP

Related Classes of com.mysema.codegen.model.SimpleType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.