Package javax.persistence.metamodel

Examples of javax.persistence.metamodel.ManagedType


          );
        }
      }
    }
   
    ManagedType managedType = null;
    try {
      managedType = entityManagerFactory.getEntityTypeByName( type.getName() );
    }
    catch (IllegalArgumentException e) {
      // do nothing
View Full Code Here


          );
        }
      }
    }
   
    ManagedType managedType = null;
    try {
      managedType = entityManagerFactory.getEntityTypeByName( type.getName() );
    }
    catch (IllegalArgumentException e) {
      // do nothing
View Full Code Here

             
              Class<?>[] polyClasses = dynamicDaoHelper.getAllPolymorphicEntitiesFromCeiling(
                      path.getJavaType(), em.getSessionFactory(), true, true);
             
              for (Class<?> clazz : polyClasses) {
                ManagedType mt = mm.managedType(clazz);
                try {
                    Attribute attr = mt.getAttribute(piece);
                    if (attr != null) {
                        Root additionalRoot = criteria.from(clazz);
                        restrictions.add(builder.equal(path, additionalRoot));
                        path = additionalRoot.get(piece);
                        found = true;
View Full Code Here

        }else if(resultClass.equals(ClassConstants.AOBJECT)){
            return new CriteriaQueryImpl<T>(this.metamodel, ResultType.OBJECT_ARRAY, resultClass, this);
        }else if (resultClass.isArray()){
            return new CriteriaQueryImpl<T>(this.metamodel, ResultType.OBJECT_ARRAY, resultClass, this);
        }else{
            ManagedType type = this.metamodel.type(resultClass);
            if (type != null && type.getPersistenceType().equals(PersistenceType.ENTITY)){
                return new CriteriaQueryImpl(this.metamodel, ResultType.ENTITY, resultClass , this);
            } else {
                return new CriteriaQueryImpl(this.metamodel, ResultType.OTHER, resultClass, this);
            }
        }
View Full Code Here

                    throw new IllegalArgumentException(ExceptionLocalization.buildMessage("CRITERIA_NO_CONSTRUCTOR_FOUND_TODO", params));
                }
            }
        } else {
            this.queryType = selection.getJavaType();
            ManagedType type = this.metamodel.type(this.queryType);
            if (type != null && type.getPersistenceType().equals(PersistenceType.ENTITY)) {
                this.queryResult = ResultType.ENTITY;
            } else {
                this.queryResult = ResultType.OTHER;
            }
        }
View Full Code Here

            if(selections.length > 1){
                this.queryType = ClassConstants.AOBJECT;
                this.selection = (SelectionImpl) this.queryBuilder.construct(ClassConstants.AOBJECT, selections);
                this.queryResult = ResultType.OBJECT_ARRAY;
            }else{
                ManagedType type = this.metamodel.type(selections[0].getJavaType());
                if (type == null || (!type.getPersistenceType().equals(PersistenceType.ENTITY))){
                    this.queryResult = ResultType.OTHER;
                }else{
                    this.queryResult = ResultType.ENTITY;
                }
                this.queryType = selections[0].getJavaType();
View Full Code Here

    }

    @Override
    public Class<?> validate(Class<?> parent, String property, Class<?> propertyType) {
        try {
            ManagedType managedType = metamodel.managedType(parent);
            Attribute attribute = managedType.getAttribute(property);
            if (attribute instanceof PluralAttribute) {
                return ((PluralAttribute)attribute).getElementType().getJavaType();
            } else {
                return Primitives.wrap(attribute.getJavaType());
            }
View Full Code Here

     * @see javax.persistence.metamodel.Metamodel#managedType(java.lang.Class)
     */
    @Override
    public <X> ManagedType<X> managedType(Class<X> paramClass)
    {
        ManagedType managedType = entityTypes.get(paramClass);
        if (managedType == null)
        {
            managedType = embeddables.get(paramClass);
            if (managedType == null)
            {
View Full Code Here

TOP

Related Classes of javax.persistence.metamodel.ManagedType

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.