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

How to use
Property
in
org.apache.cayenne.exp

Best Java code snippets using org.apache.cayenne.exp.Property (Showing top 20 results out of 315)

origin: com.nhl.link.move/link-move

public MapperBuilder matchBy(Property<?>... paths) {
  Objects.requireNonNull(paths, "Null 'paths'");
  for (Property<?> p : paths) {
    this.paths.add(p.getName());
  }
  return this;
}
origin: org.apache.cayenne/cayenne-server

/**
 * @return Ascending sort orderings on this property.
 */
public List<Ordering> ascs() {
  List<Ordering> result = new ArrayList<>(1);
  result.add(asc());
  return result;
}
origin: org.apache.cayenne/cayenne-server

/**
 * @return Descending sort orderings on this property.
 */
public List<Ordering> descs() {
  List<Ordering> result = new ArrayList<>(1);
  result.add(desc());
  return result;
}
origin: org.apache.cayenne/cayenne-server

/**
 * Constructs a new property path by appending the argument to the existing property separated by a dot.
 *
 * @return a newly created Property object.
 */
public <T> Property<T> dot(Property<T> property) {
  return create(getName() + "." + property.getName(), property.getType());
}
origin: org.apache.cayenne/cayenne-server

/**
 * Creates alias with different name for this property
 */
public Property<E> alias(String alias) {
  return new Property<>(alias, this.getExpression(), this.getType());
}
origin: org.apache.cayenne/cayenne-server

/**
 * Constructs a property path by appending the argument to the existing property separated by a dot.
 *
 * @return a newly created Property object.
 */
public Property<Object> dot(String property) {
  return create(getName() + "." + property, null);
}
origin: agrestio/agrest

@Test
public void test_Select_RelationshipStartLimit() throws UnsupportedEncodingException {
  Response response = target("/e2_RelationshipStartLimit")
      .queryParam("include", "id")
      .queryParam("include", URLEncoder.encode("{\"path\":\"" + E2.E3S.getName() + "\",\"start\":1,\"limit\":1}", "UTF-8"))
      .queryParam("exclude", E2.E3S.dot(E3.PHONE_NUMBER).getName())
      .request().get();
  assertNotNull(response);
}
origin: org.apache.cayenne/cayenne-server

/**
 * @return alias for this property
 */
public String getAlias() {
  if(getName() == null) {
    return null;
  }
  // check if default name for Path expression is overridden
  Expression exp = getExpression();
  if(exp instanceof ASTPath) {
    if(((ASTPath) exp).getPath().equals(getName())) {
      return null;
    }
  }
  return getName();
}
origin: agrestio/agrest

@Test
public void testBuildQuery_Ordering() {
  Ordering o1 = E1.NAME.asc();
  Ordering o2 = E1.NAME.desc();
  SelectQuery<E1> query = new SelectQuery<E1>(E1.class);
  query.addOrdering(o1);
  ResourceEntity<E1> resourceEntity = getResourceEntity(E1.class);
  resourceEntity.getOrderings().add(o2);
  SelectContext<E1> context = new SelectContext<E1>(E1.class);
  context.setSelect(query);
  context.setEntity(resourceEntity);
  SelectQuery<E1> amended = makeQueryStage.buildQuery(context);
  assertSame(query, amended);
  assertEquals(2, amended.getOrderings().size());
  assertSame(o1, amended.getOrderings().get(0));
  assertSame(o2, amended.getOrderings().get(1));
}
origin: org.apache.cayenne/cayenne-server

/**
 * Creates property with name and type
 * @see Property#create(Expression, Class)
 * @see Property#create(String, Expression, Class)
 */
public static <T> Property<T> create(String name, Class<? super T> type) {
  return new Property<>(name, type);
}
origin: org.apache.cayenne/cayenne-server

/**
 * <p>Select average value of property</p>
 * @see ColumnSelect#columns(Property, Property[])
 */
public ColumnSelect<Object[]> avg(Property<?> property) {
  return columns(property.avg());
}
origin: org.apache.cayenne/cayenne-server

/**
 * @return Ascending case insensitive sort orderings on this property.
 */
public List<Ordering> ascInsensitives() {
  List<Ordering> result = new ArrayList<>(1);
  result.add(ascInsensitive());
  return result;
}
origin: agrestio/agrest

@Test
public void testPut_ToMany() {
  insert("e2", "id, name", "1, 'xxx'");
  insert("e2", "id, name", "8, 'yyy'");
  insert("e3", "id, name, e2_id", "3, 'zzz', null");
  insert("e3", "id, name, e2_id", "4, 'aaa', 8");
  insert("e3", "id, name, e2_id", "5, 'bbb', 8");
  Response response = target("/e2/1")
      .queryParam("include", E2.E3S.getName())
      .queryParam("exclude", E2.ADDRESS.getName(), E2.NAME.getName(), E2.E3S.dot(E3.NAME).getName(), E2.E3S.dot(E3.PHONE_NUMBER).getName())
      .request().put(Entity.json("{\"e3s\":[3,4,5]}"));
  onSuccess(response).bodyEquals(1, "{\"id\":1,\"e3s\":[{\"id\":3},{\"id\":4},{\"id\":5}]}");
  assertEquals(3L, countRows("e3", "WHERE e2_id = 1"));
}
origin: org.apache.cayenne/cayenne-server

/**
 * Creates property with name, expression and type
 * @see Property#create(String, Class)
 * @see Property#create(Expression, Class)
 */
public static <T> Property<T> create(String name, Expression expression, Class<? super T> type) {
  return new Property<>(name, expression, type);
}
origin: org.apache.cayenne/cayenne-server

/**
 * <p>Select average value of property</p>
 * @see ObjectSelect#column(Property)
 */
public <E> ColumnSelect<E> avg(Property<E> property) {
  return column(property.avg());
}
origin: org.apache.cayenne/cayenne-server

/**
 * Returns a prefetch tree that follows this property path, potentially
 * spanning a number of phantom nodes, and having a single leaf with "joint"
 * prefetch semantics.
 */
public PrefetchTreeNode joint() {
  return PrefetchTreeNode.withPath(getName(), PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
}
origin: agrestio/agrest

@Test
public void testPut_ToMany_UnrelateAll() {
  insert("e2", "id, name", "1, 'xxx'");
  insert("e2", "id, name", "8, 'yyy'");
  insert("e3", "id, name, e2_id", "3, 'zzz', null");
  insert("e3", "id, name, e2_id", "4, 'aaa', 8");
  insert("e3", "id, name, e2_id", "5, 'bbb', 8");
  Response response = target("/e2/8")
      .queryParam("include", E2.E3S.getName())
      .queryParam("exclude", E2.ADDRESS.getName(), E2.NAME.getName(), E2.E3S.dot(E3.NAME).getName(), E2.E3S.dot(E3.PHONE_NUMBER).getName())
      .request().put(Entity.json("{\"e3s\":[]}"));
  onSuccess(response).bodyEquals(1, "{\"id\":8,\"e3s\":[]}");
  assertEquals(3, countRows("e3", "WHERE e2_id IS NULL"));
}
origin: org.apache.cayenne/cayenne-server

/**
 * Creates property with expression and type
 * @see Property#create(String, Class)
 * @see Property#create(String, Expression, Class)
 */
public static <T> Property<T> create(Expression expression, Class<? super T> type) {
  return new Property<>(null, expression, type);
}
origin: org.apache.cayenne/cayenne-server

/**
 * Returns a prefetch tree that follows this property path, potentially
 * spanning a number of phantom nodes, and having a single leaf with
 * "disjoint" prefetch semantics.
 */
public PrefetchTreeNode disjoint() {
  return PrefetchTreeNode.withPath(getName(), PrefetchTreeNode.DISJOINT_PREFETCH_SEMANTICS);
}
origin: agrestio/agrest

@Test
public void testPut_ToMany_UnrelateOne() {
  insert("e2", "id, name", "1, 'xxx'");
  insert("e2", "id, name", "8, 'yyy'");
  insert("e3", "id, name, e2_id", "3, 'zzz', null");
  insert("e3", "id, name, e2_id", "4, 'aaa', 8");
  insert("e3", "id, name, e2_id", "5, 'bbb', 8");
  Response response = target("/e2/1")
      .queryParam("include", E2.E3S.getName())
      .queryParam("exclude", E2.ADDRESS.getName(), E2.NAME.getName(), E2.E3S.dot(E3.NAME).getName(), E2.E3S.dot(E3.PHONE_NUMBER).getName())
      .request()
      .put(Entity.json("{\"e3s\":[4]}"));
  onSuccess(response).bodyEquals(1, "{\"id\":1,\"e3s\":[{\"id\":4}]}");
  assertEquals(1L, countRows("e3", "WHERE e2_id = 1 AND id = 4"));
  assertEquals(1L, countRows("e3", "WHERE e2_id = 8 AND id = 5"));
}
org.apache.cayenne.expProperty

Javadoc

A property in a org.apache.cayenne.DataObject.

Used to construct Expressions quickly and with type-safety, and to construct Orderings.

Instances of this class are immutable.

Must be created via factory methods Property#create(String,Class)

Most used methods

  • getName
  • asc
  • desc
  • <init>
    Constructs a new property with the given name and expression
  • ascInsensitive
  • avg
  • count
  • create
    Creates property with expression and type
  • descInsensitive
  • dot
    Constructs a new property path by appending the argument to the existing property separated by a dot
  • eq
  • getAlias
  • eq,
  • getAlias,
  • getExpression,
  • getFrom,
  • getType,
  • in,
  • isOuter,
  • max,
  • min,
  • setIn

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • CodeWhisperer alternatives
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