EntityType classModel;
if (beanSerializer == null) {
String packageName = normalizePackage(module.getPackageName(), schemaName);
String simpleName = module.getPrefix() + className + module.getSuffix();
Type classTypeModel = new SimpleType(TypeCategory.ENTITY,
packageName + "." + simpleName, packageName, simpleName, false, false);
classModel = new EntityType(classTypeModel);
typeMappings.register(classModel, classModel);
} else {
String beanPackage = normalizePackage(beanPackageName, schemaName);
String simpleName = module.getBeanPrefix() + className + module.getBeanSuffix();
Type classTypeModel = new SimpleType(TypeCategory.ENTITY,
beanPackage + "." + simpleName, beanPackage, simpleName, false, false);
classModel = new EntityType(classTypeModel);
Type mappedType = queryTypeFactory.create(classModel);
entityToWrapped.put(classModel, mappedType);