changes to field visibility of domain types

prototyped new features
This commit is contained in:
Timo Westkämper 2008-03-09 18:01:09 +00:00
parent 5408e3d71b
commit 6543d86459
14 changed files with 47 additions and 31 deletions

View File

@ -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{
}
}

View File

@ -34,6 +34,7 @@ public class ThingLinkQueriesTest extends HqlQueryBase<ComplexQueriesTest>{
}
@Test
public void testQuery2(){
// "select g._keyword, count(g._keyword) from "
// + Thing.class.getName()

View File

@ -10,5 +10,5 @@ import javax.persistence.Entity;
*/
@Entity
public class AuditLog {
protected Item item;
Item item;
}

View File

@ -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;
}

View File

@ -13,6 +13,6 @@ import javax.persistence.Entity;
*/
@Entity
public class Catalog {
protected Collection<Price> prices;
protected Date effectiveDate;
Collection<Price> prices;
Date effectiveDate;
}

View File

@ -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;
}

View File

@ -10,5 +10,5 @@ import javax.persistence.Entity;
*/
@Entity
public class Customer {
protected Name name;
Name name;
}

View File

@ -12,6 +12,6 @@ import javax.persistence.Entity;
*/
@Entity
public class Document {
protected String name;
protected Date validTo;
String name;
Date validTo;
}

View File

@ -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;
}

View File

@ -10,6 +10,6 @@ import javax.persistence.Entity;
*/
@Entity
public class Item {
protected long id;
protected Product product;
long id;
Product product;
}

View File

@ -10,5 +10,5 @@ import javax.persistence.Entity;
*/
@Entity
public class Name {
protected String firstName, lastName;
String firstName, lastName;
}

View File

@ -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;
}

View File

@ -10,6 +10,6 @@ import javax.persistence.Entity;
*/
@Entity
public class Price {
protected long amount;
protected Product product;
long amount;
Product product;
}

View File

@ -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;
}