unified javadocs

This commit is contained in:
Timo Westkämper 2008-04-06 13:59:36 +00:00
parent a3fbcb90d6
commit 755f8a4ba9
19 changed files with 246 additions and 38 deletions

View File

@ -27,8 +27,8 @@ import com.mysema.query.grammar.types.HqlTypes.DistinctPath;
import com.mysema.query.grammar.types.HqlTypes.SubQuery;
/**
* HqlGrammar extends the Query DSL base grammar to provide HQL specific syntax elements
*
* HqlGrammar extends the Query DSL base grammar to provide HQL specific syntax elements.
*
* @author tiwe
* @version $Id$
*/

View File

@ -16,8 +16,8 @@ import com.mysema.query.grammar.types.PathMetadata;
import com.mysema.query.grammar.types.PathMetadata.PathType;
/**
* HqlOps provides
*
* HqlOps provides.
*
* @author tiwe
* @version $Id$
*/
@ -152,6 +152,9 @@ public class HqlOps {
}
}
/**
* The Interface OpHql.
*/
public interface OpHql{
Op<java.util.Date> CURRENT_DATE = new Op<java.util.Date>();
Op<java.util.Date> CURRENT_TIME = new Op<java.util.Date>();
@ -168,12 +171,18 @@ public class HqlOps {
Op<java.util.Date> YEAR = new Op<java.util.Date>();
}
/**
* The Interface OpNumberAgg.
*/
public interface OpNumberAgg{
Op<java.lang.Number> AVG = new Op<java.lang.Number>();
Op<java.lang.Number> MAX = new Op<java.lang.Number>();
Op<java.lang.Number> MIN = new Op<java.lang.Number>();
}
/**
* The Interface OpQuant.
*/
public interface OpQuant{
Op<java.lang.Number> AVG_IN_COL = new Op<java.lang.Number>();
Op<java.lang.Number> MAX_IN_COL = new Op<java.lang.Number>();
@ -189,6 +198,9 @@ public class HqlOps {
Op<?> NOTEXISTS = new Op<Object>();
}
/**
* The Interface HqlPathType.
*/
public interface HqlPathType{
PathType MINELEMENT = new PathType();
PathType MAXELEMENT = new PathType();

View File

@ -10,8 +10,8 @@ import java.util.List;
import com.mysema.query.QueryBase;
/**
* HqlQueryBase provides
*
* HqlQueryBase provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -25,8 +25,8 @@ import com.mysema.query.grammar.types.PathMetadata.PathType;
/**
* HqlSerializer provides
*
* HqlSerializer provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -6,8 +6,8 @@
package com.mysema.query.grammar.types;
/**
* Custom provides
*
* Custom provides.
*
* @author tiwe
* @version $Id$
*/
@ -16,8 +16,14 @@ public interface Custom<T> {
Expr<?>[] getArgs();
java.lang.String getPattern();
/**
* The Class Boolean.
*/
public static abstract class Boolean extends Expr.Boolean implements Custom<java.lang.Boolean>{ }
/**
* The Class Comparable.
*/
public static abstract class Comparable<T extends java.lang.Comparable<T>>
extends Expr.Comparable<T> implements Custom<T>{
public Comparable(Class<T> type) {
@ -25,6 +31,9 @@ public interface Custom<T> {
}
}
/**
* The Class String.
*/
public static abstract class String extends Expr.String implements Custom<java.lang.String>{ }
}

View File

@ -10,13 +10,16 @@ import com.mysema.query.QueryBase;
import com.mysema.query.grammar.OrderSpecifier;
/**
* HqlTypes provides
*
* HqlTypes provides.
*
* @author tiwe
* @version $Id$
*/
public class HqlTypes {
/**
* The Class Constructor.
*/
public static class Constructor<D> extends Expr<D>{
private final Expr<?>[] args;
public Constructor(Class<D> type, Expr<?>... args){
@ -26,6 +29,9 @@ public class HqlTypes {
public Expr<?>[] getArgs(){ return args; }
}
/**
* The Class CountExpression.
*/
public static class CountExpression extends Expr.Comparable<Long>{
private final Expr<?> target;
public CountExpression(Expr<?> expr) {
@ -35,6 +41,9 @@ public class HqlTypes {
public Expr<?> getTarget(){ return target; }
}
/**
* The Class DistinctPath.
*/
public static class DistinctPath<T> extends Expr<T>{
private final Path<T> path;
@SuppressWarnings("unchecked")
@ -45,6 +54,9 @@ public class HqlTypes {
public Path<T> getPath(){ return path; }
}
/**
* The Class SubQuery.
*/
public static class SubQuery<A> extends Expr<A> implements Query<SubQuery<A>>, CollectionType<A>{
@SuppressWarnings("unchecked")
private QueryBase<?> query = new QueryBase();

View File

@ -8,8 +8,8 @@ package com.mysema.query.grammar.types;
import com.mysema.query.grammar.Ops.Op;
/**
* Quant provides
*
* Quant provides.
*
* @author tiwe
* @version $Id$
*/
@ -18,6 +18,9 @@ public interface Quant {
Op<?> getOperator();
Expr<?> getTarget();
/**
* The Class Boolean.
*/
public static class Boolean<Q> extends Expr.Boolean implements Quant{
private final Expr<?> col;
private final Op<?> op;
@ -29,6 +32,9 @@ public interface Quant {
public Expr<?> getTarget() {return col;}
}
/**
* The Class Comparable.
*/
public static class Comparable<Q extends java.lang.Comparable<Q>> extends Expr.Comparable<Q> implements Quant{
private final Expr<?> col;
private final Op<?> op;
@ -41,6 +47,9 @@ public interface Quant {
public Expr<?> getTarget() {return col;}
}
/**
* The Class Simple.
*/
public static class Simple<Q> extends Expr.Simple<Q> implements Quant{
private final Expr<?> col;
private final Op<?> op;

View File

@ -17,8 +17,8 @@ import com.mysema.query.grammar.HqlQueryBase;
import com.mysema.query.grammar.types.Path;
/**
* HqlQuery provides a fluent statically typed interface for creating HQL queries
*
* HqlQuery provides a fluent statically typed interface for creating HQL queries.
*
* @author tiwe
* @version $Id$
*/

View File

@ -7,8 +7,8 @@
package com.mysema.query.hibernate;
/**
* QueryModifiers provides
*
* QueryModifiers provides.
*
* @author Timo Westkamper
* @version $Id$
*/

View File

@ -18,8 +18,8 @@ import com.mysema.query.grammar.types.PathMetadata;
/**
* QueryUtil provides
*
* QueryUtil provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -10,8 +10,8 @@ import java.util.Collections;
import java.util.List;
/**
* SearchResults provides
*
* SearchResults provides.
*
* @author Timo Westkamper
* @version $Id$
*/

View File

@ -1,10 +1,15 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.grammar.hql;
import static com.mysema.query.Domain1.*;
/**
* Domain1Instances provides
*
* Domain1Instances provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.grammar.hql;
import static com.mysema.query.Domain1.cat;
@ -26,8 +31,8 @@ import com.mysema.query.grammar.types.HqlTypes.Constructor;
/**
* FeaturesTest provides
*
* FeaturesTest provides.
*
* @author tiwe
* @version $Id$
*/
@ -106,6 +111,9 @@ public class FeaturesTest extends HqlQueryBase<FeaturesTest>{
cat.name.eq(cust.name().firstName).or(cat.bodyWeight.eq(kitten.bodyWeight));
}
/**
* The Class MyCustomExpr.
*/
public class MyCustomExpr extends Custom.String{
private Expr<?>[] args;
public MyCustomExpr(Expr<?>... args) {
@ -326,6 +334,9 @@ public class FeaturesTest extends HqlQueryBase<FeaturesTest>{
visitor = new HqlSerializer();
}
/**
* The Class _BookmarkDTO.
*/
public static final class _BookmarkDTO extends Constructor<BookmarkDTO>{
public _BookmarkDTO(){
super(BookmarkDTO.class);
@ -335,6 +346,9 @@ public class FeaturesTest extends HqlQueryBase<FeaturesTest>{
}
}
/**
* The Class BookmarkDTO.
*/
public static final class BookmarkDTO{
}

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.grammar.hql;
@ -20,19 +25,25 @@ import com.mysema.query.annotations.DTO;
/**
* HqlDomain provides
*
* HqlDomain provides.
*
* @author tiwe
* @version $Id$
*/
public class HqlDomain {
/**
* The Class Account.
*/
@Entity
public static class Account {
@Id long id;
@ManyToOne Person owner;
}
/**
* The Class Animal.
*/
@Entity
public static class Animal {
boolean alive;
@ -43,24 +54,36 @@ public class HqlDomain {
String name;
}
/**
* The Class AuditLog.
*/
@Entity
public static class AuditLog {
@Id int id;
@ManyToOne Item item;
}
/**
* The Class Bar.
*/
@Entity
public static class Bar {
java.util.Date date;
@Id int id;
}
/**
* The Class Calendar.
*/
@Entity
public static class Calendar {
@CollectionOfElements Map<String,java.util.Date> holidays;
@Id int id;
}
/**
* The Class Cat.
*/
@Entity
public static class Cat extends Animal{
int breed;
@ -69,6 +92,9 @@ public class HqlDomain {
@ManyToOne Cat mate;
}
/**
* The Class Catalog.
*/
@Entity
public static class Catalog {
Date effectiveDate;
@ -76,10 +102,16 @@ public class HqlDomain {
@OneToMany Collection<Price> prices;
}
/**
* The Enum Color.
*/
public enum Color {
BLACK, TABBY
}
/**
* The Class Company.
*/
@Entity
public static class Company {
@ManyToOne Employee ceo;
@ -88,6 +120,9 @@ public class HqlDomain {
String name;
}
/**
* The Class Customer.
*/
@Entity
public static class Customer {
@ManyToOne Order currentOrder;
@ -95,6 +130,9 @@ public class HqlDomain {
@ManyToOne Name name;
}
/**
* The Class Department.
*/
@Entity
public static class Department {
@ManyToOne Company company;
@ -103,6 +141,9 @@ public class HqlDomain {
String name;
}
/**
* The Class Document.
*/
@Entity
public static class Document {
@Id int id;
@ -110,17 +151,26 @@ public class HqlDomain {
Date validTo;
}
/**
* The Class DomesticCat.
*/
@Entity
public static class DomesticCat extends Cat{
}
/**
* The Class doofus.
*/
@Entity
public static class doofus{
String gob;
@Id long id;
}
/**
* The Class Employee.
*/
@Entity
public static class Employee {
@ManyToOne Company company;
@ -128,6 +178,9 @@ public class HqlDomain {
@Id int id;
}
/**
* The Class EvilType.
*/
@Entity
public static class EvilType {
@ManyToOne @JoinColumn(name="_asc") EvilType asc;
@ -137,6 +190,9 @@ public class HqlDomain {
@ManyToOne EvilType toString, hashCode, getClass, notify, notifyAll, wait;
}
/**
* The Class Family.
*/
@DTO
public static class Family {
public Family(Cat mother, Cat mate, Cat offspr){
@ -144,6 +200,9 @@ public class HqlDomain {
}
}
/**
* The Class Foo.
*/
@Entity
@DTO
public static class Foo {
@ -156,48 +215,72 @@ public class HqlDomain {
public Foo(long l, long r){}
}
/**
* The Class Formula.
*/
@Entity
public static class Formula {
@Id int id;
@ManyToOne Parameter parameter;
}
/**
* The Class Item.
*/
@Entity
public static class Item {
@Id long id;
@ManyToOne Product product;
}
/**
* The Class Location.
*/
@Entity
public static class Location {
@Id long id;
String name;
}
/**
* The Class Name.
*/
@Entity
public static class Name {
String firstName, lastName, nickName;
@Id long id;
}
/**
* The Class Named.
*/
@Entity
public static class Named {
@Id long id;
String name;
}
/**
* The Class NameList.
*/
@Entity
public static class NameList{
@Id long id;
@CollectionOfElements Collection<String> names;
}
/**
* The Class Nationality.
*/
@Entity
public static class Nationality {
@ManyToOne Calendar calendar;
@Id long id;
}
/**
* The Class Order.
*/
@Entity
public static class Order {
@ManyToOne Customer customer;
@ -207,11 +290,17 @@ public class HqlDomain {
boolean paid;
}
/**
* The Class Parameter.
*/
@Entity
public static class Parameter {
@Id long id;
}
/**
* The Class Payment.
*/
@Entity
public static class Payment extends Item{
@ManyToOne Status currentStatus, status;
@ -219,10 +308,16 @@ public class HqlDomain {
@OneToMany Collection<StatusChange> statusChanges;
}
/**
* The Enum PaymentStatus.
*/
public enum PaymentStatus{
AWAITING_APPROVAL
}
/**
* The Class Person.
*/
@Entity
public static class Person {
java.util.Date birthDay;
@ -232,6 +327,9 @@ public class HqlDomain {
@ManyToOne Nationality nationality;
}
/**
* The Class PersonId.
*/
@Entity
public static class PersonId {
String country;
@ -239,12 +337,18 @@ public class HqlDomain {
int medicareNumber;
}
/**
* The Class Player.
*/
@Entity
public static class Player{
@Id long id;
@CollectionOfElements List<Integer> scores;
}
/**
* The Class Price.
*/
@Entity
public static class Price {
long amount;
@ -252,30 +356,45 @@ public class HqlDomain {
@ManyToOne Product product;
}
/**
* The Class Product.
*/
@Entity
public static class Product extends Item{
// @Id long id;
String name;
}
/**
* The Class Show.
*/
@Entity
public static class Show {
@CollectionOfElements Map<String,String> acts;
@Id int id;
}
/**
* The Class Status.
*/
@Entity
public static class Status {
@Id long id;
String name;
}
/**
* The Class StatusChange.
*/
@Entity
public static class StatusChange {
@Id long id;
java.util.Date timeStamp;
}
/**
* The Class Store.
*/
@Entity
public static class Store {
@OneToMany List<Customer> customers;
@ -283,6 +402,9 @@ public class HqlDomain {
@ManyToOne Location location;
}
/**
* The Class User.
*/
@Entity
public static class User {
@ManyToOne Company company;

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.grammar.hql;
import org.hibernate.Query;
@ -14,8 +19,8 @@ import com.mysema.query.util.HibernateTestRunner;
/**
* HibernatePersistenceTest provides
*
* HibernatePersistenceTest provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.grammar.hql;
import static com.mysema.query.grammar.Grammar.div;
@ -30,8 +35,8 @@ import com.mysema.query.grammar.hql.HqlDomain.Payment;
/**
* HqlParserTest provides
*
* HqlParserTest provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -1,10 +1,15 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.util;
import org.hibernate.cfg.ImprovedNamingStrategy;
/**
* CustomNamingStrategy provides
*
* CustomNamingStrategy provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.util;
import java.lang.annotation.ElementType;
@ -10,8 +15,8 @@ import org.hibernate.cfg.DefaultNamingStrategy;
import org.hibernate.cfg.NamingStrategy;
/**
* Hibernate provides
*
* Hibernate provides.
*
* @author tiwe
* @version $Id$
*/

View File

@ -1,3 +1,8 @@
/*
* Copyright (c) 2008 Mysema Ltd.
* All rights reserved.
*
*/
package com.mysema.query.util;
import java.lang.reflect.Method;
@ -14,8 +19,8 @@ import com.mysema.query.grammar.hql.HqlDomain;
import com.mysema.query.grammar.hql.HqlIntegrationTest;
/**
* HibernateTestRunner provides
*
* HibernateTestRunner provides.
*
* @author tiwe
* @version $Id$
*/