Produced by Siminov Software Solution LLP

siminov.orm.database
Class Select

java.lang.Object
  extended by siminov.orm.database.Select
All Implemented Interfaces:
IAverage, ICount, IDelete, IGroupConcat, IMax, IMin, ISelect, ISum, ITotal

public class Select
extends java.lang.Object
implements ISelect, IDelete, ICount, ISum, ITotal, IAverage, IMax, IMin, IGroupConcat


Field Summary
 
Fields inherited from interface siminov.orm.database.impl.ISelect
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.IDelete
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.ICount
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.ISum
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.ITotal
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.IAverage
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.IMax
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.IMin
INTERFACE_NAME
 
Fields inherited from interface siminov.orm.database.impl.IGroupConcat
INTERFACE_NAME
 
Constructor Summary
Select()
           
Select(DatabaseMappingDescriptor databaseMappingDescriptor, java.lang.String interfaceName)
           
Select(DatabaseMappingDescriptor databaseMappingDescriptor, java.lang.String interfaceName, java.lang.Object referObject)
           
 
Method Summary
 Clause and(java.lang.String column)
          Used to specify AND condition between where clause.
 Select ascendingOrderBy(java.lang.String... columns)
          Used to specify ORDER BY ASC keyword to sort the result-set in ascending order.
 Select column(java.lang.String column)
          Used to provide name of column for which count will be calculated.
 Select columns(java.lang.String... columns)
          Used to provide name of columns only for which data will be fetched.
 Select delimiter(java.lang.String delimiter)
          Used to specify separator if Y is omitted.
 Select descendingOrderBy(java.lang.String... columns)
          Used to specify ORDER BY DESC keyword to sort the result-set in descending order.
 Select distinct()
          Used to specify DISTINCT condition.
 java.lang.Object execute()
          Used to delete, this method should be called in last to delete tuples from table.
 java.lang.Object[] fetch()
          Used to get tuples, this method should be called in last to get tuples from table.
 Select groupBy(java.lang.String... columns)
          Used to specify GROUP BY statement in conjunction with the aggregate functions to group the result-set by one or more columns.
 Clause having(java.lang.String column)
          Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.
 Select havingClause(java.lang.String havingClause)
          Used to provide manually created Where clause, instead of using API's.
 Select limit(int limit)
          Used to specify the range of data need to fetch from table.
 Clause or(java.lang.String column)
          Used to specify OR condition between where clause.
 Select orderBy(java.lang.String... columns)
          Used to specify ORDER BY keyword to sort the result-set.
 Clause where(java.lang.String column)
          Column name of which condition will be specified.
 Select whereClause(java.lang.String whereClause)
          Used to provide manually created Where clause, instead of using API's.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Select

public Select()

Select

public Select(DatabaseMappingDescriptor databaseMappingDescriptor,
              java.lang.String interfaceName)
       throws DatabaseException
Throws:
DatabaseException

Select

public Select(DatabaseMappingDescriptor databaseMappingDescriptor,
              java.lang.String interfaceName,
              java.lang.Object referObject)
       throws DatabaseException
Throws:
DatabaseException
Method Detail

distinct

public Select distinct()
Description copied from interface: ISelect
Used to specify DISTINCT condition.

Specified by:
distinct in interface ICount
Specified by:
distinct in interface ISelect
Returns:
ICount Interface.

where

public Clause where(java.lang.String column)
Description copied from interface: ISelect
Column name of which condition will be specified.

Specified by:
where in interface IAverage
Specified by:
where in interface ICount
Specified by:
where in interface IDelete
Specified by:
where in interface IGroupConcat
Specified by:
where in interface IMax
Specified by:
where in interface IMin
Specified by:
where in interface ISelect
Specified by:
where in interface ISum
Specified by:
where in interface ITotal
Parameters:
column - Name of column.
Returns:
ISelectClause Interface.

whereClause

public Select whereClause(java.lang.String whereClause)
Description copied from interface: ISelect
Used to provide manually created Where clause, instead of using API's.

Specified by:
whereClause in interface IAverage
Specified by:
whereClause in interface ICount
Specified by:
whereClause in interface IDelete
Specified by:
whereClause in interface IGroupConcat
Specified by:
whereClause in interface IMax
Specified by:
whereClause in interface IMin
Specified by:
whereClause in interface ISelect
Specified by:
whereClause in interface ISum
Specified by:
whereClause in interface ITotal
Parameters:
whereClause - Manually created where clause.
Returns:
ISelect Interface.

and

public Clause and(java.lang.String column)
Description copied from interface: ISelect
Used to specify AND condition between where clause.

Specified by:
and in interface IAverage
Specified by:
and in interface ICount
Specified by:
and in interface IDelete
Specified by:
and in interface IGroupConcat
Specified by:
and in interface IMax
Specified by:
and in interface IMin
Specified by:
and in interface ISelect
Specified by:
and in interface ISum
Specified by:
and in interface ITotal
Parameters:
column - Name of column on which condition need to be specified.
Returns:
ISelectClause Interface.

or

public Clause or(java.lang.String column)
Description copied from interface: ISelect
Used to specify OR condition between where clause.

Specified by:
or in interface IAverage
Specified by:
or in interface ICount
Specified by:
or in interface IDelete
Specified by:
or in interface IGroupConcat
Specified by:
or in interface IMax
Specified by:
or in interface IMin
Specified by:
or in interface ISelect
Specified by:
or in interface ISum
Specified by:
or in interface ITotal
Parameters:
column - Name of column on which condition need to be specified.
Returns:
ISelectClause Interface.

orderBy

public Select orderBy(java.lang.String... columns)
Description copied from interface: ISelect
Used to specify ORDER BY keyword to sort the result-set.

Specified by:
orderBy in interface ISelect
Parameters:
columns - Name of columns which need to be sorted.
Returns:
ISelect Interface.

ascendingOrderBy

public Select ascendingOrderBy(java.lang.String... columns)
Description copied from interface: ISelect
Used to specify ORDER BY ASC keyword to sort the result-set in ascending order.

Specified by:
ascendingOrderBy in interface ISelect
Parameters:
columns - Name of columns which need to be sorted.
Returns:
ISelect Interface.

descendingOrderBy

public Select descendingOrderBy(java.lang.String... columns)
Description copied from interface: ISelect
Used to specify ORDER BY DESC keyword to sort the result-set in descending order.

Specified by:
descendingOrderBy in interface ISelect
Parameters:
columns - Name of columns which need to be sorted.
Returns:
ISelect Interface.

limit

public Select limit(int limit)
Description copied from interface: ISelect
Used to specify the range of data need to fetch from table.

Specified by:
limit in interface ISelect
Parameters:
limit - LIMIT of data.
Returns:
ISelect Interface.

groupBy

public Select groupBy(java.lang.String... columns)
Description copied from interface: ISelect
Used to specify GROUP BY statement in conjunction with the aggregate functions to group the result-set by one or more columns.

Specified by:
groupBy in interface IAverage
Specified by:
groupBy in interface ICount
Specified by:
groupBy in interface IGroupConcat
Specified by:
groupBy in interface IMax
Specified by:
groupBy in interface IMin
Specified by:
groupBy in interface ISelect
Specified by:
groupBy in interface ISum
Specified by:
groupBy in interface ITotal
Parameters:
columns - Name of columns.
Returns:
ISelect Interface.

having

public Clause having(java.lang.String column)
Description copied from interface: ISelect
Used to specify HAVING clause to SQL because the WHERE keyword could not be used with aggregate functions.

Specified by:
having in interface IAverage
Specified by:
having in interface ICount
Specified by:
having in interface IGroupConcat
Specified by:
having in interface IMax
Specified by:
having in interface IMin
Specified by:
having in interface ISelect
Specified by:
having in interface ISum
Specified by:
having in interface ITotal
Parameters:
column - Name of column on which condition need to be applied.
Returns:
ISelectClause Interface.

havingClause

public Select havingClause(java.lang.String havingClause)
Description copied from interface: ISelect
Used to provide manually created Where clause, instead of using API's.

Specified by:
havingClause in interface IAverage
Specified by:
havingClause in interface ICount
Specified by:
havingClause in interface IGroupConcat
Specified by:
havingClause in interface IMax
Specified by:
havingClause in interface IMin
Specified by:
havingClause in interface ISelect
Specified by:
havingClause in interface ISum
Specified by:
havingClause in interface ITotal
Parameters:
havingClause - Where clause.
Returns:
ISelect Interface.

column

public Select column(java.lang.String column)
Description copied from interface: ICount
Used to provide name of column for which count will be calculated.

Specified by:
column in interface IAverage
Specified by:
column in interface ICount
Specified by:
column in interface IGroupConcat
Specified by:
column in interface IMax
Specified by:
column in interface IMin
Specified by:
column in interface ISum
Specified by:
column in interface ITotal
Parameters:
column - Name of column.
Returns:
ICount Interface.

columns

public Select columns(java.lang.String... columns)
Description copied from interface: ISelect
Used to provide name of columns only for which data will be fetched.

Specified by:
columns in interface ISelect
Returns:
ISelect Interface.

delimiter

public Select delimiter(java.lang.String delimiter)
Description copied from interface: IGroupConcat
Used to specify separator if Y is omitted.

Specified by:
delimiter in interface IGroupConcat
Parameters:
delimiter - Delimiter.
Returns:
IGroupConcat Interface.

execute

public java.lang.Object execute()
                         throws DatabaseException
Description copied from interface: IDelete
Used to delete, this method should be called in last to delete tuples from table.

Specified by:
execute in interface IAverage
Specified by:
execute in interface ICount
Specified by:
execute in interface IDelete
Specified by:
execute in interface IGroupConcat
Specified by:
execute in interface IMax
Specified by:
execute in interface IMin
Specified by:
execute in interface ISum
Specified by:
execute in interface ITotal
Returns:
Return count.
Throws:
DatabaseException - Throws exception if any error occur while deleting tuples from table.

fetch

public java.lang.Object[] fetch()
                         throws DatabaseException
Description copied from interface: ISelect
Used to get tuples, this method should be called in last to get tuples from table.

Specified by:
fetch in interface ISelect
Returns:
Return array of model objects.
Throws:
DatabaseException - Throws exception if any error occur while getting tuples from table.

Apache License 2.0

Copyright 2013