org.benow.repository.mapping
Class JSQLQuery

java.lang.Object
  extended by org.benow.repository.mapping.JSQLQuery

public class JSQLQuery
extends java.lang.Object


Nested Class Summary
static class JSQLQuery.OrderConstraint
           
 
Constructor Summary
JSQLQuery()
           
 
Method Summary
static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet, java.lang.Class<?> fromType, java.lang.Object joinKey, java.lang.String fieldName)
          Create join statement between two tables using intermediary lookup table
static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet, java.lang.Class<?> fromType, java.lang.Object joinKey, java.lang.String fieldName, java.util.List<JSQLQuery.OrderConstraint> orderBys)
           
static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet, java.lang.String joinFromColumn, java.lang.String joinColumn, java.lang.Object key)
          Create join statement within same table
static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet, java.lang.String joinFromColumn, java.lang.String joinColumn, java.lang.Object key, java.util.List<JSQLQuery.OrderConstraint> orderBys)
           
static QueryContext createInTableGetJoinedQuery(java.lang.Class<?> toGet, java.lang.String fromColName, java.lang.Object key)
          Query to same type by matching id field
static QueryContext createSimpleGetJoinedQuery(java.lang.Class<?> toGet, java.lang.Class<?> fromType, java.lang.String fromColName, java.lang.Object key)
          join without join table
static void deleteObjects(java.lang.Class<?> type)
           
static void deleteObjects(java.lang.Class<?>[] types)
           
static void deleteObjectsByField(java.lang.Class<?> type, java.lang.String field, java.lang.Object event)
           
static QueryContext getAllObjectsQuery(java.lang.Class<?> forClass)
           
static QueryContext getByKeyQuery(java.lang.Class<?> forClass, java.lang.Object key)
           
static QueryContext getLikeObjectsByFieldQuery(java.lang.Class<PermissionImpl> toGet, java.lang.String field, java.lang.String likeMatch)
           
static JSQLClassMapping getMapping(java.lang.Class<?> forClass)
           
static QueryContext getObjectByFieldQuery(java.lang.Class<?> toGet, java.lang.String[] fields, java.lang.Object[] values)
           
static QueryContext getObjectByFieldQuery(java.lang.Class<?> toGet, java.lang.String field, java.lang.Object value)
           
static QueryContext getObjectByFieldsQuery(java.lang.Class<?> toGet, java.lang.String[] fields, java.lang.Object[] values)
           
static QueryContext getObjectByKeyQuery(java.lang.Class<?> forClass, java.lang.Object key)
           
static int getObjectCount(java.lang.Class<?> toFind)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSQLQuery

public JSQLQuery()
Method Detail

getAllObjectsQuery

public static QueryContext getAllObjectsQuery(java.lang.Class<?> forClass)

getObjectByKeyQuery

public static QueryContext getObjectByKeyQuery(java.lang.Class<?> forClass,
                                               java.lang.Object key)

getByKeyQuery

public static QueryContext getByKeyQuery(java.lang.Class<?> forClass,
                                         java.lang.Object key)

getMapping

public static JSQLClassMapping getMapping(java.lang.Class<?> forClass)

getObjectByFieldQuery

public static QueryContext getObjectByFieldQuery(java.lang.Class<?> toGet,
                                                 java.lang.String[] fields,
                                                 java.lang.Object[] values)

getObjectByFieldsQuery

public static QueryContext getObjectByFieldsQuery(java.lang.Class<?> toGet,
                                                  java.lang.String[] fields,
                                                  java.lang.Object[] values)

getObjectByFieldQuery

public static QueryContext getObjectByFieldQuery(java.lang.Class<?> toGet,
                                                 java.lang.String field,
                                                 java.lang.Object value)

deleteObjectsByField

public static void deleteObjectsByField(java.lang.Class<?> type,
                                        java.lang.String field,
                                        java.lang.Object event)

getLikeObjectsByFieldQuery

public static QueryContext getLikeObjectsByFieldQuery(java.lang.Class<PermissionImpl> toGet,
                                                      java.lang.String field,
                                                      java.lang.String likeMatch)

deleteObjects

public static void deleteObjects(java.lang.Class<?>[] types)

deleteObjects

public static void deleteObjects(java.lang.Class<?> type)

createGetJoinedQuery

public static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet,
                                                java.lang.String joinFromColumn,
                                                java.lang.String joinColumn,
                                                java.lang.Object key)
Create join statement within same table

Parameters:
toGet - class to query
joinColumn - column on which they're joined
key - key of joiner
Returns:

createGetJoinedQuery

public static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet,
                                                java.lang.String joinFromColumn,
                                                java.lang.String joinColumn,
                                                java.lang.Object key,
                                                java.util.List<JSQLQuery.OrderConstraint> orderBys)

createGetJoinedQuery

public static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet,
                                                java.lang.Class<?> fromType,
                                                java.lang.Object joinKey,
                                                java.lang.String fieldName)
                                         throws ObjectRepositoryException
Create join statement between two tables using intermediary lookup table

Parameters:
toGet - class to get
fromType - class getting from
joinKey - key joining from to to
Returns:
Throws:
ObjectRepositoryException

createGetJoinedQuery

public static QueryContext createGetJoinedQuery(java.lang.Class<?> toGet,
                                                java.lang.Class<?> fromType,
                                                java.lang.Object joinKey,
                                                java.lang.String fieldName,
                                                java.util.List<JSQLQuery.OrderConstraint> orderBys)
                                         throws ObjectRepositoryException
Throws:
ObjectRepositoryException

createSimpleGetJoinedQuery

public static QueryContext createSimpleGetJoinedQuery(java.lang.Class<?> toGet,
                                                      java.lang.Class<?> fromType,
                                                      java.lang.String fromColName,
                                                      java.lang.Object key)
join without join table


createInTableGetJoinedQuery

public static QueryContext createInTableGetJoinedQuery(java.lang.Class<?> toGet,
                                                       java.lang.String fromColName,
                                                       java.lang.Object key)
Query to same type by matching id field

Parameters:
toGet -
fromType -
fromColName -
key -
Returns:

getObjectCount

public static int getObjectCount(java.lang.Class<?> toFind)