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;
 
 import java.util.Set;
 
The interface of entity.
And it's the landmark class for DBFlute.

Author(s):
jflute
 
 public interface Entity {
 
     // ===================================================================================
     //                                                                             DB Meta
     //                                                                             =======
     
Handle the meta as DBMeta, that has all info of the table.

Returns:
The (singleton) instance of DB meta for the table. (NotNull)
 
     DBMeta asDBMeta();

    
Handle the meta as table DB name, that can be identity of table.

Returns:
The (fixed) DB name of the table. (NotNull)
 
     String asTableDbName(); // not use 'get' for quiet
 
     // ===================================================================================
     //                                                                 Modified Properties
     //                                                                 ===================
     // -----------------------------------------------------
     //                                              Modified
     //                                              --------
     
Get the set of modified properties. (basically for Framework)
The properties needs to be according to Java Beans rule.

Returns:
The set of property name for modified columns, read-only. (NotNull)
 
     Set<StringmymodifiedProperties(); // 'my' take on unique-driven
 
    
Modify the property without setting value. (basically for Framework)
The property name needs to be according to Java Beans rule.

Parameters:
propertyName The property name of modified column. (NotNull)
 
     void mymodifyProperty(String propertyName);

    
Cancel the modified the property without resetting value. (basically for Framework)
The property name needs to be according to Java Beans rule.

Parameters:
propertyName The property name of specified column. (NotNull)
 
     void mymodifyPropertyCancel(String propertyName);

    
Clear the information of modified properties. (basically for Framework)
 
     void clearModifiedInfo();

    
Does it have modifications of property names. (basically for Framework)

Returns:
The determination, true or false.
 
     boolean hasModification();
 
     // -----------------------------------------------------
     //                                             Specified
     //                                             ---------
     
Copy to modified properties to specified properties.
It means non-specified columns are checked
 
     void modifiedToSpecified();

    
Get the set of specified properties. (basically for Framework)
The properties needs to be according to Java Beans rule.

Returns:
The set of property name for specified columns, read-only. (NotNull: if empty, no check)
 
     Set<StringmyspecifiedProperties(); // 'my' take on unique-driven
 
    
Specify the property without setting value. (basically for Framework)
The property name needs to be according to Java Beans rule.

Parameters:
propertyName The property name of specified column. (NotNull)
    void myspecifyProperty(String propertyName); // e.g. called by null object handling

    
Cancel the specified the property without resetting value. (basically for Framework)
The property name needs to be according to Java Beans rule.

Parameters:
propertyName The property name of specified column. (NotNull)
    void myspecifyPropertyCancel(String propertyName);

    
Clear the information of specified properties. (basically for Framework)
It means no check of access to non-specified columns.
    void clearSpecifiedInfo();
    // ===================================================================================
    //                                                                        Key Handling
    //                                                                        ============
    
Does it have the value of primary keys?

Returns:
The determination, true or false. (if all PK values are not null, returns true)
    boolean hasPrimaryKeyValue();

    
Get the properties of unique-driven columns as unique-driven.

Returns:
The set of property name for unique-driven columns, read-only. (NotNull)
    Set<StringmyuniqueDrivenProperties(); // prefix 'my' not to show when uniqueBy() completion

    
Treat the property as unique driven without setting value. (basically for Framework)
The property name needs to be according to Java Beans rule.

Parameters:
propertyName The property name of unique-driven column. (NotNull)
    void myuniqueByProperty(String propertyName);

    
Cancel the property as unique driven without resetting value. (basically for Framework)
The property name needs to be according to Java Beans rule.

Parameters:
propertyName The property name of unique-driven column. (NotNull)
    void myuniqueByPropertyCancel(String propertyName);

    
Clear the information of unique-driven properties. (basically for Framework)
    void clearUniqueDrivenInfo();
    // ===================================================================================
    //                                                                      Classification
    //                                                                      ==============
    
Unlock the access to undefined classification code. (default is locked) You can select undefined classification code from database. (and can update...)
Does the access to undefined classification allowed?

Returns:
The determination, true or false. (basically false)
    // ===================================================================================
    //                                                                     Birthplace Mark
    //                                                                     ===============
    
Mark as select that means the entity is created by DBFlute select process. (basically for Framework)
e.g. determine columns of batch insert
    void markAsSelect();

    
Is the entity created by DBFlute select process? (basically for Framework)

Returns:
The determination, true or false.
    boolean createdBySelect();
    // ===================================================================================
    //                                                                    Extension Method
    //                                                                    ================
    
Calculate the hash-code, which is a default hash code, to identify the instance.

Returns:
The hash-code from super.hashCode().
    int instanceHash();

    
Convert the entity to display string with relation information.

Returns:
The display string of basic informations with one-nested relation values. (NotNull)
    String toStringWithRelation();

    
Build display string flexibly.

Parameters:
name The name for display. (NullAllowed: If it's null, it does not have a name)
column Does it contains column values or not?
relation Does it contains relation existences or not?
Returns:
The display string for this entity. (NotNull)
    String buildDisplayString(String nameboolean columnboolean relation);
New to GrepCode? Check out our FAQ X