Class ToOneRelationQueryAdapter
- All Implemented Interfaces:
- Query,- RelationQuery
RelationQuery interface- 
Nested Class SummaryNested classes/interfaces inherited from interface ch.tocco.nice2.persist.core.api.query.QueryQuery.Mode
- 
Field SummaryFields inherited from class ch.tocco.nice2.persist.core.impl.hibernate.pojo.relation.AbstractRelationQueryAdapterrelationModel, sourceEntityFields inherited from class ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQueryordering
- 
Constructor SummaryConstructorsConstructorDescriptionToOneRelationQueryAdapter(Entity sourceEntity, RelationModel relationModel, EntityFacadeListenerManager entityFacadeListenerManager, EntityInterceptor entityInterceptor, PropertyAccessorService propertyAccessorService) 
- 
Method SummaryModifier and TypeMethodDescriptionintcount()Currently badly implemented! Count the results.execute(Pagination pagination, Query.Mode mode) Execute the query using the specified pagination parameters in the specifiedQuery.Mode.Executes and returns the first selected Entity by this query, or throws.@Nullable EntityExecutes and returns the first selected Entity by this query, or null if none.Executes and returns the single selected Entity by this query, or throws.@Nullable EntityExecutes and returns the single selected Entity by this query, or null if none, or throws.protected @Nullable EntitygetValue()Executes and returns the single selected Entity by this query, or throws.@Nullable EntityExecutes and returns the single selected Entity by this query, or null if none, or throws.Methods inherited from class ch.tocco.nice2.persist.core.impl.hibernate.pojo.relation.AbstractRelationQueryAdapterexecute, execute, execute, execute, execute, getManager, getOnlyResult, getOnlyResultOrNull, getRelationModel, getSource, setParameter, toQueryDefinitionMethods inherited from class ch.tocco.nice2.persist.core.spi.entity.query.ql.AbstractOrderableQueryappendOrder, getOrdering, hasOrdering, prependOrder, withOrderMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.tocco.nice2.persist.core.api.query.QueryappendOrder, getKeys, getKeys, getOrdering, hasOrdering, prependOrder, withOrder
- 
Constructor Details- 
ToOneRelationQueryAdapterpublic ToOneRelationQueryAdapter(Entity sourceEntity, RelationModel relationModel, EntityFacadeListenerManager entityFacadeListenerManager, EntityInterceptor entityInterceptor, PropertyAccessorService propertyAccessorService) 
 
- 
- 
Method Details- 
getValue
- 
executeDescription copied from interface:QueryExecute the query using the specified pagination parameters in the specifiedQuery.Mode.- Parameters:
- pagination- The offset and limit of the query.
- mode- The mode.
- Returns:
- The result of the query.
 
- 
uniqueResultDescription copied from interface:QueryExecutes and returns the single selected Entity by this query, or throws.- Returns:
- The single selected Entity.
- See Also:
 
- 
uniqueResultOrNullDescription copied from interface:QueryExecutes and returns the single selected Entity by this query, or null if none, or throws.- Returns:
- The single selected Entity, or nullif none.
- See Also:
 
- 
firstResultDescription copied from interface:QueryExecutes and returns the first selected Entity by this query, or throws.- Returns:
- The first selected Entity.
- See Also:
 
- 
firstResultOrNullDescription copied from interface:QueryExecutes and returns the first selected Entity by this query, or null if none.- Returns:
- The first selected Entity, or nullif none.
- See Also:
 
- 
getOnlyResultDescription copied from interface:QueryExecutes and returns the single selected Entity by this query, or throws.- Returns:
- The single selected Entity.
- See Also:
 
- 
getOnlyResultOrNullDescription copied from interface:QueryExecutes and returns the single selected Entity by this query, or null if none, or throws.- Returns:
- The single selected Entity, or nullif none.
- See Also:
 
- 
countpublic int count()Description copied from interface:QueryCurrently badly implemented! Count the results.WARNING: This method does not behave as "SELECT count()" in SQL does! In fact it is temporarily implemented as a chaining of execute().size() only. No query modification is done etc. ALSO, the default query limit is used and thus if there would be more records, only the default limit is returned. The impl may be rewritten to be what one would expect; until then users may only use this method if they can live with today's limits: small counts. Speed of "SELECT count()" greatly depends on the underlying db table impl. An example are the two MySQL table types MyISAM and InnoDB. A query-less count on the former returns instantly because it keeps track of the number, whereas the latter needs to iterate over all records (at least in case of non-fixed length record tables) and can take minutes depending on the size. - Returns:
- The count.
 
 
-