Tabnine Logo
QPair.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
com.mysema.query.group.QPair

Best Java code snippets using com.mysema.query.group.QPair.create (Showing top 8 results out of 315)

origin: com.mysema.querydsl/querydsl-core

/**
 * Create a new aggregating map expression using a backing TreeMap using the given comparator
 *
 * @param key
 * @param value
 * @param comparator
 * @return
 */
public static <K, V> AbstractGroupExpression<Pair<K, V>, SortedMap<K, V>> sortedMap(Expression<K> key, Expression<V> value, Comparator<? super K> comparator) {
  return GMap.createSorted(QPair.create(key, value), comparator);
}
origin: com.mysema.querydsl/querydsl-core

/**
 * Create a new aggregating map expression using a backing TreeMap
 *
 * @param key
 * @param value
 * @return
 */
public static <K extends Comparable<? super K>, V> AbstractGroupExpression<Pair<K, V>, SortedMap<K, V>> sortedMap(Expression<K> key, Expression<V> value) {
  return GMap.createSorted(QPair.create(key, value));
}
origin: com.mysema.querydsl/querydsl-core

/**
 * Create a new aggregating map expression using a backing LinkedHashMap
 *
 * @param key
 * @param value
 * @return
 */
public static <K, V, T, U> AbstractGroupExpression<Pair<K, V>, Map<T, U>> map(GroupExpression<K, T> key, GroupExpression<V, U> value) {
  return new GMap.Mixin<K, V, T, U, Map<T, U>>(key, value, GMap.createLinked(QPair.create(key, value)));
}
origin: com.mysema.querydsl/querydsl-core

/**
 * Create a new aggregating map expression using a backing TreeMap
 *
 * @param key
 * @param value
 * @return
 */
public static <K extends Comparable<? super K>, V, T extends Comparable<? super T>, U> AbstractGroupExpression<Pair<K, V>, SortedMap<T, U>> sortedMap(GroupExpression<K, T> key, GroupExpression<V, U> value) {
  return new GMap.Mixin<K, V, T, U, SortedMap<T, U>>(key, value, GMap.createSorted(QPair.create(key, value)));
}
origin: com.mysema.querydsl/querydsl-core

/**
 * Create a new aggregating map expression using a backing LinkedHashMap
 *
 * @param key
 * @param value
 * @return
 */
@WithBridgeMethods(value=Expression.class,castRequired=true)
public static <K, V> AbstractGroupExpression<Pair<K, V>,Map<K, V>> map(Expression<K> key, Expression<V> value) {
  return GMap.createLinked(QPair.create(key, value));
}
origin: com.mysema.querydsl/querydsl-core

/**
 * Create a new aggregating map expression using a backing TreeMap using the given comparator
 *
 * @param key
 * @param value
 * @param comparator
 * @return
 */
public static <K, V, T, U> AbstractGroupExpression<Pair<K, V>, SortedMap<T, U>> sortedMap(GroupExpression<K, T> key, GroupExpression<V, U> value, Comparator<? super T> comparator) {
  return new GMap.Mixin<K, V, T, U, SortedMap<T, U>>(key, value, GMap.createSorted(QPair.create(key, value), comparator));
}
origin: com.mysema.querydsl/querydsl-core

@SuppressWarnings({ "rawtypes", "unchecked" })
public Mixin(GroupExpression<K, T> keyExpression, GroupExpression<V, U> valueExpression, AbstractGroupExpression<Pair<T, U>, R> mixin) {
  super((Class) mixin.getType(), QPair.create(keyExpression.getExpression(), valueExpression.getExpression()));
  this.keyExpression = keyExpression;
  this.valueExpression = valueExpression;
  this.mixin = mixin;
}
origin: com.mysema.querydsl/querydsl-jpa

@Test
@ExcludeIn({MYSQL, DERBY})
@NoBatooJPA
public void GroupBy() {
  QAuthor author = QAuthor.author;
  QBook book = QBook.book;
  for (int i = 0; i < 10; i++) {
    Author a = new Author();
    a.setName(String.valueOf(i));
    save(a);
    for (int j = 0; j < 2; j++) {
      Book b = new Book();
      b.setTitle(String.valueOf(i)+" "+String.valueOf(j));
      b.setAuthor(a);
      save(b);
    }
  }
  Map<Long, List<Pair<Long, String>>> map = query()
    .from(author)
    .join(author.books, book)
    .transform(GroupBy
      .groupBy(author.id)
      .as(GroupBy.list(QPair.create(book.id, book.title))));
  for (Entry<Long, List<Pair<Long, String>>> entry : map.entrySet()) {
    System.out.println("author = " + entry.getKey());
    for (Pair<Long,String> pair : entry.getValue()) {
      System.out.println("  book = " + pair.getFirst() + "," + pair.getSecond());
    }
  }
}
com.mysema.query.groupQPaircreate

Popular methods of QPair

  • <init>
  • equals
  • getArgs

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top PhpStorm plugins
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