db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: db-ojb/xdocs getting-started.xml howto.xml otm-tutorial.xml howto-get-started.xml index.xml odmg-tutorial.xml project.xml
Date Thu, 27 Nov 2003 13:08:25 GMT
brianm      2003/11/27 05:08:25

  Modified:    src/java/org/apache/ojb/odmg/oql OQLParser.java
               xdocs    howto-get-started.xml index.xml odmg-tutorial.xml
                        project.xml
  Added:       xdocs    getting-started.xml howto.xml otm-tutorial.xml
  Log:
  Exposing new tutorials to the world and reorganizing documentation
  
  Revision  Changes    Path
  1.21      +1425 -1220db-ojb/src/java/org/apache/ojb/odmg/oql/OQLParser.java
  
  Index: OQLParser.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/odmg/oql/OQLParser.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- OQLParser.java	7 Nov 2003 21:45:48 -0000	1.20
  +++ OQLParser.java	27 Nov 2003 13:08:24 -0000	1.21
  @@ -22,6 +22,7 @@
   
   import org.apache.ojb.broker.query.*;
   import org.apache.ojb.broker.metadata.*;
  +
   import java.util.*;
   
   import antlr.TokenBuffer;
  @@ -34,1229 +35,1433 @@
   import antlr.collections.impl.BitSet;
   
   public class OQLParser extends antlr.LLkParser
  -       implements OQLLexerTokenTypes
  - {
  +        implements OQLLexerTokenTypes
  +{
   
  -protected OQLParser(TokenBuffer tokenBuf, int k) {
  -  super(tokenBuf,k);
  -  tokenNames = _tokenNames;
  -}
  +    protected OQLParser(TokenBuffer tokenBuf, int k)
  +    {
  +        super(tokenBuf, k);
  +        tokenNames = _tokenNames;
  +    }
   
  -public OQLParser(TokenBuffer tokenBuf) {
  -  this(tokenBuf,3);
  -}
  +    public OQLParser(TokenBuffer tokenBuf)
  +    {
  +        this(tokenBuf, 3);
  +    }
   
  -protected OQLParser(TokenStream lexer, int k) {
  -  super(lexer,k);
  -  tokenNames = _tokenNames;
  -}
  +    protected OQLParser(TokenStream lexer, int k)
  +    {
  +        super(lexer, k);
  +        tokenNames = _tokenNames;
  +    }
   
  -public OQLParser(TokenStream lexer) {
  -  this(lexer,3);
  -}
  +    public OQLParser(TokenStream lexer)
  +    {
  +        this(lexer, 3);
  +    }
   
  -public OQLParser(ParserSharedInputState state) {
  -  super(state,3);
  -  tokenNames = _tokenNames;
  -}
  +    public OQLParser(ParserSharedInputState state)
  +    {
  +        super(state, 3);
  +        tokenNames = _tokenNames;
  +    }
  +
  +    public final Query buildQuery() throws RecognitionException, TokenStreamException
  +    {
  +        Query query = null;
  +
  +
  +        try
  +        {      // for error handling
  +            query = selectQuery();
  +            {
  +                if ((LA(1) == TOK_SEMIC))
  +                {
  +                    match(TOK_SEMIC);
  +                }
  +                else if ((LA(1) == EOF))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_0);
  +        }
  +        return query;
  +    }
  +
  +    public final QueryByCriteria selectQuery() throws RecognitionException, TokenStreamException
  +    {
  +        QueryByCriteria query = null;
  +
  +
  +        try
  +        {      // for error handling
  +
  +            Class clazz = null;
  +            Criteria criteria = new Criteria();
  +            String[] projectionAttrs;
  +            boolean distinct = false;
  +
  +            match(LITERAL_select);
  +            {
  +                if ((LA(1) == LITERAL_distinct))
  +                {
  +                    match(LITERAL_distinct);
  +
  +                    distinct = true;
  +
  +                }
  +                else if ((LA(1) == TOK_STAR || LA(1) == Identifier))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            projectionAttrs = projectionAttributes();
  +            match(LITERAL_from);
  +            clazz = fromClause();
  +            {
  +                if ((LA(1) == LITERAL_where))
  +                {
  +                    match(LITERAL_where);
  +                    whereClause(criteria);
  +                }
  +                else if ((_tokenSet_1.member(LA(1))))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +
  +            if (clazz != null)
  +            {
  +                if (projectionAttrs[0].indexOf('.') < 0)
  +                {
  +                    query = QueryFactory.newQuery(clazz, criteria, distinct);
  +                }
  +                else
  +                {
  +                    ClassDescriptor cld = MetadataManager.getInstance().getRepository().getDescriptorFor(clazz);
  +                    for (int i = 0; i < projectionAttrs.length; i++)
  +                    {
  +                        projectionAttrs[i] = projectionAttrs[i].substring(projectionAttrs[i].indexOf('.') + 1);
  +                    }
  +
  +                    ArrayList descs = cld.getAttributeDescriptorsForPath(projectionAttrs[0]);
  +                    int pathLen = descs.size();
  +
  +                    if ((pathLen > 0) && (descs.get(pathLen - 1) instanceof ObjectReferenceDescriptor))
  +                    {
  +                        ObjectReferenceDescriptor ord =
  +                                ((ObjectReferenceDescriptor) descs.get(pathLen - 1));
  +                        query = QueryFactory.newQuery(clazz, criteria, distinct);
  +                        query.setObjectProjectionAttribute(projectionAttrs[0],
  +                                                           ord.getItemClass());
  +                    }
  +                    else
  +                    {
  +                        query = QueryFactory.newReportQuery(clazz, projectionAttrs, criteria, distinct);
  +                    }
  +                }
  +            }
  +
  +            {
  +                if ((LA(1) == LITERAL_order))
  +                {
  +                    match(LITERAL_order);
  +                    match(LITERAL_by);
  +                    orderClause(query);
  +                }
  +                else if ((_tokenSet_2.member(LA(1))))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            {
  +                if ((LA(1) == LITERAL_group))
  +                {
  +                    match(LITERAL_group);
  +                    match(LITERAL_by);
  +                    groupClause(query);
  +                }
  +                else if ((_tokenSet_3.member(LA(1))))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            {
  +                if ((LA(1) == LITERAL_prefetch))
  +                {
  +                    match(LITERAL_prefetch);
  +                    prefetchClause(query);
  +                }
  +                else if ((LA(1) == EOF || LA(1) == TOK_RPAREN || LA(1) == TOK_SEMIC))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_4);
  +        }
  +        return query;
  +    }
  +
  +    public final String[] projectionAttributes() throws RecognitionException, TokenStreamException
  +    {
  +        String[] projectionAttrs = null;
  +
  +        Token id = null;
  +        Token id1 = null;
  +
  +        try
  +        {      // for error handling
  +
  +            String first = null;
  +            ArrayList list = null;
  +
  +            {
  +                if ((LA(1) == Identifier))
  +                {
  +                    id = LT(1);
  +                    match(Identifier);
  +                    {
  +
  +                        first = id.getText();
  +
  +                    }
  +                    {
  +                        _loop80:
  +                        do
  +                        {
  +                            if ((LA(1) == TOK_COMMA))
  +                            {
  +                                match(TOK_COMMA);
  +                                id1 = LT(1);
  +                                match(Identifier);
  +                                {
  +
  +                                    if (list == null)
  +                                    {
  +                                        list = new ArrayList();
  +                                        list.add(first);
  +                                    }
  +                                    list.add(id1.getText());
  +
  +                                }
  +                            }
  +                            else
  +                            {
  +                                break _loop80;
  +                            }
  +
  +                        }
  +                        while (true);
  +                    }
  +                }
  +                else if ((LA(1) == TOK_STAR))
  +                {
  +                    match(TOK_STAR);
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +
  +            if (list == null)
  +            {
  +                projectionAttrs = new String[]{first};
  +            }
  +            else
  +            {
  +                projectionAttrs = (String[]) list.toArray(new String[list.size()]);
  +            }
  +
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_5);
  +        }
  +        return projectionAttrs;
  +    }
  +
  +    public final Class fromClause() throws RecognitionException, TokenStreamException
  +    {
  +        Class clazz = null;
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +            id = LT(1);
  +            match(Identifier);
  +
  +            try
  +            {
  +                clazz = Class.forName(id.getText(), true,
  +                                      Thread.currentThread().getContextClassLoader());
  +            }
  +            catch (Exception e)
  +            {
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_6);
  +        }
  +        return clazz;
  +    }
  +
  +    public final void whereClause(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +            orExpr(criteria);
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void orderClause(
  +            QueryByCriteria query
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +            sortCriterion(query);
  +            {
  +                _loop83:
  +                do
  +                {
  +                    if ((LA(1) == TOK_COMMA))
  +                    {
  +                        match(TOK_COMMA);
  +                        sortCriterion(query);
  +                    }
  +                    else
  +                    {
  +                        break _loop83;
  +                    }
  +
  +                }
  +                while (true);
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_2);
  +        }
  +    }
  +
  +    public final void groupClause(
  +            QueryByCriteria query
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +            groupCriterion(query);
  +            {
  +                _loop89:
  +                do
  +                {
  +                    if ((LA(1) == TOK_COMMA))
  +                    {
  +                        match(TOK_COMMA);
  +                        groupCriterion(query);
  +                    }
  +                    else
  +                    {
  +                        break _loop89;
  +                    }
  +
  +                }
  +                while (true);
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_3);
  +        }
  +    }
  +
  +    public final void prefetchClause(
  +            QueryByCriteria query
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +            prefetchCriterion(query);
  +            {
  +                _loop93:
  +                do
  +                {
  +                    if ((LA(1) == TOK_COMMA))
  +                    {
  +                        match(TOK_COMMA);
  +                        prefetchCriterion(query);
  +                    }
  +                    else
  +                    {
  +                        break _loop93;
  +                    }
  +
  +                }
  +                while (true);
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_4);
  +        }
  +    }
  +
  +    public final Query existsQuery() throws RecognitionException, TokenStreamException
  +    {
  +        Query query = null;
  +
  +
  +        try
  +        {      // for error handling
  +
  +            Class clazz = null;
  +            Criteria criteria = new Criteria();
  +
  +            match(LITERAL_exists);
  +            projectionAttributes();
  +            match(LITERAL_in);
  +            clazz = fromClause();
  +            {
  +                if ((LA(1) == TOK_COLON))
  +                {
  +                    match(TOK_COLON);
  +                    whereClause(criteria);
  +                }
  +                else if ((_tokenSet_7.member(LA(1))))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +
  +            if (clazz != null)
  +            {
  +                query = QueryFactory.newQuery(clazz, criteria);
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +        return query;
  +    }
  +
  +    public final void orExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +            andExpr(criteria);
  +            {
  +                _loop97:
  +                do
  +                {
  +                    if ((LA(1) == LITERAL_or) && (_tokenSet_8.member(LA(2))) && (_tokenSet_9.member(LA(3))))
  +                    {
  +                        match(LITERAL_or);
  +                        Criteria orCriteria = new Criteria();
  +                        andExpr(orCriteria);
  +                        criteria.addOrCriteria(orCriteria);
  +                    }
  +                    else
  +                    {
  +                        break _loop97;
  +                    }
  +
  +                }
  +                while (true);
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void sortCriterion(
  +            QueryByCriteria query
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +            boolean descending = false;
  +            id = LT(1);
  +            match(Identifier);
  +            {
  +                if ((LA(1) == LITERAL_asc || LA(1) == LITERAL_desc))
  +                {
  +                    {
  +                        if ((LA(1) == LITERAL_asc))
  +                        {
  +                            match(LITERAL_asc);
  +                            descending = false;
  +                        }
  +                        else if ((LA(1) == LITERAL_desc))
  +                        {
  +                            match(LITERAL_desc);
  +                            descending = true;
  +                        }
  +                        else
  +                        {
  +                            throw new NoViableAltException(LT(1), getFilename());
  +                        }
  +
  +                    }
  +                }
  +                else if ((_tokenSet_10.member(LA(1))))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +
  +            if (descending)
  +            {
  +                query.addOrderByDescending(id.getText());
  +            }
  +            else
  +            {
  +                query.addOrderByAscending(id.getText());
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_10);
  +        }
  +    }
  +
  +    public final void groupCriterion(
  +            QueryByCriteria query
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
   
  -	public final Query  buildQuery() throws RecognitionException, TokenStreamException {
  -		Query query = null;
  -		
  -		
  -		try {      // for error handling
  -			query=selectQuery();
  -			{
  -			if ((LA(1)==TOK_SEMIC)) {
  -				match(TOK_SEMIC);
  -			}
  -			else if ((LA(1)==EOF)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_0);
  -		}
  -		return query;
  -	}
  -	
  -	public final QueryByCriteria  selectQuery() throws RecognitionException, TokenStreamException {
  -		QueryByCriteria query = null;
  -		
  -		
  -		try {      // for error handling
  -			
  -			Class clazz = null;
  -			Criteria criteria = new Criteria();
  -			String[] projectionAttrs;
  -			boolean distinct = false;
  -			
  -			match(LITERAL_select);
  -			{
  -			if ((LA(1)==LITERAL_distinct)) {
  -				match(LITERAL_distinct);
  -				
  -				distinct = true;
  -				
  -			}
  -			else if ((LA(1)==TOK_STAR||LA(1)==Identifier)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			projectionAttrs=projectionAttributes();
  -			match(LITERAL_from);
  -			clazz=fromClause();
  -			{
  -			if ((LA(1)==LITERAL_where)) {
  -				match(LITERAL_where);
  -				whereClause(criteria);
  -			}
  -			else if ((_tokenSet_1.member(LA(1)))) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			
  -			if (clazz != null)
  -			{
  -			if (projectionAttrs[0].indexOf('.') < 0)
  -			{
  -			query = QueryFactory.newQuery(clazz, criteria, distinct);
  -			}
  -			else
  -			{
  -			ClassDescriptor cld = MetadataManager.getInstance().getRepository().getDescriptorFor(clazz);
  -			for (int i = 0; i < projectionAttrs.length; i++)
  -			{
  -			projectionAttrs[i] = projectionAttrs[i].substring(projectionAttrs[i].indexOf('.') + 1);
  -			}
  -			
  -			ArrayList descs = cld.getAttributeDescriptorsForPath(projectionAttrs[0]);
  -			int pathLen = descs.size();
  -			
  -			if ((pathLen > 0) && (descs.get(pathLen - 1) instanceof ObjectReferenceDescriptor))
  -			{
  -			ObjectReferenceDescriptor ord =
  -			((ObjectReferenceDescriptor) descs.get(pathLen - 1));
  -			query = QueryFactory.newQuery(clazz, criteria, distinct);
  -			query.setObjectProjectionAttribute(projectionAttrs[0],
  -			ord.getItemClass());
  -			}
  -			else
  -			{
  -			query = QueryFactory.newReportQuery(clazz, projectionAttrs, criteria, distinct);
  -			}
  -			}
  -			}
  -			
  -			{
  -			if ((LA(1)==LITERAL_order)) {
  -				match(LITERAL_order);
  -				match(LITERAL_by);
  -				orderClause(query);
  -			}
  -			else if ((_tokenSet_2.member(LA(1)))) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			{
  -			if ((LA(1)==LITERAL_group)) {
  -				match(LITERAL_group);
  -				match(LITERAL_by);
  -				groupClause(query);
  -			}
  -			else if ((_tokenSet_3.member(LA(1)))) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			{
  -			if ((LA(1)==LITERAL_prefetch)) {
  -				match(LITERAL_prefetch);
  -				prefetchClause(query);
  -			}
  -			else if ((LA(1)==EOF||LA(1)==TOK_RPAREN||LA(1)==TOK_SEMIC)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_4);
  -		}
  -		return query;
  -	}
  -	
  -	public final String[]  projectionAttributes() throws RecognitionException, TokenStreamException {
  -		String[] projectionAttrs = null;
  -		
  -		Token  id = null;
  -		Token  id1 = null;
  -		
  -		try {      // for error handling
  -			
  -			String first = null;
  -			ArrayList list = null;
  -			
  -			{
  -			if ((LA(1)==Identifier)) {
  -				id = LT(1);
  -				match(Identifier);
  -				{
  -				
  -				first = id.getText();
  -				
  -				}
  -				{
  -				_loop80:
  -				do {
  -					if ((LA(1)==TOK_COMMA)) {
  -						match(TOK_COMMA);
  -						id1 = LT(1);
  -						match(Identifier);
  -						{
  -						
  -						if (list == null)
  -						{
  -						list = new ArrayList();
  -						list.add(first);
  -						}
  -						list.add(id1.getText());
  -						
  -						}
  -					}
  -					else {
  -						break _loop80;
  -					}
  -					
  -				} while (true);
  -				}
  -			}
  -			else if ((LA(1)==TOK_STAR)) {
  -				match(TOK_STAR);
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			
  -			if (list == null)
  -			{
  -			projectionAttrs = new String[] {first};
  -			}
  -			else
  -			{
  -			projectionAttrs = (String[]) list.toArray(new String[list.size()]);
  -			}
  -			
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_5);
  -		}
  -		return projectionAttrs;
  -	}
  -	
  -	public final Class  fromClause() throws RecognitionException, TokenStreamException {
  -		Class clazz = null;
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			id = LT(1);
  -			match(Identifier);
  -			
  -			try {
  -			clazz = Class.forName(id.getText(), true,
  -							Thread.currentThread().getContextClassLoader());
  -			} catch (Exception e) {
  -			}
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_6);
  -		}
  -		return clazz;
  -	}
  -	
  -	public final void whereClause(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			orExpr(criteria);
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void orderClause(
  -		QueryByCriteria query
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			sortCriterion(query);
  -			{
  -			_loop83:
  -			do {
  -				if ((LA(1)==TOK_COMMA)) {
  -					match(TOK_COMMA);
  -					sortCriterion(query);
  -				}
  -				else {
  -					break _loop83;
  -				}
  -				
  -			} while (true);
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_2);
  -		}
  -	}
  -	
  -	public final void groupClause(
  -		QueryByCriteria query
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			groupCriterion(query);
  -			{
  -			_loop89:
  -			do {
  -				if ((LA(1)==TOK_COMMA)) {
  -					match(TOK_COMMA);
  -					groupCriterion(query);
  -				}
  -				else {
  -					break _loop89;
  -				}
  -				
  -			} while (true);
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_3);
  -		}
  -	}
  -	
  -	public final void prefetchClause(
  -		QueryByCriteria query
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			prefetchCriterion(query);
  -			{
  -			_loop93:
  -			do {
  -				if ((LA(1)==TOK_COMMA)) {
  -					match(TOK_COMMA);
  -					prefetchCriterion(query);
  -				}
  -				else {
  -					break _loop93;
  -				}
  -				
  -			} while (true);
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_4);
  -		}
  -	}
  -	
  -	public final Query  existsQuery() throws RecognitionException, TokenStreamException {
  -		Query query = null;
  -		
  -		
  -		try {      // for error handling
  -			
  -			Class clazz = null;
  -			Criteria criteria = new Criteria();
  -			
  -			match(LITERAL_exists);
  -			projectionAttributes();
  -			match(LITERAL_in);
  -			clazz=fromClause();
  -			{
  -			if ((LA(1)==TOK_COLON)) {
  -				match(TOK_COLON);
  -				whereClause(criteria);
  -			}
  -			else if ((_tokenSet_7.member(LA(1)))) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			
  -			if (clazz != null) {
  -			query = QueryFactory.newQuery(clazz, criteria);
  -			}
  -					
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -		return query;
  -	}
  -	
  -	public final void orExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			andExpr(criteria);
  -			{
  -			_loop97:
  -			do {
  -				if ((LA(1)==LITERAL_or) && (_tokenSet_8.member(LA(2))) && (_tokenSet_9.member(LA(3)))) {
  -					match(LITERAL_or);
  -					Criteria orCriteria = new Criteria();
  -					andExpr(orCriteria);
  -					criteria.addOrCriteria(orCriteria);
  -				}
  -				else {
  -					break _loop97;
  -				}
  -				
  -			} while (true);
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void sortCriterion(
  -		QueryByCriteria query
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			boolean descending = false;
  -			id = LT(1);
  -			match(Identifier);
  -			{
  -			if ((LA(1)==LITERAL_asc||LA(1)==LITERAL_desc)) {
  -				{
  -				if ((LA(1)==LITERAL_asc)) {
  -					match(LITERAL_asc);
  -					descending = false;
  -				}
  -				else if ((LA(1)==LITERAL_desc)) {
  -					match(LITERAL_desc);
  -					descending = true;
  -				}
  -				else {
  -					throw new NoViableAltException(LT(1), getFilename());
  -				}
  -				
  -				}
  -			}
  -			else if ((_tokenSet_10.member(LA(1)))) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			
  -			if (descending) {
  -			query.addOrderByDescending(id.getText());
  -			} else {
  -			query.addOrderByAscending(id.getText());
  -			}
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_10);
  -		}
  -	}
  -	
  -	public final void groupCriterion(
  -		QueryByCriteria query
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			id = LT(1);
  -			match(Identifier);
  -			
  -			query.addGroupBy(id.getText());
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_11);
  -		}
  -	}
  -	
  -	public final void prefetchCriterion(
  -		QueryByCriteria query
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			id = LT(1);
  -			match(Identifier);
  -			
  -			query.addPrefetchedRelationship(id.getText());
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_12);
  -		}
  -	}
  -	
  -	public final void andExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			quantifierExpr(criteria);
  -			{
  -			_loop100:
  -			do {
  -				if ((LA(1)==LITERAL_and) && (_tokenSet_8.member(LA(2))) && (_tokenSet_9.member(LA(3)))) {
  -					match(LITERAL_and);
  -					Criteria andCriteria = new Criteria();
  -					quantifierExpr(andCriteria);
  -					criteria.addAndCriteria(andCriteria);
  -				}
  -				else {
  -					break _loop100;
  -				}
  -				
  -			} while (true);
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void quantifierExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			switch ( LA(1)) {
  -			case TOK_LPAREN:
  -			{
  -				match(TOK_LPAREN);
  -				orExpr(criteria);
  -				match(TOK_RPAREN);
  -				break;
  -			}
  -			case LITERAL_is_undefined:
  -			case LITERAL_is_defined:
  -			{
  -				undefinedExpr(criteria);
  -				break;
  -			}
  -			case LITERAL_exists:
  -			case LITERAL_not:
  -			{
  -				existsExpr(criteria);
  -				break;
  -			}
  -			default:
  -				if ((LA(1)==Identifier) && (_tokenSet_13.member(LA(2)))) {
  -					equalityExpr(criteria);
  -				}
  -				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_not||LA(2)==LITERAL_like) && (_tokenSet_14.member(LA(3)))) {
  -					likeExpr(criteria);
  -				}
  -				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_not||LA(2)==LITERAL_between) && (_tokenSet_15.member(LA(3)))) {
  -					betweenExpr(criteria);
  -				}
  -				else if ((LA(1)==Identifier) && (LA(2)==LITERAL_in||LA(2)==LITERAL_not) && (LA(3)==TOK_LPAREN||LA(3)==LITERAL_in||LA(3)==LITERAL_list)) {
  -					inExpr(criteria);
  -				}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void equalityExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			
  -				Object value = null;
  -			
  -			id = LT(1);
  -			match(Identifier);
  -			{
  -			{
  -			switch ( LA(1)) {
  -			case TOK_EQ:
  -			{
  -				match(TOK_EQ);
  -				{
  -				if ((LA(1)==LITERAL_nil)) {
  -					match(LITERAL_nil);
  -					criteria.addIsNull(id.getText());
  -				}
  -				else if ((_tokenSet_16.member(LA(1)))) {
  -					value=literal();
  -					criteria.addEqualTo(id.getText(), value);
  -				}
  -				else {
  -					throw new NoViableAltException(LT(1), getFilename());
  -				}
  -				
  -				}
  -				break;
  -			}
  -			case TOK_NE:
  -			{
  -				match(TOK_NE);
  -				{
  -				if ((LA(1)==LITERAL_nil)) {
  -					match(LITERAL_nil);
  -					criteria.addNotNull(id.getText());
  -				}
  -				else if ((_tokenSet_16.member(LA(1)))) {
  -					value=literal();
  -					criteria.addNotEqualTo(id.getText(), value);
  -				}
  -				else {
  -					throw new NoViableAltException(LT(1), getFilename());
  -				}
  -				
  -				}
  -				break;
  -			}
  -			case TOK_NE2:
  -			{
  -				match(TOK_NE2);
  -				{
  -				if ((LA(1)==LITERAL_nil)) {
  -					match(LITERAL_nil);
  -					criteria.addNotNull(id.getText());
  -				}
  -				else if ((_tokenSet_16.member(LA(1)))) {
  -					value=literal();
  -					criteria.addNotEqualTo(id.getText(), value);
  -				}
  -				else {
  -					throw new NoViableAltException(LT(1), getFilename());
  -				}
  -				
  -				}
  -				break;
  -			}
  -			case TOK_LT:
  -			{
  -				match(TOK_LT);
  -				value=literal();
  -				criteria.addLessThan(id.getText(), value);
  -				break;
  -			}
  -			case TOK_GT:
  -			{
  -				match(TOK_GT);
  -				value=literal();
  -				criteria.addGreaterThan(id.getText(), value);
  -				break;
  -			}
  -			case TOK_LE:
  -			{
  -				match(TOK_LE);
  -				value=literal();
  -				criteria.addLessOrEqualThan(id.getText(), value);
  -				break;
  -			}
  -			case TOK_GE:
  -			{
  -				match(TOK_GE);
  -				value=literal();
  -				criteria.addGreaterOrEqualThan(id.getText(), value);
  -				break;
  -			}
  -			default:
  -			{
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			}
  -			}
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void likeExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			
  -			boolean negative = false;
  -			Object value = null;
  -			
  -			id = LT(1);
  -			match(Identifier);
  -			{
  -			if ((LA(1)==LITERAL_not)) {
  -				match(LITERAL_not);
  -				negative = true;
  -			}
  -			else if ((LA(1)==LITERAL_like)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			match(LITERAL_like);
  -			value=literal();
  -			
  -			if (negative) {
  -			criteria.addNotLike(id.getText(), value);
  -			} else {
  -			criteria.addLike(id.getText(), value);
  -			}
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void undefinedExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			boolean negative = false;
  -			{
  -			if ((LA(1)==LITERAL_is_undefined)) {
  -				match(LITERAL_is_undefined);
  -				negative = false;
  -			}
  -			else if ((LA(1)==LITERAL_is_defined)) {
  -				match(LITERAL_is_defined);
  -				negative = true;
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			match(TOK_LPAREN);
  -			id = LT(1);
  -			match(Identifier);
  -			match(TOK_RPAREN);
  -			
  -			if (negative) {
  -			criteria.addNotNull(id.getText());
  -			} else {
  -			criteria.addIsNull(id.getText());
  -			}
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void betweenExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			
  -			boolean negative = false;
  -			Object lower = null;
  -			Object upper = null;
  -			
  -			id = LT(1);
  -			match(Identifier);
  -			{
  -			if ((LA(1)==LITERAL_not)) {
  -				match(LITERAL_not);
  -				negative = true;
  -			}
  -			else if ((LA(1)==LITERAL_between)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			match(LITERAL_between);
  -			lower=literal();
  -			match(LITERAL_and);
  -			upper=literal();
  -			
  -			if (negative) {
  -			criteria.addNotBetween(id.getText(), lower, upper);
  -			} else {
  -			criteria.addBetween(id.getText(), lower, upper);
  -			}
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void inExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		Token  id = null;
  -		
  -		try {      // for error handling
  -			
  -				 boolean negative = false;
  -				 Collection coll;
  -			
  -			id = LT(1);
  -			match(Identifier);
  -			{
  -			if ((LA(1)==LITERAL_not)) {
  -				match(LITERAL_not);
  -				negative = true;
  -			}
  -			else if ((LA(1)==LITERAL_in)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			match(LITERAL_in);
  -			{
  -			if ((LA(1)==LITERAL_list)) {
  -				match(LITERAL_list);
  -			}
  -			else if ((LA(1)==TOK_LPAREN)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			coll=argList();
  -			
  -			if (negative) {
  -			criteria.addNotIn(id.getText(), coll);
  -			} else {
  -			criteria.addIn(id.getText(), coll);
  -			}
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final void existsExpr(
  -		Criteria criteria
  -	) throws RecognitionException, TokenStreamException {
  -		
  -		
  -		try {      // for error handling
  -			
  -			Query subQuery = null;
  -			boolean negative = false;
  -			
  -			{
  -			if ((LA(1)==LITERAL_not)) {
  -				match(LITERAL_not);
  -				negative = true;
  -			}
  -			else if ((LA(1)==LITERAL_exists)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			{
  -			if ((LA(1)==LITERAL_exists) && (LA(2)==TOK_LPAREN)) {
  -				match(LITERAL_exists);
  -				match(TOK_LPAREN);
  -				subQuery=selectQuery();
  -				match(TOK_RPAREN);
  -			}
  -			else if ((LA(1)==LITERAL_exists) && (LA(2)==TOK_STAR||LA(2)==Identifier)) {
  -				subQuery=existsQuery();
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			
  -			if (negative) {
  -			criteria.addNotExists(subQuery);
  -			} else {
  -			criteria.addExists(subQuery);
  -			}
  -			
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -	}
  -	
  -	public final Object  literal() throws RecognitionException, TokenStreamException {
  -		Object value = null;
  -		
  -		Token  tokInt = null;
  -		Token  tokADbl = null;
  -		Token  tokEDbl = null;
  -		Token  tokChar = null;
  -		Token  tokStr = null;
  -		Token  tokDate = null;
  -		Token  tokTime = null;
  -		Token  tokTs = null;
  -		
  -		try {      // for error handling
  -			switch ( LA(1)) {
  -			case TOK_DOLLAR:
  -			{
  -				match(TOK_DOLLAR);
  -				match(TOK_UNSIGNED_INTEGER);
  -				value = null;
  -				break;
  -			}
  -			case LITERAL_true:
  -			{
  -				match(LITERAL_true);
  -				value = Boolean.TRUE;
  -				break;
  -			}
  -			case LITERAL_false:
  -			{
  -				match(LITERAL_false);
  -				value = Boolean.FALSE;
  -				break;
  -			}
  -			case TOK_UNSIGNED_INTEGER:
  -			{
  -				tokInt = LT(1);
  -				match(TOK_UNSIGNED_INTEGER);
  -				
  -					try
  -					{
  -						value = Integer.valueOf(tokInt.getText());
  -					}
  -					catch (NumberFormatException ignored)
  -					{
  -						value = Long.valueOf(tokInt.getText());
  -					}
  -				
  -				break;
  -			}
  -			case TOK_APPROXIMATE_NUMERIC_LITERAL:
  -			{
  -				tokADbl = LT(1);
  -				match(TOK_APPROXIMATE_NUMERIC_LITERAL);
  -				value = Double.valueOf(tokADbl.getText());
  -				break;
  -			}
  -			case TOK_EXACT_NUMERIC_LITERAL:
  -			{
  -				tokEDbl = LT(1);
  -				match(TOK_EXACT_NUMERIC_LITERAL);
  -				value = Double.valueOf(tokEDbl.getText());
  -				break;
  -			}
  -			case CharLiteral:
  -			{
  -				tokChar = LT(1);
  -				match(CharLiteral);
  -				value = new Character(tokChar.getText().charAt(0));
  -				break;
  -			}
  -			case StringLiteral:
  -			{
  -				tokStr = LT(1);
  -				match(StringLiteral);
  -				value = tokStr.getText();
  -				break;
  -			}
  -			case LITERAL_date:
  -			{
  -				match(LITERAL_date);
  -				tokDate = LT(1);
  -				match(StringLiteral);
  -				value = java.sql.Date.valueOf(tokDate.getText());
  -				break;
  -			}
  -			case LITERAL_time:
  -			{
  -				match(LITERAL_time);
  -				tokTime = LT(1);
  -				match(StringLiteral);
  -				value = java.sql.Time.valueOf(tokTime.getText());
  -				break;
  -			}
  -			case LITERAL_timestamp:
  -			{
  -				match(LITERAL_timestamp);
  -				tokTs = LT(1);
  -				match(StringLiteral);
  -				value = java.sql.Timestamp.valueOf(tokTs.getText());
  -				break;
  -			}
  -			default:
  -			{
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			}
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_17);
  -		}
  -		return value;
  -	}
  -	
  -	public final Collection  argList() throws RecognitionException, TokenStreamException {
  -		Collection coll = null;
  -		
  -		
  -		try {      // for error handling
  -			
  -					Collection temp = new Vector();
  -				    Object val;
  -				
  -			match(TOK_LPAREN);
  -			{
  -			if ((_tokenSet_16.member(LA(1)))) {
  -				val=literal();
  -				if (val != null) {temp.add(val);}
  -				{
  -				_loop124:
  -				do {
  -					if ((LA(1)==TOK_COMMA)) {
  -						match(TOK_COMMA);
  -						val=literal();
  -						if (val != null) {temp.add(val);}
  -					}
  -					else {
  -						break _loop124;
  -					}
  -					
  -				} while (true);
  -				}
  -			}
  -			else if ((LA(1)==TOK_RPAREN)) {
  -			}
  -			else {
  -				throw new NoViableAltException(LT(1), getFilename());
  -			}
  -			
  -			}
  -			match(TOK_RPAREN);
  -			
  -					if (!temp.isEmpty()) {coll = temp;}
  -					
  -		}
  -		catch (RecognitionException ex) {
  -			reportError(ex);
  -			consume();
  -			consumeUntil(_tokenSet_7);
  -		}
  -		return coll;
  -	}
  -	
  -	
  -	public static final String[] _tokenNames = {
  -		"<0>",
  -		"EOF",
  -		"<2>",
  -		"NULL_TREE_LOOKAHEAD",
  -		"right parenthesis",
  -		"left parenthesis",
  -		"comma",
  -		"semicolon",
  -		"TOK_COLON",
  -		"dot",
  -		"dot",
  -		"operator",
  -		"comparison operator",
  -		"operator",
  -		"operator",
  -		"operator",
  -		"operator",
  -		"comparison operator",
  -		"comparison operator",
  -		"comparison operator",
  -		"comparison operator",
  -		"comparison operator",
  -		"comparison operator",
  -		"left bracket",
  -		"right bracket",
  -		"TOK_DOLLAR",
  -		"NameFirstCharacter",
  -		"NameCharacter",
  -		"Identifier",
  -		"TOK_UNSIGNED_INTEGER",
  -		"TOK_APPROXIMATE_NUMERIC_LITERAL",
  -		"numeric value",
  -		"character string",
  -		"character string",
  -		"WhiteSpace",
  -		"NewLine",
  -		"CommentLine",
  -		"MultiLineComment",
  -		"\"select\"",
  -		"\"distinct\"",
  -		"\"from\"",
  -		"\"where\"",
  -		"\"order\"",
  -		"\"by\"",
  -		"\"group\"",
  -		"\"prefetch\"",
  -		"\"exists\"",
  -		"\"in\"",
  -		"\"asc\"",
  -		"\"desc\"",
  -		"\"or\"",
  -		"\"and\"",
  -		"\"nil\"",
  -		"\"not\"",
  -		"\"list\"",
  -		"\"between\"",
  -		"\"is_undefined\"",
  -		"\"is_defined\"",
  -		"\"like\"",
  -		"\"true\"",
  -		"\"false\"",
  -		"\"date\"",
  -		"\"time\"",
  -		"\"timestamp\""
  -	};
  -	
  -	private static final long _tokenSet_0_data_[] = { 2L, 0L };
  -	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
  -	private static final long _tokenSet_1_data_[] = { 57174604644498L, 0L };
  -	public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
  -	private static final long _tokenSet_2_data_[] = { 52776558133394L, 0L };
  -	public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
  -	private static final long _tokenSet_3_data_[] = { 35184372088978L, 0L };
  -	public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_);
  -	private static final long _tokenSet_4_data_[] = { 146L, 0L };
  -	public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_);
  -	private static final long _tokenSet_5_data_[] = { 141836999983104L, 0L };
  -	public static final BitSet _tokenSet_5 = new BitSet(_tokenSet_5_data_);
  -	private static final long _tokenSet_6_data_[] = { 3437073348428178L, 0L };
  -	public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_);
  -	private static final long _tokenSet_7_data_[] = { 3434874325172370L, 0L };
  -	public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
  -	private static final long _tokenSet_8_data_[] = { 225250350381137952L, 0L };
  -	public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_);
  -	private static final long _tokenSet_9_data_[] = { 549650261048496160L, 0L };
  -	public static final BitSet _tokenSet_9 = new BitSet(_tokenSet_9_data_);
  -	private static final long _tokenSet_10_data_[] = { 52776558133458L, 0L };
  -	public static final BitSet _tokenSet_10 = new BitSet(_tokenSet_10_data_);
  -	private static final long _tokenSet_11_data_[] = { 35184372089042L, 0L };
  -	public static final BitSet _tokenSet_11 = new BitSet(_tokenSet_11_data_);
  -	private static final long _tokenSet_12_data_[] = { 210L, 0L };
  -	public static final BitSet _tokenSet_12 = new BitSet(_tokenSet_12_data_);
  -	private static final long _tokenSet_13_data_[] = { 8261632L, 0L };
  -	public static final BitSet _tokenSet_13 = new BitSet(_tokenSet_13_data_);
  -	private static final long _tokenSet_14_data_[] = { -288230359475159040L, 0L };
  -	public static final BitSet _tokenSet_14 = new BitSet(_tokenSet_14_data_);
  -	private static final long _tokenSet_15_data_[] = { -540431938607906816L, 0L };
  -	public static final BitSet _tokenSet_15 = new BitSet(_tokenSet_15_data_);
  -	private static final long _tokenSet_16_data_[] = { -576460735626870784L, 0L };
  -	public static final BitSet _tokenSet_16 = new BitSet(_tokenSet_16_data_);
  -	private static final long _tokenSet_17_data_[] = { 3434874325172434L, 0L };
  -	public static final BitSet _tokenSet_17 = new BitSet(_tokenSet_17_data_);
  -	
  -	}
  +        try
  +        {      // for error handling
  +            id = LT(1);
  +            match(Identifier);
  +
  +            query.addGroupBy(id.getText());
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_11);
  +        }
  +    }
  +
  +    public final void prefetchCriterion(
  +            QueryByCriteria query
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +            id = LT(1);
  +            match(Identifier);
  +
  +            query.addPrefetchedRelationship(id.getText());
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_12);
  +        }
  +    }
  +
  +    public final void andExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +            quantifierExpr(criteria);
  +            {
  +                _loop100:
  +                do
  +                {
  +                    if ((LA(1) == LITERAL_and) && (_tokenSet_8.member(LA(2))) && (_tokenSet_9.member(LA(3))))
  +                    {
  +                        match(LITERAL_and);
  +                        Criteria andCriteria = new Criteria();
  +                        quantifierExpr(andCriteria);
  +                        criteria.addAndCriteria(andCriteria);
  +                    }
  +                    else
  +                    {
  +                        break _loop100;
  +                    }
  +
  +                }
  +                while (true);
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void quantifierExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +            switch (LA(1))
  +            {
  +                case TOK_LPAREN:
  +                    {
  +                        match(TOK_LPAREN);
  +                        orExpr(criteria);
  +                        match(TOK_RPAREN);
  +                        break;
  +                    }
  +                case LITERAL_is_undefined:
  +                case LITERAL_is_defined:
  +                    {
  +                        undefinedExpr(criteria);
  +                        break;
  +                    }
  +                case LITERAL_exists:
  +                case LITERAL_not:
  +                    {
  +                        existsExpr(criteria);
  +                        break;
  +                    }
  +                default:
  +                    if ((LA(1) == Identifier) && (_tokenSet_13.member(LA(2))))
  +                    {
  +                        equalityExpr(criteria);
  +                    }
  +                    else if ((LA(1) == Identifier) && (LA(2) == LITERAL_not || LA(2) == LITERAL_like) && (_tokenSet_14.member(LA(3))))
  +                    {
  +                        likeExpr(criteria);
  +                    }
  +                    else if ((LA(1) == Identifier) && (LA(2) == LITERAL_not || LA(2) == LITERAL_between) && (_tokenSet_15.member(LA(3))))
  +                    {
  +                        betweenExpr(criteria);
  +                    }
  +                    else if ((LA(1) == Identifier) && (LA(2) == LITERAL_in || LA(2) == LITERAL_not) && (LA(3) == TOK_LPAREN || LA(3) == LITERAL_in || LA(3) == LITERAL_list))
  +                    {
  +                        inExpr(criteria);
  +                    }
  +                    else
  +                    {
  +                        throw new NoViableAltException(LT(1), getFilename());
  +                    }
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void equalityExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +
  +            Object value = null;
  +
  +            id = LT(1);
  +            match(Identifier);
  +            {
  +                {
  +                    switch (LA(1))
  +                    {
  +                        case TOK_EQ:
  +                            {
  +                                match(TOK_EQ);
  +                                {
  +                                    if ((LA(1) == LITERAL_nil))
  +                                    {
  +                                        match(LITERAL_nil);
  +                                        criteria.addIsNull(id.getText());
  +                                    }
  +                                    else if ((_tokenSet_16.member(LA(1))))
  +                                    {
  +                                        value = literal();
  +                                        criteria.addEqualTo(id.getText(), value);
  +                                    }
  +                                    else
  +                                    {
  +                                        throw new NoViableAltException(LT(1), getFilename());
  +                                    }
  +
  +                                }
  +                                break;
  +                            }
  +                        case TOK_NE:
  +                            {
  +                                match(TOK_NE);
  +                                {
  +                                    if ((LA(1) == LITERAL_nil))
  +                                    {
  +                                        match(LITERAL_nil);
  +                                        criteria.addNotNull(id.getText());
  +                                    }
  +                                    else if ((_tokenSet_16.member(LA(1))))
  +                                    {
  +                                        value = literal();
  +                                        criteria.addNotEqualTo(id.getText(), value);
  +                                    }
  +                                    else
  +                                    {
  +                                        throw new NoViableAltException(LT(1), getFilename());
  +                                    }
  +
  +                                }
  +                                break;
  +                            }
  +                        case TOK_NE2:
  +                            {
  +                                match(TOK_NE2);
  +                                {
  +                                    if ((LA(1) == LITERAL_nil))
  +                                    {
  +                                        match(LITERAL_nil);
  +                                        criteria.addNotNull(id.getText());
  +                                    }
  +                                    else if ((_tokenSet_16.member(LA(1))))
  +                                    {
  +                                        value = literal();
  +                                        criteria.addNotEqualTo(id.getText(), value);
  +                                    }
  +                                    else
  +                                    {
  +                                        throw new NoViableAltException(LT(1), getFilename());
  +                                    }
  +
  +                                }
  +                                break;
  +                            }
  +                        case TOK_LT:
  +                            {
  +                                match(TOK_LT);
  +                                value = literal();
  +                                criteria.addLessThan(id.getText(), value);
  +                                break;
  +                            }
  +                        case TOK_GT:
  +                            {
  +                                match(TOK_GT);
  +                                value = literal();
  +                                criteria.addGreaterThan(id.getText(), value);
  +                                break;
  +                            }
  +                        case TOK_LE:
  +                            {
  +                                match(TOK_LE);
  +                                value = literal();
  +                                criteria.addLessOrEqualThan(id.getText(), value);
  +                                break;
  +                            }
  +                        case TOK_GE:
  +                            {
  +                                match(TOK_GE);
  +                                value = literal();
  +                                criteria.addGreaterOrEqualThan(id.getText(), value);
  +                                break;
  +                            }
  +                        default:
  +                            {
  +                                throw new NoViableAltException(LT(1), getFilename());
  +                            }
  +                    }
  +                }
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void likeExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +
  +            boolean negative = false;
  +            Object value = null;
  +
  +            id = LT(1);
  +            match(Identifier);
  +            {
  +                if ((LA(1) == LITERAL_not))
  +                {
  +                    match(LITERAL_not);
  +                    negative = true;
  +                }
  +                else if ((LA(1) == LITERAL_like))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            match(LITERAL_like);
  +            value = literal();
  +
  +            if (negative)
  +            {
  +                criteria.addNotLike(id.getText(), value);
  +            }
  +            else
  +            {
  +                criteria.addLike(id.getText(), value);
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void undefinedExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +            boolean negative = false;
  +            {
  +                if ((LA(1) == LITERAL_is_undefined))
  +                {
  +                    match(LITERAL_is_undefined);
  +                    negative = false;
  +                }
  +                else if ((LA(1) == LITERAL_is_defined))
  +                {
  +                    match(LITERAL_is_defined);
  +                    negative = true;
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            match(TOK_LPAREN);
  +            id = LT(1);
  +            match(Identifier);
  +            match(TOK_RPAREN);
  +
  +            if (negative)
  +            {
  +                criteria.addNotNull(id.getText());
  +            }
  +            else
  +            {
  +                criteria.addIsNull(id.getText());
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void betweenExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +
  +            boolean negative = false;
  +            Object lower = null;
  +            Object upper = null;
  +
  +            id = LT(1);
  +            match(Identifier);
  +            {
  +                if ((LA(1) == LITERAL_not))
  +                {
  +                    match(LITERAL_not);
  +                    negative = true;
  +                }
  +                else if ((LA(1) == LITERAL_between))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            match(LITERAL_between);
  +            lower = literal();
  +            match(LITERAL_and);
  +            upper = literal();
  +
  +            if (negative)
  +            {
  +                criteria.addNotBetween(id.getText(), lower, upper);
  +            }
  +            else
  +            {
  +                criteria.addBetween(id.getText(), lower, upper);
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void inExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +        Token id = null;
  +
  +        try
  +        {      // for error handling
  +
  +            boolean negative = false;
  +            Collection coll;
  +
  +            id = LT(1);
  +            match(Identifier);
  +            {
  +                if ((LA(1) == LITERAL_not))
  +                {
  +                    match(LITERAL_not);
  +                    negative = true;
  +                }
  +                else if ((LA(1) == LITERAL_in))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            match(LITERAL_in);
  +            {
  +                if ((LA(1) == LITERAL_list))
  +                {
  +                    match(LITERAL_list);
  +                }
  +                else if ((LA(1) == TOK_LPAREN))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            coll = argList();
  +
  +            if (negative)
  +            {
  +                criteria.addNotIn(id.getText(), coll);
  +            }
  +            else
  +            {
  +                criteria.addIn(id.getText(), coll);
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final void existsExpr(
  +            Criteria criteria
  +            ) throws RecognitionException, TokenStreamException
  +    {
  +
  +
  +        try
  +        {      // for error handling
  +
  +            Query subQuery = null;
  +            boolean negative = false;
  +
  +            {
  +                if ((LA(1) == LITERAL_not))
  +                {
  +                    match(LITERAL_not);
  +                    negative = true;
  +                }
  +                else if ((LA(1) == LITERAL_exists))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            {
  +                if ((LA(1) == LITERAL_exists) && (LA(2) == TOK_LPAREN))
  +                {
  +                    match(LITERAL_exists);
  +                    match(TOK_LPAREN);
  +                    subQuery = selectQuery();
  +                    match(TOK_RPAREN);
  +                }
  +                else if ((LA(1) == LITERAL_exists) && (LA(2) == TOK_STAR || LA(2) == Identifier))
  +                {
  +                    subQuery = existsQuery();
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +
  +            if (negative)
  +            {
  +                criteria.addNotExists(subQuery);
  +            }
  +            else
  +            {
  +                criteria.addExists(subQuery);
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +    }
  +
  +    public final Object literal() throws RecognitionException, TokenStreamException
  +    {
  +        Object value = null;
  +
  +        Token tokInt = null;
  +        Token tokADbl = null;
  +        Token tokEDbl = null;
  +        Token tokChar = null;
  +        Token tokStr = null;
  +        Token tokDate = null;
  +        Token tokTime = null;
  +        Token tokTs = null;
  +
  +        try
  +        {      // for error handling
  +            switch (LA(1))
  +            {
  +                case TOK_DOLLAR:
  +                    {
  +                        match(TOK_DOLLAR);
  +                        match(TOK_UNSIGNED_INTEGER);
  +                        value = null;
  +                        break;
  +                    }
  +                case LITERAL_true:
  +                    {
  +                        match(LITERAL_true);
  +                        value = Boolean.TRUE;
  +                        break;
  +                    }
  +                case LITERAL_false:
  +                    {
  +                        match(LITERAL_false);
  +                        value = Boolean.FALSE;
  +                        break;
  +                    }
  +                case TOK_UNSIGNED_INTEGER:
  +                    {
  +                        tokInt = LT(1);
  +                        match(TOK_UNSIGNED_INTEGER);
  +
  +                        try
  +                        {
  +                            value = Integer.valueOf(tokInt.getText());
  +                        }
  +                        catch (NumberFormatException ignored)
  +                        {
  +                            value = Long.valueOf(tokInt.getText());
  +                        }
  +
  +                        break;
  +                    }
  +                case TOK_APPROXIMATE_NUMERIC_LITERAL:
  +                    {
  +                        tokADbl = LT(1);
  +                        match(TOK_APPROXIMATE_NUMERIC_LITERAL);
  +                        value = Double.valueOf(tokADbl.getText());
  +                        break;
  +                    }
  +                case TOK_EXACT_NUMERIC_LITERAL:
  +                    {
  +                        tokEDbl = LT(1);
  +                        match(TOK_EXACT_NUMERIC_LITERAL);
  +                        value = Double.valueOf(tokEDbl.getText());
  +                        break;
  +                    }
  +                case CharLiteral:
  +                    {
  +                        tokChar = LT(1);
  +                        match(CharLiteral);
  +                        value = new Character(tokChar.getText().charAt(0));
  +                        break;
  +                    }
  +                case StringLiteral:
  +                    {
  +                        tokStr = LT(1);
  +                        match(StringLiteral);
  +                        value = tokStr.getText();
  +                        break;
  +                    }
  +                case LITERAL_date:
  +                    {
  +                        match(LITERAL_date);
  +                        tokDate = LT(1);
  +                        match(StringLiteral);
  +                        value = java.sql.Date.valueOf(tokDate.getText());
  +                        break;
  +                    }
  +                case LITERAL_time:
  +                    {
  +                        match(LITERAL_time);
  +                        tokTime = LT(1);
  +                        match(StringLiteral);
  +                        value = java.sql.Time.valueOf(tokTime.getText());
  +                        break;
  +                    }
  +                case LITERAL_timestamp:
  +                    {
  +                        match(LITERAL_timestamp);
  +                        tokTs = LT(1);
  +                        match(StringLiteral);
  +                        value = java.sql.Timestamp.valueOf(tokTs.getText());
  +                        break;
  +                    }
  +                default:
  +                    {
  +                        throw new NoViableAltException(LT(1), getFilename());
  +                    }
  +            }
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_17);
  +        }
  +        return value;
  +    }
  +
  +    public final Collection argList() throws RecognitionException, TokenStreamException
  +    {
  +        Collection coll = null;
  +
  +
  +        try
  +        {      // for error handling
  +
  +            Collection temp = new Vector();
  +            Object val;
  +
  +            match(TOK_LPAREN);
  +            {
  +                if ((_tokenSet_16.member(LA(1))))
  +                {
  +                    val = literal();
  +                    if (val != null)
  +                    {
  +                        temp.add(val);
  +                    }
  +                    {
  +                        _loop124:
  +                        do
  +                        {
  +                            if ((LA(1) == TOK_COMMA))
  +                            {
  +                                match(TOK_COMMA);
  +                                val = literal();
  +                                if (val != null)
  +                                {
  +                                    temp.add(val);
  +                                }
  +                            }
  +                            else
  +                            {
  +                                break _loop124;
  +                            }
  +
  +                        }
  +                        while (true);
  +                    }
  +                }
  +                else if ((LA(1) == TOK_RPAREN))
  +                {
  +                }
  +                else
  +                {
  +                    throw new NoViableAltException(LT(1), getFilename());
  +                }
  +
  +            }
  +            match(TOK_RPAREN);
  +
  +            if (!temp.isEmpty())
  +            {
  +                coll = temp;
  +            }
  +
  +        }
  +        catch (RecognitionException ex)
  +        {
  +            reportError(ex);
  +            consume();
  +            consumeUntil(_tokenSet_7);
  +        }
  +        return coll;
  +    }
  +
  +
  +    public static final String[] _tokenNames = {
  +        "<0>",
  +        "EOF",
  +        "<2>",
  +        "NULL_TREE_LOOKAHEAD",
  +        "right parenthesis",
  +        "left parenthesis",
  +        "comma",
  +        "semicolon",
  +        "TOK_COLON",
  +        "dot",
  +        "dot",
  +        "operator",
  +        "comparison operator",
  +        "operator",
  +        "operator",
  +        "operator",
  +        "operator",
  +        "comparison operator",
  +        "comparison operator",
  +        "comparison operator",
  +        "comparison operator",
  +        "comparison operator",
  +        "comparison operator",
  +        "left bracket",
  +        "right bracket",
  +        "TOK_DOLLAR",
  +        "NameFirstCharacter",
  +        "NameCharacter",
  +        "Identifier",
  +        "TOK_UNSIGNED_INTEGER",
  +        "TOK_APPROXIMATE_NUMERIC_LITERAL",
  +        "numeric value",
  +        "character string",
  +        "character string",
  +        "WhiteSpace",
  +        "NewLine",
  +        "CommentLine",
  +        "MultiLineComment",
  +        "\"select\"",
  +        "\"distinct\"",
  +        "\"from\"",
  +        "\"where\"",
  +        "\"order\"",
  +        "\"by\"",
  +        "\"group\"",
  +        "\"prefetch\"",
  +        "\"exists\"",
  +        "\"in\"",
  +        "\"asc\"",
  +        "\"desc\"",
  +        "\"or\"",
  +        "\"and\"",
  +        "\"nil\"",
  +        "\"not\"",
  +        "\"list\"",
  +        "\"between\"",
  +        "\"is_undefined\"",
  +        "\"is_defined\"",
  +        "\"like\"",
  +        "\"true\"",
  +        "\"false\"",
  +        "\"date\"",
  +        "\"time\"",
  +        "\"timestamp\""
  +    };
  +
  +    private static final long _tokenSet_0_data_[] = {2L, 0L};
  +    public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
  +    private static final long _tokenSet_1_data_[] = {57174604644498L, 0L};
  +    public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
  +    private static final long _tokenSet_2_data_[] = {52776558133394L, 0L};
  +    public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
  +    private static final long _tokenSet_3_data_[] = {35184372088978L, 0L};
  +    public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_);
  +    private static final long _tokenSet_4_data_[] = {146L, 0L};
  +    public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_);
  +    private static final long _tokenSet_5_data_[] = {141836999983104L, 0L};
  +    public static final BitSet _tokenSet_5 = new BitSet(_tokenSet_5_data_);
  +    private static final long _tokenSet_6_data_[] = {3437073348428178L, 0L};
  +    public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_);
  +    private static final long _tokenSet_7_data_[] = {3434874325172370L, 0L};
  +    public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
  +    private static final long _tokenSet_8_data_[] = {225250350381137952L, 0L};
  +    public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_);
  +    private static final long _tokenSet_9_data_[] = {549650261048496160L, 0L};
  +    public static final BitSet _tokenSet_9 = new BitSet(_tokenSet_9_data_);
  +    private static final long _tokenSet_10_data_[] = {52776558133458L, 0L};
  +    public static final BitSet _tokenSet_10 = new BitSet(_tokenSet_10_data_);
  +    private static final long _tokenSet_11_data_[] = {35184372089042L, 0L};
  +    public static final BitSet _tokenSet_11 = new BitSet(_tokenSet_11_data_);
  +    private static final long _tokenSet_12_data_[] = {210L, 0L};
  +    public static final BitSet _tokenSet_12 = new BitSet(_tokenSet_12_data_);
  +    private static final long _tokenSet_13_data_[] = {8261632L, 0L};
  +    public static final BitSet _tokenSet_13 = new BitSet(_tokenSet_13_data_);
  +    private static final long _tokenSet_14_data_[] = {-288230359475159040L, 0L};
  +    public static final BitSet _tokenSet_14 = new BitSet(_tokenSet_14_data_);
  +    private static final long _tokenSet_15_data_[] = {-540431938607906816L, 0L};
  +    public static final BitSet _tokenSet_15 = new BitSet(_tokenSet_15_data_);
  +    private static final long _tokenSet_16_data_[] = {-576460735626870784L, 0L};
  +    public static final BitSet _tokenSet_16 = new BitSet(_tokenSet_16_data_);
  +    private static final long _tokenSet_17_data_[] = {3434874325172434L, 0L};
  +    public static final BitSet _tokenSet_17 = new BitSet(_tokenSet_17_data_);
  +
  +}
  
  
  
  1.3       +1 -1      db-ojb/xdocs/howto-get-started.xml
  
  Index: howto-get-started.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/howto-get-started.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- howto-get-started.xml	22 Jun 2003 18:12:50 -0000	1.2
  +++ howto-get-started.xml	27 Nov 2003 13:08:25 -0000	1.3
  @@ -4,7 +4,7 @@
   
     <properties>
       <author email="brian@skife.org">Brian McCallister</author>
  -    <title>ObJectRelationalBridge - HOWTO Get Started</title>
  +    <title>ObJectRelationalBridge - Getting Started</title>
     </properties>
   
   <body>
  
  
  
  1.17      +4 -8      db-ojb/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/index.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- index.xml	18 May 2003 11:11:27 -0000	1.16
  +++ index.xml	27 Nov 2003 13:08:25 -0000	1.17
  @@ -22,8 +22,8 @@
     </p>
     <ul>
       <li>
  -      A full featured <b>ODMG 3.0</b> compliant API. (See <a href="tutorial2.html">
  -      tutorial2</a> for an introduction.)
  +      A full featured <b>ODMG 3.0</b> compliant API. (See the <a href="odmg-tutorial.html">
  +      ODMG Tutorial</a> for an introduction.)
       </li>
       <li>
         A <b>JDO</b> compliant API. We currently provide a plugin to the JDO 
  @@ -44,8 +44,8 @@
         top of this kernel.
         <br/>
         This API can also be used directly by applications that don't need full
  -      fledged object level transactions (see <a href="tutorial1.html">
  -      tutorial1</a> for details).
  +      fledged object level transactions (See the <a href="pb-tutorial.html">
  +      Persistence Broker Tutorial</a> for details).
       </li>
     </ul>
     
  @@ -108,9 +108,5 @@
     </subsection>
     
   </section>
  -
  -
  -
  -
   </body>
   </document>
  
  
  
  1.4       +3 -1      db-ojb/xdocs/odmg-tutorial.xml
  
  Index: odmg-tutorial.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/odmg-tutorial.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- odmg-tutorial.xml	10 Oct 2003 18:50:51 -0000	1.3
  +++ odmg-tutorial.xml	27 Nov 2003 13:08:25 -0000	1.4
  @@ -117,7 +117,9 @@
           tx.begin();
   
           OQLQuery query = impl.newOQLQuery();
  -        query.create("select products from " + Product.class.getName() + " where name = $1");
  +        query.create("select products from " 
  +                     + Product.class.getName() 
  +                     + " where name = $1");
           query.bind(name);
           DList results = (DList) query.execute();
           Product product = (Product) results.iterator().next();
  
  
  
  1.26      +6 -40     db-ojb/xdocs/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/project.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- project.xml	20 Jul 2003 20:43:25 -0000	1.25
  +++ project.xml	27 Nov 2003 13:08:25 -0000	1.26
  @@ -10,8 +10,6 @@
         <item name="News &amp; Status"       href="/status.html"/>
         <item name="Bug Database"            href="http://issues.apache.org/scarab/servlet/scarab/"/>
         <item name="Features"                href="/features.html"/>
  -      <item name="Quickstart"              href="/quickstart.html"/>
  -      <item name="FAQs"                    href="/faq.html"/>
         <item name="Mail lists"              href="/mail-lists.html"/>
         <item name="Mail archives"           href="/mail-archives.html"/>
         <item name="references"              href="/references.html"/>
  @@ -20,47 +18,15 @@
       <menu name="Downloads">
   		<item name="Binaries" href="http://db.apache.org/builds/ojb"/>
   		<item name="Source"   href="http://db.apache.org/builds/ojb"/>
  -		<!--item name="Binaries"    href="http://sourceforge.net/project/showfiles.php?group_id=13647"/-->
  -		<!--item name="Source"      href="http://sourceforge.net/project/showfiles.php?group_id=13647"/-->
   	</menu>
   
  -    <menu name="Tutorials">
  -   		<item name="PersistenceBroker API" href="/tutorial1.html"/>
  -   		<item name="OJB Queries"           href="/query.html"/>
  -   		<item name="ODMG API"              href="/tutorial2.html"/>
  -   		<item name="JDO API"               href="/tutorial4.html"/>
  -   		<item name="Advanced O/R"          href="/tutorial3.html"/>
  +    <menu name="Documentation">
  +        <item name="Getting Started" href="/getting-started.html"/>
  +        <item name="Using OJB" href="/user-docs.html"/>
  +        <item name="Howto's" href="/howto.html"/>
  +        <item name="Javadoc" href="/api/index.html"/>
  +        <item name="FAQs" href="/faq.html"/>
       </menu>
  -
  -    <menu name="User Documentation">
  -   		<item name="JDBC types"            href="/jdbc-types.html"/>
  -   		<item name="The repository.xml"    href="/repository.html"/>
  -   		<item name="Supported platforms"   href="/platforms.html"/>
  -   		<item name="Deployment"            href="/deployment.html"/>
  -   		<item name="OJB.properties"        href="/ojb-properties.html"/>
  -   		<item name="API Javadoc"           href="/api/index.html"/>
  -        <item name="learn more about..."   href="/links.html"/>
  -    </menu>
  -
  -    <menu name="How to ...">
  -   		<item name="get started"           href="/howto-get-started.html"/>
  -   		<item name="use DB Sequences"      href="/howto-use-db-sequences.html"/>
  -   		<item name="use Oracle lobs"       href="/howto-use-lobs.html"/>
  -		<item name="use Stored Procedures" href="/how-to-work-with-stored-procedures.html"/>
  -		<item name="use anonymous keys"    href="/howto-use-anonymous-keys.html"/>
  -		<item name="use OJB in clusters"   href="/howto-work-with-clustering.html"/>
  -		<item name="build the repository"  href="/howto-build-mappings.html"/>
  -    </menu>
  -
  -
  -    <menu name="System Documentation">
  -   		<item name="The Objectcache"       href="/objectcache.html"/>
  -   		<item name="The Sequence Manager"  href="/sequencemanager.html"/>
  -   		<item name="The Lockmanager"       href="/lockmanager.html"/>
  -   		<item name="Metadata Handling"     href="/metadata.html"/>
  -   		<item name="Performance"           href="/performance.html"/>
  -    </menu>
  -
   
       <menu name="Development">
         <item name="ToDo"                  href="/todo.html"/>
  
  
  
  1.1                  db-ojb/xdocs/getting-started.xml
  
  Index: getting-started.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- @version $Id: getting-started.xml,v 1.1 2003/11/27 13:08:25 brianm Exp $ -->
  <document>
  
    <properties>
      <author email="brian@skife.org">Brian McCallister</author>
      <title>ObJectRelationalBridge - Getting Started</title>
    </properties>
  
  <body>
  
  <section name="Getting Started with OJB">
  <subsection name="Introduction">
  	<p>
  		This document is designed to help you get started with OJB for the first
  		time. It is a cookbook type set of instructions designed to get you get
  		OJB installed, and able to work on the other various tutorials.
  	</p>
      <p>
    		This tutorial will:
  		<ol>
  			<li>Install OJB</li>
  			<li>Set up a database to test against</li>
  			<li>Set up a basic project using OJB</li>
  			<li>Configure a PostgreSQL database for use with OJB</li>
  		</ol>
  	</p>
  	<p>
  		This tutorial presumes you are comfortable configuring your relational
  		database of choice, including adding databases and users, and
  		configuring access controls at the database level (ie, you can create a
  		database and user and give the user permission to access and change the
  		database over a JDBC connection).
  	</p>
  </subsection>
  <subsection name="Setting Up the Database">
      <p>
          The easiest way to get started is just to use the included HSQLDB 
          embedded database. As people usually have a different database in mind
          this section will describe setting up a PostgreSQL database.
      </p>
  	<p>
  		Getting started, it is convenient to use the standard names that OJB likes to use for
  		testing. So, create a database named <code>OJB</code> and a user with
  		read/write access to that database named <code>oleg</code>. In
  		PostgreSQL I prefer to name the database lower-case
  		<code>ojb</code> as it makes the command line psql tools easier to use.
  		Your mileage may vary.
  	</p>
  </subsection>
  <subsection name="Installing and Building OJB">
  	<p>
  		Using the source installation provides a great deal of flexibility when
  		working with OJB, and is the better path to take while learning the
  		tool.
  	</p>
  	<p>
  		Download the most recent source distribution, or retrieve it from CVS
  		and unpack it to a chosen directory. Building OJB will require
  		retrieving several additional libraries which are not redistributable by
  		Jakarta directly. These are specified in the <a
  		href="deployment.html">deployment</a> instructions. Retrieve the needed
  		libraries and install them in <code>lib/</code> directory. As mentioned,
  		make sure to include the JDBC driver for the database you are using.
  	</p>
  	<p>
  		Now, run <code>ant jar</code> in your installation directory to build
  		OJB. If you experience build errors that a class is not found, you have
  		missed a required library. Check again to make sure you have downloaded
  		and added the needed jars to the <code>lib/</code> directory. The
  		package name of the missing class should give you a good clue as to what
  		library you need.
  	</p>
  </subsection>
  <subsection name="Accessing Your Database">
  	<p>
  		Now that you know you can build the actual OJB library, lets make sure
  		it works with your database.
  	</p>
  	<p>
  		Edit the <code>build.properties</code> file and uncomment the line for
  		the database you are using. For this example we will use PostgreSQL, so
  		we will uncomment the linefor PostgreSQL: <code>profile=postgresql</code>
  		and comment the line for HSQL: <code>#profile=hsqldb</code>. You will
  		uncomment the profile you need for your specific database.
  	</p>
  	<p>
  		Look for your database's entry in the <code>profiles/</code> directory,
  		<code>postgresql.profile</code> for our PostgreSQL example, and open it
  		in your text editor. Make any needed changes (such as specifying a
  		password if you have your database set to require one) to the
  		configuration and save the profile.
  	</p>
  	<p>
  		Now that the raw information needed to access your database is entered,
  		go back to the installation directory for OJB and run
  		<code>ant junit</code> and sit back. This will construct all of the
  		needed tables for OJB, as well as tables for unit testing OJB. It will
  		then happily run all of the various unit tests for you.
  	</p>
  	<p>
  		Assuming the build succeeded, take a look at your database and look at
  		the various tables. Pay particular note to the system tables described
  		in the <a href="platforms.html">platforms</a> documentation. You will
  		need these tables in the database for your application as well.
  	</p>
  </subsection>
  </section>
  
  <section name="Your Project">
  <subsection name="Preparing the Database">
  	<p>
  		Once again we will begin by preparing the database. One option is to
  		change the database profile to point directly at your project database
  		and run the ant task to build the database. While this will generated
  		the needed OJB tables, it will also clutter your database with a score
  		or so ugly unit test tables.
  	</p>
  	<p>
  		Assuming you tested against the same type of database you intend to run
  		against, the DDL for the required tables already exists, though. You can
  		use this DDL to generate the OJB tables in your database. The core
  		tables required by OJB will have their DDL in the
  		<code>target/src/sql/ojbcore-schema.sql</code> sql script. You can use
  		it directly to generate the required tables in your project's database.
  	</p>
  	<p>
  		OJB uses <a href="http://db.apache.org/torque">Torque</a> to generate
  		the JUnit tables. An excellent way to generate the OJB tables, instead
  		of using the DDL generated for the tests, is to generate your schema via
  		Torque as well, and include the schema definitions from the JUnit tests
  		in your schema definition. This is, however, beyond the scope of this
  		tutorial. Torque does have an excellent set of tutorials that can make
  		this task very simple though. The schema definition for OJB is in the
  		<code>src/schema/ojbcore-schema.xml</code> file. Just drop this file
  		into your own Torque schema directory and you are good to go, the OJB
  		schema will be built right alongside your own.
  	</p>
  </subsection>
  <subsection name="OJB Deployment">
  	<p>
  		Detailed deployment information is available in the <a
  		href="deployment.html">deployment</a> documentation, including examples
  		of deployment to various J2EE containers. This tutorial
  		merely steps through the minimum to get a project up and running in a
  		freestanding applications.
  	</p>
  	<p>
  		OJB requires a number of configuration files to function correctly.
  		All of these configuration files can be loaded directly off of the
  		classpath, however so you just need ot get the onto your runtime
  		classpath.
  	</p>
  	<p>
  		The required files are:
  		<ul>
  			<li>OJB.properties</li>
  			<li>repository*.xml</li>
  		</ul>
  		It is easiest to just copy the files from the test run to your project
  		and edit them to your needs. The test files can be found in the
  		<code>target/test/ojb/</code> directory. Copy these to a place directly
  		on your classpath - or better, to a place where your build process can
  		copy them to your runtime classpath.
  	</p>
  	<p>
  		Open up the repository.xml file. It is basically a skeleton that
  		includes the other repository-*.xml files. The default layout works
  		fairly well - use repository-user.xml for your mappings,
  		repository-database.xml for the database connection information, etc.
  		You can safely comment out or remove the junit, jdo, and ejb sections
  		however for this. If you intend to use that functionality yourself, go
  		ahead and add it back in after you have a stronger understanding of what
  		it does. For now, we just need the core functionality. make sure to
  		leave the internal reference in - it contains the mappings
  		for OJB's internally used tables.
  	</p>
  	<p>
  		In addition to the configuration information, you will need the ojb jar
  		library, and its required libraries. An up to date list of these is kept
  		on the
  		<a href="deployment.html#Additional jar archives">
  		Deployment</a> page. Copy these jar files to your runtime classpath as
  		well as the db-ojb-*.jar.
  	</p>
  	<p>
  		You are now ready to begin using OJB!
  	</p>
  </subsection>
  </section>
  </body>
  </document>
  
  
  
  1.1                  db-ojb/xdocs/howto.xml
  
  Index: howto.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
    <properties>
      <author email="brianm@apache.org">Brian McCallister</author>
      <title>ObJectRelationalBridge HOWTOs</title>
    </properties>
  
  <body>
  <section name="HOWTO Documention">
      <p>A collection of HOWTO's submitted by OJB Users and Developers</p>
      <ul>
          <li><a href="howto-build-mappings.html">How to build large metadata mappings</a></li>
          <li><a href="howto-use-anonymous-keys.html">Using anonymous keys for cleaner objects</a></li>
          <li><a href="howto-use-db-sequences.html">Using native database sequences</a></li>
          <li><a href="howto-use-lobs.html">Using Oracle LOB's</a></li>
          <li><a href="howto-work-with-clustering.html">Using OJB in a clustered environment</a></li>
      </ul>
  </section>
  </body>
  </document>
  
  
  
  1.1                  db-ojb/xdocs/otm-tutorial.xml
  
  Index: otm-tutorial.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <author email="brianm@apache.org">Brian McCallister</author>
      <title>ObJectRelationalBridge OTM Tutorial</title>
    </properties>
  
  <body>
  <section name="Using the OTM">
      <p>
          Being written as you read!
      </p>
  </section>
  </body>
  </document>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message