mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
changes to field visibility of domain types
prototyped new features
This commit is contained in:
parent
5408e3d71b
commit
6543d86459
@ -221,6 +221,17 @@ public class FeaturesTest extends HqlQueryBase<FeaturesTest>{
|
||||
// Java public static final constants eg.Color.TABBY
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testShortCuts(){
|
||||
Company c = new Company("c");
|
||||
Department d = new Department("d");
|
||||
Employee e = new Employee("e");
|
||||
// select(c.name, d.name, e.firstName, e.lastName).from(c.join().departments.as(d).join().employees.as(e));
|
||||
// join -> PathEntityRelations (foreign key fields)
|
||||
// departments -> PathEntityRelations
|
||||
// as(d) -> sets alias
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSimpleAliasForNonEntityPaths(){
|
||||
toString("cat.bodyWeight as catbodyWeight", cat.bodyWeight.as("catbodyWeight"));
|
||||
@ -297,10 +308,6 @@ public class FeaturesTest extends HqlQueryBase<FeaturesTest>{
|
||||
visitor = new HqlSerializer();
|
||||
}
|
||||
|
||||
public static final class BookmarkDTO{
|
||||
|
||||
}
|
||||
|
||||
public static final class _BookmarkDTO extends Constructor<BookmarkDTO>{
|
||||
public _BookmarkDTO(){
|
||||
super(BookmarkDTO.class);
|
||||
@ -310,4 +317,8 @@ public class FeaturesTest extends HqlQueryBase<FeaturesTest>{
|
||||
}
|
||||
}
|
||||
|
||||
public static final class BookmarkDTO{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ public class ThingLinkQueriesTest extends HqlQueryBase<ComplexQueriesTest>{
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQuery2(){
|
||||
// "select g._keyword, count(g._keyword) from "
|
||||
// + Thing.class.getName()
|
||||
|
||||
@ -10,5 +10,5 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class AuditLog {
|
||||
protected Item item;
|
||||
Item item;
|
||||
}
|
||||
|
||||
@ -12,9 +12,9 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Cat {
|
||||
protected Collection<Cat> kittens;
|
||||
protected Cat mate;
|
||||
protected int bodyWeight;
|
||||
protected String name;
|
||||
protected boolean alive;
|
||||
Collection<Cat> kittens;
|
||||
Cat mate;
|
||||
int bodyWeight;
|
||||
String name;
|
||||
boolean alive;
|
||||
}
|
||||
|
||||
@ -13,6 +13,6 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Catalog {
|
||||
protected Collection<Price> prices;
|
||||
protected Date effectiveDate;
|
||||
Collection<Price> prices;
|
||||
Date effectiveDate;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.mysema.query.grammar.hql.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
|
||||
@ -11,6 +13,8 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Company {
|
||||
protected long id;
|
||||
protected String name;
|
||||
long id;
|
||||
String name;
|
||||
List<Department> departments;
|
||||
Employee ceo;
|
||||
}
|
||||
|
||||
@ -10,5 +10,5 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Customer {
|
||||
protected Name name;
|
||||
Name name;
|
||||
}
|
||||
|
||||
@ -12,6 +12,6 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Document {
|
||||
protected String name;
|
||||
protected Date validTo;
|
||||
String name;
|
||||
Date validTo;
|
||||
}
|
||||
|
||||
@ -10,6 +10,6 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class EvilType {
|
||||
protected EvilType isnull, isnotnull, asc, desc, get, getType, getMetadata;
|
||||
protected EvilType toString, hashCode, getClass, notify, notifyAll, wait;
|
||||
EvilType isnull, isnotnull, asc, desc, get, getType, getMetadata;
|
||||
EvilType toString, hashCode, getClass, notify, notifyAll, wait;
|
||||
}
|
||||
|
||||
@ -10,6 +10,6 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Item {
|
||||
protected long id;
|
||||
protected Product product;
|
||||
long id;
|
||||
Product product;
|
||||
}
|
||||
|
||||
@ -10,5 +10,5 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Name {
|
||||
protected String firstName, lastName;
|
||||
String firstName, lastName;
|
||||
}
|
||||
|
||||
@ -12,8 +12,8 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Order {
|
||||
protected long id;
|
||||
protected List<Item> items, lineItems;
|
||||
protected boolean paid;
|
||||
protected Customer customer;
|
||||
long id;
|
||||
List<Item> items, lineItems;
|
||||
boolean paid;
|
||||
Customer customer;
|
||||
}
|
||||
|
||||
@ -10,6 +10,6 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class Price {
|
||||
protected long amount;
|
||||
protected Product product;
|
||||
long amount;
|
||||
Product product;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import javax.persistence.Entity;
|
||||
*/
|
||||
@Entity
|
||||
public class User {
|
||||
protected Company company;
|
||||
protected long id;
|
||||
protected String userName, firstName, lastName;
|
||||
Company company;
|
||||
long id;
|
||||
String userName, firstName, lastName;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user