Tabnine Logo
EntityMetamodel.managedType
Code IndexAdd Tabnine to your IDE (free)

How to use
managedType
method
in
com.blazebit.persistence.parser.EntityMetamodel

Best Java code snippets using com.blazebit.persistence.parser.EntityMetamodel.managedType (Showing top 8 results out of 315)

origin: Blazebit/blaze-persistence

public ScalarTargetResolvingExpressionVisitor(Class<?> managedType, EntityMetamodel metamodel, Map<String, JpqlFunction> functions) {
  this(metamodel.managedType(managedType), metamodel, functions);
}
origin: com.blazebit/blaze-persistence-core-parser

public static ManagedType<?> getManagedType(EntityMetamodel metamodel, Class<?> managedTypeClass, String treatTypeName) {
  if (treatTypeName != null) {
    ManagedType<?> type = metamodel.managedType(treatTypeName);
    if (!managedTypeClass.isAssignableFrom(type.getJavaType())) {
      throw new IllegalArgumentException("Treat type '" + treatTypeName + "' is not a subtype of: " + managedTypeClass.getName());
    }
    return type;
  }
  return metamodel.managedType(managedTypeClass);
}
origin: Blazebit/blaze-persistence

public static ManagedType<?> getManagedType(EntityMetamodel metamodel, Class<?> managedTypeClass, String treatTypeName) {
  if (treatTypeName != null) {
    ManagedType<?> type = metamodel.managedType(treatTypeName);
    if (!managedTypeClass.isAssignableFrom(type.getJavaType())) {
      throw new IllegalArgumentException("Treat type '" + treatTypeName + "' is not a subtype of: " + managedTypeClass.getName());
    }
    return type;
  }
  return metamodel.managedType(managedTypeClass);
}
origin: com.blazebit/blaze-persistence-jpa-criteria-impl

@SuppressWarnings({"unchecked"})
public SingularAttributeJoin(BlazeCriteriaBuilderImpl criteriaBuilder, Class<X> javaType, AbstractPath<Z> pathSource, SingularAttribute<? super Z, ?> joinAttribute, JoinType joinType) {
  super(criteriaBuilder, javaType, pathSource, joinAttribute, joinType);
  this.model = (Bindable<X>) (Attribute.PersistentAttributeType.EMBEDDED == joinAttribute
      .getPersistentAttributeType() ? joinAttribute : criteriaBuilder.getEntityMetamodel().managedType(javaType));
}
origin: Blazebit/blaze-persistence

@SuppressWarnings({"unchecked"})
public SingularAttributeJoin(BlazeCriteriaBuilderImpl criteriaBuilder, Class<X> javaType, AbstractPath<Z> pathSource, SingularAttribute<? super Z, ?> joinAttribute, JoinType joinType) {
  super(criteriaBuilder, javaType, pathSource, joinAttribute, joinType);
  this.model = (Bindable<X>) (Attribute.PersistentAttributeType.EMBEDDED == joinAttribute
      .getPersistentAttributeType() ? joinAttribute : criteriaBuilder.getEntityMetamodel().managedType(javaType));
}
origin: Blazebit/blaze-persistence

public static boolean isIndexedList(EntityMetamodel metamodel, ExpressionFactory expressionFactory, Class<?> entityClass, String mapping) {
  if (mapping == null || mapping.isEmpty()) {
    return false;
  }
  PathTargetResolvingExpressionVisitor visitor = new PathTargetResolvingExpressionVisitor(metamodel, metamodel.managedType(entityClass), null);
  expressionFactory.createSimpleExpression(mapping, false).accept(visitor);
  Map<Attribute<?, ?>, javax.persistence.metamodel.Type<?>> possibleTargets = visitor.getPossibleTargets();
  Iterator<Map.Entry<Attribute<?, ?>, javax.persistence.metamodel.Type<?>>> iter = possibleTargets.entrySet().iterator();
  // It must have one, otherwise a parse error would have been thrown already
  Map.Entry<Attribute<?, ?>, ?> targetEntry = iter.next();
  boolean indexed = isIndexedList(targetEntry.getKey());
  
  while (iter.hasNext()) {
    targetEntry = iter.next();
    if (indexed != isIndexedList(targetEntry.getKey())) {
      throw new IllegalArgumentException("Inconclusive result on checking whether the expression [" + mapping + "] resolves to an indexed list on class [" + entityClass.getName() + "].");
    }
  }
  
  return indexed;
}

origin: Blazebit/blaze-persistence

public static AttributeAccessor forEntityMapping(EntityViewManagerImpl evm, Class<?> entityClass, String mapping) {
  if (mapping.isEmpty()) {
    return new NestedAttributeAccessor(Collections.<AttributeAccessor>emptyList());
  }
  EntityMetamodel entityMetamodel = evm.getMetamodel().getEntityMetamodel();
  AttributePath path = evm.getJpaProvider().getJpaMetamodelAccessor().getBasicAttributePath(entityMetamodel, entityMetamodel.managedType(entityClass), mapping);
  List<Attribute<?, ?>> attributes = path.getAttributes();
  if (attributes.size() == 1) {
    return forEntityAttribute(evm, entityClass, attributes.get(0), null);
  }
  List<AttributeAccessor> mappers = new ArrayList<>(attributes.size());
  Class<?> targetClass = entityClass;
  for (int i = 0; i < attributes.size() - 1; i++) {
    javax.persistence.metamodel.Attribute<?, ?> attribute = attributes.get(i);
    Class<?> attributeClass = JpaMetamodelUtils.resolveFieldClass(targetClass, attribute);
    mappers.add(forEntityAttribute(evm, targetClass, attribute, attributeClass));
    targetClass = attributeClass;
  }
  mappers.add(forEntityAttribute(evm, targetClass, attributes.get(attributes.size() - 1), null));
  return new NestedAttributeAccessor(mappers);
}
origin: Blazebit/blaze-persistence

validateTypesCompatible(context.getEntityMetamodel().managedType(correlated), stripThisFromMapping(correlationResult), expressionType, elementType, true, !isCollection(), context, ExpressionLocation.CORRELATION_RESULT, getLocation());
com.blazebit.persistence.parserEntityMetamodelmanagedType

Popular methods of EntityMetamodel

  • getEntity
  • getManagedType
  • type
  • entity

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Kernel (java.awt.image)
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JLabel (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now