Tabnine Logo
BeanPath
Code IndexAdd Tabnine to your IDE (free)

How to use
BeanPath
in
com.querydsl.core.types.dsl

Best Java code snippets using com.querydsl.core.types.dsl.BeanPath (Showing top 20 results out of 315)

origin: querydsl/querydsl

public QSuperSupertype(BeanPath<? extends SuperSupertype> entity) {
  super(entity.getType(), entity.getMetadata());
}
origin: querydsl/querydsl

@SuppressWarnings({ "unchecked", "rawtypes" })
public BooleanExpression instanceOfAny(Class... types) {
  BooleanExpression[] exprs = new BooleanExpression[types.length];
  for (int i = 0; i < types.length; i++) {
    exprs[i] = this.instanceOf(types[i]);
  }
  return Expressions.anyOf(exprs);
}
origin: querydsl/querydsl

/**
 * Create a new Collection typed path
 *
 * @param <A>
 * @param property property name
 * @param type property type
 * @return property path
 */
@SuppressWarnings("unchecked")
protected <A, Q extends SimpleExpression<? super A>> CollectionPath<A, Q> createCollection(String property, Class<? super A> type, Class<? super Q> queryType, PathInits inits) {
  return add(new CollectionPath<A, Q>(type, (Class) queryType, forProperty(property), inits));
}
origin: querydsl/querydsl

  @Test
  public void as_class_with_inits_cached() {
    beanPath = new BeanPath<BeanPathTest>(BeanPathTest.class,
        PathMetadataFactory.forVariable("p"), PathInits.DEFAULT);
    MyBeanPath otherPath = beanPath.as(MyBeanPath.class);
//        assertEquals(beanPath, otherPath);
    assertTrue(otherPath == beanPath.as(MyBeanPath.class));
  }

origin: querydsl/querydsl

@Test
public void instanceOfAny() {
  BooleanExpression pred1 = beanPath.instanceOf(BeanPathTest.class).or(beanPath.instanceOf(SubClass.class));
  BooleanExpression pred2 = beanPath.instanceOfAny(BeanPathTest.class, SubClass.class);
  assertEquals(pred1, pred2);
  assertEquals("p instanceof class com.querydsl.core.types.dsl.BeanPathTest || " +
       "p instanceof class com.querydsl.core.types.dsl.BeanPathTest$SubClass", pred2.toString());
}
origin: querydsl/querydsl

  @Test
  public void as_class_cached() {
    MyBeanPath otherPath = beanPath.as(MyBeanPath.class);
//        assertEquals(beanPath, otherPath);
    assertTrue(otherPath == beanPath.as(MyBeanPath.class));
  }

origin: querydsl/querydsl

@SuppressWarnings("unchecked")
@Test
public void various() {
  List<Path<?>> paths = new ArrayList<Path<?>>();
  paths.add(new ArrayPath(String[].class, "p"));
  paths.add(new BeanPath(Object.class, "p"));
  paths.add(new BooleanPath("p"));
  paths.add(new CollectionPath(String.class, StringPath.class, "p"));
  paths.add(new ComparablePath(String.class,"p"));
  paths.add(new DatePath(Date.class,"p"));
  paths.add(new DateTimePath(Date.class,"p"));
  paths.add(new EnumPath(ExampleEnum.class,"p"));
  paths.add(new ListPath(String.class, StringPath.class, "p"));
  paths.add(new MapPath(String.class, String.class, StringPath.class, "p"));
  paths.add(new NumberPath(Integer.class,"p"));
  paths.add(new SetPath(String.class, StringPath.class, "p"));
  paths.add(new SimplePath(String.class,"p"));
  paths.add(new StringPath("p"));
  paths.add(new TimePath(Time.class,"p"));
  for (Path<?> path : paths) {
    Path other = ExpressionUtils.path(path.getType(), "p");
    assertEquals(path.toString(), path.accept(ToStringVisitor.DEFAULT, null));
    assertEquals(path.hashCode(), other.hashCode());
    assertEquals(path, other);
    assertNotNull(path.getMetadata());
    assertNotNull(path.getType());
    assertEquals(path, path.getRoot());
  }
}
origin: org.opensingular/singular-server-commons

public Query toHibernateQuery(Boolean count) {
  if (Boolean.TRUE.equals(count)) {
    select(countPath.count());
  } else {
    select(select.build());
  }
  where(whereClause.and(quickFilterWhereClause));
  return createQuery();
}
origin: com.querydsl/querydsl-sql

/**
 * Compares the two relational paths using primary key columns
 *
 * @param right rhs of the comparison
 * @return this == right
 */
@Override
public BooleanExpression eq(T right) {
  if (right instanceof RelationalPath) {
    return primaryKeyOperation(Ops.EQ, primaryKey, ((RelationalPath) right).getPrimaryKey());
  } else {
    return super.eq(right);
  }
}
origin: querydsl/querydsl

@Test
public void createEnum() {
  assertNotNull(beanPath.createEnum("property", PropertyType.class));
}
origin: querydsl/querydsl

@Test
@Ignore
public void as_class_with_inits() {
  beanPath = new BeanPath<BeanPathTest>(BeanPathTest.class,
      PathMetadataFactory.forVariable("p"), PathInits.DEFAULT);
  MyBeanPath otherPath = beanPath.as(MyBeanPath.class);
  assertEquals(beanPath, otherPath);
}
origin: querydsl/querydsl

@Test
public void as_path() {
  SimplePath<BeanPathTest> simplePath = new SimplePath<BeanPathTest>(BeanPathTest.class, "p");
  assertNotNull(beanPath.as(simplePath));
}
origin: querydsl/querydsl

@SuppressWarnings("unchecked")
@Test
public void various() {
  List<DslExpression<?>> paths = new ArrayList<DslExpression<?>>();
  paths.add(new ArrayPath(String[].class, "p"));
  paths.add(new BeanPath(Object.class, "p"));
  paths.add(new BooleanPath("p"));
  paths.add(new CollectionPath(String.class, StringPath.class, "p"));
  paths.add(new ComparablePath(String.class,"p"));
  paths.add(new DatePath(Date.class,"p"));
  paths.add(new DateTimePath(Date.class,"p"));
  paths.add(new EnumPath(ExampleEnum.class,"p"));
  paths.add(new ListPath(String.class, StringPath.class, "p"));
  paths.add(new MapPath(String.class, String.class, StringPath.class, "p"));
  paths.add(new NumberPath(Integer.class,"p"));
  paths.add(new SetPath(String.class, StringPath.class, "p"));
  paths.add(new SimplePath(String.class,"p"));
  paths.add(new StringPath("p"));
  paths.add(new TimePath(Time.class,"p"));
  for (DslExpression<?> expr : paths) {
    Path<?> o = ExpressionUtils.path(expr.getType(), "o");
    assertEquals(ExpressionUtils.operation(expr.getType(), Ops.ALIAS, expr, o), expr.as("o"));
    Path p = ExpressionUtils.path(expr.getType(), "p");
    assertEquals(ExpressionUtils.operation(expr.getType(), Ops.ALIAS, expr, p), expr.as(p));
  }
}
origin: org.opensingular/singular-requirement-commons

public Query toHibernateQuery(Boolean count) {
  if (Boolean.TRUE.equals(count)) {
    select(countPath.count());
  } else {
    select(select.build());
  }
  where(whereClause.and(quickFilterWhereClause));
  return createQuery();
}
origin: com.querydsl/querydsl-sql

/**
 * Compares the two relational paths using primary key columns
 *
 * @param right rhs of the comparison
 * @return this == right
 */
@Override
public BooleanExpression eq(Expression<? super T> right) {
  if (right instanceof RelationalPath) {
    return primaryKeyOperation(Ops.EQ, primaryKey, ((RelationalPath) right).getPrimaryKey());
  } else {
    return super.eq(right);
  }
}
origin: querydsl/querydsl

public QDefaultQueryMetadata(BeanPath<? extends DefaultQueryMetadata> entity) {
  super(entity.getType(), entity.getMetadata());
}
origin: querydsl/querydsl

/**
 * Create a new Set typed path
 *
 * @param <A>
 * @param property property name
 * @param type property type
 * @return property path
 */
@SuppressWarnings("unchecked")
protected <A, E extends SimpleExpression<? super A>> SetPath<A, E> createSet(String property, Class<? super A> type, Class<? super E> queryType, PathInits inits) {
  return add(new SetPath<A, E>(type, (Class) queryType, forProperty(property), inits));
}
origin: querydsl/querydsl

@Test
@Ignore
public void as_class() {
  MyBeanPath otherPath = beanPath.as(MyBeanPath.class);
  assertEquals(beanPath, otherPath);
  assertTrue(otherPath.getMetadata().isRoot());
}
origin: querydsl/querydsl

@SuppressWarnings("unchecked")
@Test
public void various_properties() {
  Path<?> parent = ExpressionUtils.path(Object.class, "parent");
  List<Path<?>> paths = new ArrayList<Path<?>>();
  paths.add(new ArrayPath(String[].class, parent, "p"));
  paths.add(new BeanPath(Object.class, parent, "p"));
  paths.add(new BooleanPath(parent, "p"));
  paths.add(new CollectionPath(String.class, StringPath.class, parent, "p"));
  paths.add(new ComparablePath(String.class, parent, "p"));
  paths.add(new DatePath(Date.class, parent, "p"));
  paths.add(new DateTimePath(Date.class, parent, "p"));
  paths.add(new EnumPath(ExampleEnum.class, parent, "p"));
  paths.add(new ListPath(String.class, StringPath.class, parent, "p"));
  paths.add(new MapPath(String.class, String.class, StringPath.class, parent, "p"));
  paths.add(new NumberPath(Integer.class, parent, "p"));
  paths.add(new SetPath(String.class, StringPath.class, parent, "p"));
  paths.add(new SimplePath(String.class, parent, "p"));
  paths.add(new StringPath(parent, "p"));
  paths.add(new TimePath(Time.class, parent, "p"));
  for (Path<?> path : paths) {
    Path other = ExpressionUtils.path(path.getType(), PathMetadataFactory.forProperty(parent, "p"));
    assertEquals(path.toString(), path.accept(ToStringVisitor.DEFAULT, Templates.DEFAULT));
    assertEquals(path.hashCode(), other.hashCode());
    assertEquals(path, other);
    assertNotNull(path.getMetadata());
    assertNotNull(path.getType());
    assertEquals(parent, path.getRoot());
  }
}
origin: querydsl/querydsl

@Test
public void instanceOf() {
  assertNotNull(beanPath.instanceOf(BeanPathTest.class));
}
com.querydsl.core.types.dslBeanPath

Javadoc

BeanPath represents bean paths

Most used methods

  • <init>
  • as
    Cast the path to a subtype querytype
  • count
  • getMetadata
  • getType
  • instanceOf
    Create an this instanceOf type expression
  • add
    Template method for tracking child path creation
  • createEnum
    Create a new Enum path
  • eq
  • forProperty
  • instanceOfAny
  • ne
  • instanceOfAny,
  • ne

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • JComboBox (javax.swing)
  • JTable (javax.swing)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Table (org.hibernate.mapping)
    A relational table
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • 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