java.lang.Object
org.litebridge.orm.api.select.model.SelectSpec
org.litebridge.orm.api.dto.DtoSelectSpec
- All Implemented Interfaces:
DtoDataSpec
Specification for a DTO select query.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a pair of a field accessor and its corresponding database column. -
Field Summary
Fields inherited from class org.litebridge.orm.api.select.model.SelectSpec
expressionSpecs, groupBy, havingConditions, joins, limit, litebridgeContext, orderBys, selectExpressionMapper, table, whereConditions -
Constructor Summary
ConstructorsConstructorDescriptionDtoSelectSpec(Class<?> dtoClass, OrmTable dtoTable, AliasGenerator aliasGenerator, LitebridgeContext litebridgeContext) Creates a new DtoSelectSpec without type override.DtoSelectSpec(Class<?> dtoClass, OrmTable dtoTable, AliasGenerator aliasGenerator, LitebridgeContext litebridgeContext, @Nullable Class<?> typeOverride) Creates a new DtoSelectSpec. -
Method Summary
Modifier and TypeMethodDescriptioncreateSelectFieldSpecs(String[] fields) Creates select field specifications for the given fields.Class<?> dtoClass()Returns the DTO class.dtoTable()Returns the ORM table metadata for the DTO.newJoinSpec(Class<?> dtoClass, OrmTable ormTable, Table table) Creates a new join specification.newJoinSpecBefore(DtoJoinSpec other, Class<?> dtoClass, OrmTable ormTable, Table table) Creates a new join specification before another join specification.@Nullable Class<?> Returns the type override.Methods inherited from class org.litebridge.orm.api.select.model.SelectSpec
addExpressions, convertToSelectExpressionStream, currentHavingConditionGroupSpec, currentWhereConditionGroupSpec, ensureLimit, getExpressions, getGroupBy, getJoins, getLimit, getOrderBys, getTable, newOrderBy, newOrderBy, popHavingConditionGroup, popWhereConditionGroup, pushHavingConditionGroup, pushWhereConditionGroup, selectExpressionMapper, setExpressions, setGroupBy, setProtoExpressionResolver, setTable, toSelect
-
Constructor Details
-
DtoSelectSpec
public DtoSelectSpec(Class<?> dtoClass, OrmTable dtoTable, AliasGenerator aliasGenerator, LitebridgeContext litebridgeContext, @Nullable Class<?> typeOverride) Creates a new DtoSelectSpec.- Parameters:
dtoClass- the DTO classdtoTable- the DTO tablealiasGenerator- the alias generatorlitebridgeContext- the litebridge contexttypeOverride- the type override
-
DtoSelectSpec
public DtoSelectSpec(Class<?> dtoClass, OrmTable dtoTable, AliasGenerator aliasGenerator, LitebridgeContext litebridgeContext) Creates a new DtoSelectSpec without type override.- Parameters:
dtoClass- the DTO classdtoTable- the DTO tablealiasGenerator- the alias generatorlitebridgeContext- the litebridge context
-
-
Method Details
-
dtoClass
Returns the DTO class.- Returns:
- the DTO class
-
dtoTable
Description copied from interface:DtoDataSpecReturns the ORM table metadata for the DTO.- Specified by:
dtoTablein interfaceDtoDataSpec- Returns:
- the ORM table metadata
-
typeOverride
Returns the type override.- Returns:
- the type override, or null if none
-
newJoinSpec
Creates a new join specification.- Parameters:
dtoClass- the DTO class to joinormTable- the ORM table to jointable- the database table to join- Returns:
- the new join specification
-
newJoinSpecBefore
public DtoJoinSpec newJoinSpecBefore(DtoJoinSpec other, Class<?> dtoClass, OrmTable ormTable, Table table) Creates a new join specification before another join specification.- Parameters:
other- the join specification to insert beforedtoClass- the DTO class to joinormTable- the ORM table to jointable- the database table to join- Returns:
- the new join specification
-
createSelectFieldSpecs
Creates select field specifications for the given fields.- Parameters:
fields- the field names- Returns:
- the list of expression specifications
-