Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014-2015 the original author or authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  * either express or implied. See the License for the specific language
  * governing permissions and limitations under the License.
  */
 package org.dbflute.cbean;
 
The condition-query as interface.

Author(s):
jflute
 
 public interface ConditionQuery {
 
     // ===================================================================================
     //                                                                  Important Accessor
     //                                                                  ==================
     
Handle the meta as table DB name, that can be identity of table..

Returns:
The (fixed) DB name of the table. (NotNull)
 
     String asTableDbName();
 
     // internal getter methods start with 'x'
     // not to be same as column names 
 
    
Convert to the column real name. (with real alias name)
With finding DBMeta.

Parameters:
columnDbName The DB name of column. (NotNull)
Returns:
the column real name. (NotNull)
 
     ColumnRealName toColumnRealName(String columnDbName);

    
Convert to the column real name. (with real alias name)
Without finding DBMeta.

Parameters:
columnInfo The information of column. (NotNull)
Returns:
the column real name. (NotNull)
 
     ColumnRealName toColumnRealName(ColumnInfo columnInfo);

    
Convert to the column SQL name.
With finding DBMeta.

Parameters:
columnDbName The DB name of column. (NotNull)
Returns:
the column SQL name. (NotNull)
 
     ColumnSqlName toColumnSqlName(String columnDbName);

    
Get the base condition-bean.

Returns:
The base condition-bean of this query. (NotNull)
 
     ConditionBean xgetBaseCB();

    
Get the base query.

Returns:
The condition-query of base table. (NotNull: if this is base query, returns this)
 
     ConditionQuery xgetBaseQuery();

    
Get the referrer query.

Returns:
The condition-query of referrer table. (NullAllowed: if null, this is base query)
 
     ConditionQuery xgetReferrerQuery();

    
Get the SqlClause.

Returns:
The instance of SqlClause. (NotNull)
 
     SqlClause xgetSqlClause();

    
Get the alias name for this query.

Returns:
The alias name for this query. (NotNull)
 
     String xgetAliasName();
 
     // nest level is old style
    // so basically unused now 
    
Get the nest level of relation.

Returns:
The nest level of relation.
    int xgetNestLevel();

    
Get the nest level for next relation.

Returns:
The nest level for next relation.
    int xgetNextNestLevel();

    
Is this a base query?

Returns:
The determination, true or false.
    boolean isBaseQuery();

    
Get the property name of foreign relation.

Returns:
The property name of foreign relation. (NotNull)
Get the path of foreign relation. e.g. _0_1

Returns:
The path of foreign relation. (NullAllowed: if base query, returns null)
    String xgetRelationPath();

    
Get the base location of this condition-query.

Returns:
The base location of this condition-query. (NotNull)
    // ===================================================================================
    //                                                                 Reflection Invoking
    //                                                                 ===================
    
Invoke getting value.

Parameters:
columnFlexibleName The flexible name of the column. (NotNull, NotEmpty)
Returns:
The instance of condition-value object. (NotNull)
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the column is not found and the method is failed.
    ConditionValue invokeValue(String columnFlexibleName);

    
Invoke setting query. {RelationResolved}
Basically for keys that does not need a condition option.
And you should set a list that has fromDate and toDate to conditionValue when DateFromTo, and set null value to it when keys that does not have an argument, e.g. IsNull, then the value is ignored.

Parameters:
columnFlexibleName The flexible name of the column allowed to contain relations. (NotNull, NotEmpty)
conditionKeyName The name of the condition-key. (NotNull)
conditionValue The value of the condition. (NotNull: as default, NullAllowed: as optional)
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the column is not found and the method is failed.
    void invokeQuery(String columnFlexibleNameString conditionKeyNameObject conditionValue);

    
Invoke setting query with option. {RelationResolved}
Basically for LikeSearch, NotLikeSearch, FromTo.
And you should set a list that has fromDate and toDate to conditionValue when FromTo, and set null value to it when keys that does not have an argument, e.g. IsNull, then the value is ignored.

Parameters:
columnFlexibleName The flexible name of the column allowed to contain relations. (NotNull, NotEmpty)
conditionKeyName The name of the condition-key. (NotNull)
conditionValue The value of the condition. (NotNull: as default, NullAllowed: as optional)
conditionOption The option of the condition. (NotNull)
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the column is not found and the method is failed.
    void invokeQuery(String columnFlexibleNameString conditionKeyNameObject conditionValueConditionOption conditionOption);

    
Invoke setting query of equal. {RelationResolved}

Parameters:
columnFlexibleName The flexible name of the column allowed to contain relations. (NotNull, NotEmpty)
conditionValue The value of the condition 'equal'. (NotNull: as default, NullAllowed: as optional)
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the column is not found and the method is failed.
    void invokeQueryEqual(String columnFlexibleNameObject conditionValue);

    
Invoke setting query of not-equal. {RelationResolved}

Parameters:
columnFlexibleName The flexible name of the column allowed to contain relations. (NotNull, NotEmpty)
conditionValue The value of the condition 'notEqual'. (NotNull: as default, NullAllowed: as optional)
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the column is not found and the method is failed.
    void invokeQueryNotEqual(String columnFlexibleNameObject conditionValue);

    
Invoke adding orderBy. {RelationResolved}

Parameters:
columnFlexibleName The flexible name of the column allowed to contain relations. (NotNull, NotEmpty)
isAsc Is it ascend?
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the column is not found and the method is failed.
    void invokeOrderBy(String columnFlexibleNameboolean isAsc);

    
Invoke getting foreign condition-query.
A method with parameters (using fixed condition) is unsupported.

Parameters:
foreignPropertyName The property name(s), can contain '.' , of the foreign relation. (NotNull, NotEmpty)
Returns:
The conditionQuery of the foreign relation as interface. (NotNull)
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the property is not found and the method is failed.
    ConditionQuery invokeForeignCQ(String foreignPropertyName);

    
Invoke determining foreign condition-query existence? A method with parameters (using fixed condition) is unsupported.

Parameters:
foreignPropertyName The property name(s), can contain '.' , of the foreign relation. (NotNull, NotEmpty)
Returns:
The conditionQuery of the foreign relation as interface. (NotNull)
Throws:
org.dbflute.exception.ConditionInvokingFailureException When the method to the property is not found and the method is failed.
    boolean invokeHasForeignCQ(String foreignPropertyName);
    // ===================================================================================
    //                                                                    Option Parameter
    //                                                                    ================
    
Register the parameter option.

Parameters:
option The option of parameter. (NullAllowed)
New to GrepCode? Check out our FAQ X