intra-mart Accel Kaiden! プログラミングガイド 第8版 2018-04-01

4.1.2.2. S2JDBC

4.1.2.2.1. S2JDBC-Genの実行

チュートリアルマスタのDDLを実行後、S2JDBC-Genにて次のソースを自動生成します。
  • jp.co.slcs.kaiden2.tutorial.foundation.model.entity.K99mTutorial
  • jp.co.slcs.kaiden2.tutorial.foundation.model.entity.K99mTutorialNames
  • jp.co.slcs.kaiden2.tutorial.foundation.model.service.K99mTutorialService
  • jp.co.slcs.kaiden2.tutorial.foundation.model.service.K99mTutorialCondition

コラム

S2JDBC-Genにてソースを自動生成した際に、次の個所を確認してください。
  • “K99mTutorial”のスーパークラスが「jp.co.slcs.kaiden2.base.foundation.model.entity.GenerateEntity」に設定されていること。
  • “K99mTutorial”に登録日時、登録者コード、更新カウンタ、更新日時、更新者コードが定義されていないこと。
  • “K99mTutorialService”のスーパークラスが「jp.co.slcs.kaiden2.base.foundation.model.service.GenerateService」に設定されていること。

4.1.2.2.2. 自動生成ソース

src
└─main
    └─generated
        └─jp
            └─co
                └─slcs
                    └─kaiden2
                        └─tutorial
                            └─foundation
                                └─model
                                    ├─entity
                                    │      K99mTutorial.java
                                    │      K99mTutorialNames.java
                                    └─service
                                            K99mTutorialCondition.java
                                            K99mTutorialService.java

4.1.2.2.2.1. Entity

  • Path
    src/main/generated/jp/co/slcs/kaiden2/tutorial/foundation/model/entity/K99mTutorial.java
package jp.co.slcs.kaiden2.tutorial.foundation.model.entity;

import java.io.Serializable;
import java.sql.Timestamp;
import javax.annotation.Generated;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jp.co.slcs.kaiden2.base.foundation.model.entity.GenerateEntity;

/**
 * チュートリアルマスタ.
 * 
 * @author Sumitomo Life Information Systems Co.,Ltd.
 */
@Entity
@Table(name = "k99m_tutorial")
@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl" })
public final class K99mTutorial extends GenerateEntity implements Serializable {
    
    /** シリアルバージョンUID. */
    private static final long serialVersionUID = 1L;

    /** 会社コード. */
    @Id
    @Column(name = "company_cd", columnDefinition = "varchar2(100)", nullable = false, unique = false)
    public String companyCd;

    /** チュートリアルコード. */
    @Id
    @Column(name = "tutorial_cd", columnDefinition = "varchar2(100)", nullable = false, unique = false)
    public String tutorialCd;

    /** チュートリアル名称. */
    @Column(name = "tutorial_name", columnDefinition = "varchar2(1000)", nullable = false, unique = false)
    public String tutorialName;

    /** ロケールid. */
    @Id
    @Column(name = "locale_id", columnDefinition = "varchar2(50)", nullable = false, unique = false)
    public String localeId;

    /** 期間コード. */
    @Id
    @Column(name = "term_cd", columnDefinition = "varchar2(50)", nullable = false, unique = false)
    public String termCd;

    /** 開始日. */
    @Column(name = "start_date", columnDefinition = "timestamp(6)", nullable = false, unique = false)
    public Timestamp startDate;

    /** 終了日. */
    @Column(name = "end_date", columnDefinition = "timestamp(6)", nullable = false, unique = false)
    public Timestamp endDate;

    /** 削除フラグ. */
    @Column(name = "delete_flag", columnDefinition = "varchar2(1)", nullable = false, unique = false)
    public String deleteFlag;

    /** 予備項目a. */
    @Column(name = "extension_a", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionA;

    /** 予備項目b. */
    @Column(name = "extension_b", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionB;

    /** 予備項目c. */
    @Column(name = "extension_c", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionC;

    /** 予備項目d. */
    @Column(name = "extension_d", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionD;

    /** 予備項目e. */
    @Column(name = "extension_e", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionE;

    /** 予備項目f. */
    @Column(name = "extension_f", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionF;

    /** 予備項目g. */
    @Column(name = "extension_g", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionG;

    /** 予備項目h. */
    @Column(name = "extension_h", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionH;

    /** 予備項目i. */
    @Column(name = "extension_i", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionI;

    /** 予備項目j. */
    @Column(name = "extension_j", columnDefinition = "varchar2(1000)", nullable = true, unique = false)
    public String extensionJ;
}

4.1.2.2.2.2. Names

  • Path
    src/main/generated/jp/co/slcs/kaiden2/tutorial/foundation/model/entity/K99mTutorialNames.java
package jp.co.slcs.kaiden2.tutorial.foundation.model.entity;

import java.sql.Timestamp;
import javax.annotation.Generated;
import org.seasar.extension.jdbc.name.PropertyName;

/**
 * {@link K99mTutorial}の名称クラス.
 * 
 * @author Sumitomo Life Information Systems Co.,Ltd.
 */
@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl" })
public final class K99mTutorialNames {
    
    /**
     * デフォルトコンストラクタ.
     */
     private K99mTutorialNames() {
         super();
     }
    
    /**
     * companyCdのプロパティ名を返却.
     * 
     * @return companyCdのプロパティ名
     */
    public static PropertyName<String> companyCd() {
        return new PropertyName<String>("companyCd");
    }
    
    /**
     * tutorialCdのプロパティ名を返却.
     * 
     * @return tutorialCdのプロパティ名
     */
    public static PropertyName<String> tutorialCd() {
        return new PropertyName<String>("tutorialCd");
    }
    
    /**
     * tutorialNameのプロパティ名を返却.
     * 
     * @return tutorialNameのプロパティ名
     */
    public static PropertyName<String> tutorialName() {
        return new PropertyName<String>("tutorialName");
    }
    
    /**
     * localeIdのプロパティ名を返却.
     * 
     * @return localeIdのプロパティ名
     */
    public static PropertyName<String> localeId() {
        return new PropertyName<String>("localeId");
    }
    
    /**
     * termCdのプロパティ名を返却.
     * 
     * @return termCdのプロパティ名
     */
    public static PropertyName<String> termCd() {
        return new PropertyName<String>("termCd");
    }
    
    /**
     * startDateのプロパティ名を返却.
     * 
     * @return startDateのプロパティ名
     */
    public static PropertyName<Timestamp> startDate() {
        return new PropertyName<Timestamp>("startDate");
    }
    
    /**
     * endDateのプロパティ名を返却.
     * 
     * @return endDateのプロパティ名
     */
    public static PropertyName<Timestamp> endDate() {
        return new PropertyName<Timestamp>("endDate");
    }
    
    /**
     * deleteFlagのプロパティ名を返却.
     * 
     * @return deleteFlagのプロパティ名
     */
    public static PropertyName<String> deleteFlag() {
        return new PropertyName<String>("deleteFlag");
    }
    
    /**
     * extensionAのプロパティ名を返却.
     * 
     * @return extensionAのプロパティ名
     */
    public static PropertyName<String> extensionA() {
        return new PropertyName<String>("extensionA");
    }
    
    /**
     * extensionBのプロパティ名を返却.
     * 
     * @return extensionBのプロパティ名
     */
    public static PropertyName<String> extensionB() {
        return new PropertyName<String>("extensionB");
    }
    
    /**
     * extensionCのプロパティ名を返却.
     * 
     * @return extensionCのプロパティ名
     */
    public static PropertyName<String> extensionC() {
        return new PropertyName<String>("extensionC");
    }
    
    /**
     * extensionDのプロパティ名を返却.
     * 
     * @return extensionDのプロパティ名
     */
    public static PropertyName<String> extensionD() {
        return new PropertyName<String>("extensionD");
    }
    
    /**
     * extensionEのプロパティ名を返却.
     * 
     * @return extensionEのプロパティ名
     */
    public static PropertyName<String> extensionE() {
        return new PropertyName<String>("extensionE");
    }
    
    /**
     * extensionFのプロパティ名を返却.
     * 
     * @return extensionFのプロパティ名
     */
    public static PropertyName<String> extensionF() {
        return new PropertyName<String>("extensionF");
    }
    
    /**
     * extensionGのプロパティ名を返却.
     * 
     * @return extensionGのプロパティ名
     */
    public static PropertyName<String> extensionG() {
        return new PropertyName<String>("extensionG");
    }
    
    /**
     * extensionHのプロパティ名を返却.
     * 
     * @return extensionHのプロパティ名
     */
    public static PropertyName<String> extensionH() {
        return new PropertyName<String>("extensionH");
    }
    
    /**
     * extensionIのプロパティ名を返却.
     * 
     * @return extensionIのプロパティ名
     */
    public static PropertyName<String> extensionI() {
        return new PropertyName<String>("extensionI");
    }
    
    /**
     * extensionJのプロパティ名を返却.
     * 
     * @return extensionJのプロパティ名
     */
    public static PropertyName<String> extensionJ() {
        return new PropertyName<String>("extensionJ");
    }
    
    /**
     * entryTsのプロパティ名を返却.
     * 
     * @return entryTsのプロパティ名
     */
    public static PropertyName<Timestamp> entryTs() {
        return new PropertyName<Timestamp>("entryTs");
    }
    
    /**
     * entryUserCdのプロパティ名を返却.
     * 
     * @return entryUserCdのプロパティ名
     */
    public static PropertyName<String> entryUserCd() {
        return new PropertyName<String>("entryUserCd");
    }
    
    /**
     * renewCntのプロパティ名を返却.
     * 
     * @return renewCntのプロパティ名
     */
    public static PropertyName<Long> renewCnt() {
        return new PropertyName<Long>("renewCnt");
    }
    
    /**
     * renewTsのプロパティ名を返却.
     * 
     * @return renewTsのプロパティ名
     */
    public static PropertyName<Timestamp> renewTs() {
        return new PropertyName<Timestamp>("renewTs");
    }
    
    /**
     * renewUserCdのプロパティ名を返却.
     * 
     * @return renewUserCdのプロパティ名
     */
    public static PropertyName<String> renewUserCd() {
        return new PropertyName<String>("renewUserCd");
    }
    
    /**
     * @author S2JDBC-Gen
     */
    public static class _K99mTutorialNames extends PropertyName<K99mTutorial> {
        
        /**
         * インスタンスを構築.
         */
        public _K99mTutorialNames() {
        }
        
        /**
         * インスタンスを構築.
         * 
         * @param name 名前
         */
        public _K99mTutorialNames(final String name) {
            super(name);
        }
        
        /**
         * インスタンスを構築.
         * 
         * @param parent 親
         * @param name 名前
         */
        public _K99mTutorialNames(final PropertyName<?> parent, final String name) {
            super(parent, name);
        }
        
        /**
         * companyCdのプロパティ名を返却.
         *
         * @return companyCdのプロパティ名
         */
        public PropertyName<String> companyCd() {
            return new PropertyName<String>(this, "companyCd");
        }
        
        /**
         * tutorialCdのプロパティ名を返却.
         *
         * @return tutorialCdのプロパティ名
         */
        public PropertyName<String> tutorialCd() {
            return new PropertyName<String>(this, "tutorialCd");
        }
        
        /**
         * tutorialNameのプロパティ名を返却.
         *
         * @return tutorialNameのプロパティ名
         */
        public PropertyName<String> tutorialName() {
            return new PropertyName<String>(this, "tutorialName");
        }
        
        /**
         * localeIdのプロパティ名を返却.
         *
         * @return localeIdのプロパティ名
         */
        public PropertyName<String> localeId() {
            return new PropertyName<String>(this, "localeId");
        }
        
        /**
         * termCdのプロパティ名を返却.
         *
         * @return termCdのプロパティ名
         */
        public PropertyName<String> termCd() {
            return new PropertyName<String>(this, "termCd");
        }
        
        /**
         * startDateのプロパティ名を返却.
         *
         * @return startDateのプロパティ名
         */
        public PropertyName<Timestamp> startDate() {
            return new PropertyName<Timestamp>(this, "startDate");
        }
        
        /**
         * endDateのプロパティ名を返却.
         *
         * @return endDateのプロパティ名
         */
        public PropertyName<Timestamp> endDate() {
            return new PropertyName<Timestamp>(this, "endDate");
        }
        
        /**
         * deleteFlagのプロパティ名を返却.
         *
         * @return deleteFlagのプロパティ名
         */
        public PropertyName<String> deleteFlag() {
            return new PropertyName<String>(this, "deleteFlag");
        }
        
        /**
         * extensionAのプロパティ名を返却.
         *
         * @return extensionAのプロパティ名
         */
        public PropertyName<String> extensionA() {
            return new PropertyName<String>(this, "extensionA");
        }
        
        /**
         * extensionBのプロパティ名を返却.
         *
         * @return extensionBのプロパティ名
         */
        public PropertyName<String> extensionB() {
            return new PropertyName<String>(this, "extensionB");
        }
        
        /**
         * extensionCのプロパティ名を返却.
         *
         * @return extensionCのプロパティ名
         */
        public PropertyName<String> extensionC() {
            return new PropertyName<String>(this, "extensionC");
        }
        
        /**
         * extensionDのプロパティ名を返却.
         *
         * @return extensionDのプロパティ名
         */
        public PropertyName<String> extensionD() {
            return new PropertyName<String>(this, "extensionD");
        }
        
        /**
         * extensionEのプロパティ名を返却.
         *
         * @return extensionEのプロパティ名
         */
        public PropertyName<String> extensionE() {
            return new PropertyName<String>(this, "extensionE");
        }
        
        /**
         * extensionFのプロパティ名を返却.
         *
         * @return extensionFのプロパティ名
         */
        public PropertyName<String> extensionF() {
            return new PropertyName<String>(this, "extensionF");
        }
        
        /**
         * extensionGのプロパティ名を返却.
         *
         * @return extensionGのプロパティ名
         */
        public PropertyName<String> extensionG() {
            return new PropertyName<String>(this, "extensionG");
        }
        
        /**
         * extensionHのプロパティ名を返却.
         *
         * @return extensionHのプロパティ名
         */
        public PropertyName<String> extensionH() {
            return new PropertyName<String>(this, "extensionH");
        }
        
        /**
         * extensionIのプロパティ名を返却.
         *
         * @return extensionIのプロパティ名
         */
        public PropertyName<String> extensionI() {
            return new PropertyName<String>(this, "extensionI");
        }
        
        /**
         * extensionJのプロパティ名を返却.
         *
         * @return extensionJのプロパティ名
         */
        public PropertyName<String> extensionJ() {
            return new PropertyName<String>(this, "extensionJ");
        }
        
        /**
         * entryTsのプロパティ名を返却.
         *
         * @return entryTsのプロパティ名
         */
        public PropertyName<Timestamp> entryTs() {
            return new PropertyName<Timestamp>(this, "entryTs");
        }
        
        /**
         * entryUserCdのプロパティ名を返却.
         *
         * @return entryUserCdのプロパティ名
         */
        public PropertyName<String> entryUserCd() {
            return new PropertyName<String>(this, "entryUserCd");
        }
        
        /**
         * renewCntのプロパティ名を返却.
         *
         * @return renewCntのプロパティ名
         */
        public PropertyName<Long> renewCnt() {
            return new PropertyName<Long>(this, "renewCnt");
        }
        
        /**
         * renewTsのプロパティ名を返却.
         *
         * @return renewTsのプロパティ名
         */
        public PropertyName<Timestamp> renewTs() {
            return new PropertyName<Timestamp>(this, "renewTs");
        }
        
        /**
         * renewUserCdのプロパティ名を返却.
         *
         * @return renewUserCdのプロパティ名
         */
        public PropertyName<String> renewUserCd() {
            return new PropertyName<String>(this, "renewUserCd");
        }
    }
}

4.1.2.2.2.3. Service

  • Path
    src/main/generated/jp/co/slcs/kaiden2/tutorial/foundation/model/service/K99mTutorialService.java
package jp.co.slcs.kaiden2.tutorial.foundation.model.service;

import javax.annotation.Generated;
import jp.co.slcs.kaiden2.base.foundation.model.service.GenerateService;
import jp.co.slcs.kaiden2.tutorial.foundation.model.entity.K99mTutorial;

/**
 * {@link K99mTutorial}のサービスクラス.
 * 
 * @author Sumitomo Life Information Systems Co.,Ltd.
 */
@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.ServiceModelFactoryImpl" })
public final class K99mTutorialService extends GenerateService<K99mTutorial> {
    //
}

4.1.2.2.2.4. Condition

  • Path
    src/main/generated/jp/co/slcs/kaiden2/tutorial/foundation/model/service/K99mTutorialCondition.java
package jp.co.slcs.kaiden2.tutorial.foundation.model.service;

import java.sql.Timestamp;
import javax.annotation.Generated;
import org.seasar.extension.jdbc.where.ComplexWhere;
import org.seasar.extension.jdbc.where.condition.AbstractEntityCondition;
import org.seasar.extension.jdbc.where.condition.NotNullableCondition;
import org.seasar.extension.jdbc.where.condition.NotNullableStringCondition;
import org.seasar.extension.jdbc.where.condition.NullableStringCondition;

/**
 * {@link K99mTutorial}の条件クラス.
 * 
 * @author Sumitomo Life Information Systems Co.,Ltd.
 */
@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.ConditionModelFactoryImpl" })
public final class K99mTutorialCondition extends
        AbstractEntityCondition<K99mTutorialCondition> {
    
    /**
     * インスタンスを構築.
     */
    public K99mTutorialCondition() {
    }
    
    /**
     * インスタンスを構築.
     * 
     * @param prefix プレフィックス
     * @param where 検索条件
     */
    public K99mTutorialCondition(String prefix, ComplexWhere where) {
        super(prefix, where);
    }
    
    /** companyCdの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> companyCd =
        new NotNullableStringCondition<K99mTutorialCondition>("companyCd", this);
    
    /** tutorialCdの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> tutorialCd =
        new NotNullableStringCondition<K99mTutorialCondition>("tutorialCd", this);
    
    /** tutorialNameの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> tutorialName =
        new NotNullableStringCondition<K99mTutorialCondition>("tutorialName", this);
    
    /** localeIdの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> localeId =
        new NotNullableStringCondition<K99mTutorialCondition>("localeId", this);
    
    /** termCdの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> termCd =
        new NotNullableStringCondition<K99mTutorialCondition>("termCd", this);
    
    /** startDateの条件. */
    public NotNullableCondition<K99mTutorialCondition, Timestamp> startDate =
        new NotNullableCondition<K99mTutorialCondition, Timestamp>("startDate", this);
    
    /** endDateの条件. */
    public NotNullableCondition<K99mTutorialCondition, Timestamp> endDate =
        new NotNullableCondition<K99mTutorialCondition, Timestamp>("endDate", this);
    
    /** deleteFlagの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> deleteFlag =
        new NotNullableStringCondition<K99mTutorialCondition>("deleteFlag", this);
    
    /** extensionAの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionA =
        new NullableStringCondition<K99mTutorialCondition>("extensionA", this);
    
    /** extensionBの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionB =
        new NullableStringCondition<K99mTutorialCondition>("extensionB", this);
    
    /** extensionCの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionC =
        new NullableStringCondition<K99mTutorialCondition>("extensionC", this);
    
    /** extensionDの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionD =
        new NullableStringCondition<K99mTutorialCondition>("extensionD", this);
    
    /** extensionEの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionE =
        new NullableStringCondition<K99mTutorialCondition>("extensionE", this);
    
    /** extensionFの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionF =
        new NullableStringCondition<K99mTutorialCondition>("extensionF", this);
    
    /** extensionGの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionG =
        new NullableStringCondition<K99mTutorialCondition>("extensionG", this);
    
    /** extensionHの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionH =
        new NullableStringCondition<K99mTutorialCondition>("extensionH", this);
    
    /** extensionIの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionI =
        new NullableStringCondition<K99mTutorialCondition>("extensionI", this);
    
    /** extensionJの条件. */
    public NullableStringCondition<K99mTutorialCondition> extensionJ =
        new NullableStringCondition<K99mTutorialCondition>("extensionJ", this);
    
    /** entryTsの条件. */
    public NotNullableCondition<K99mTutorialCondition, Timestamp> entryTs =
        new NotNullableCondition<K99mTutorialCondition, Timestamp>("entryTs", this);
    
    /** entryUserCdの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> entryUserCd =
        new NotNullableStringCondition<K99mTutorialCondition>("entryUserCd", this);
    
    /** renewCntの条件. */
    public NotNullableCondition<K99mTutorialCondition, Long> renewCnt =
        new NotNullableCondition<K99mTutorialCondition, Long>("renewCnt", this);
    
    /** renewTsの条件. */
    public NotNullableCondition<K99mTutorialCondition, Timestamp> renewTs =
        new NotNullableCondition<K99mTutorialCondition, Timestamp>("renewTs", this);
    
    /** renewUserCdの条件. */
    public NotNullableStringCondition<K99mTutorialCondition> renewUserCd =
        new NotNullableStringCondition<K99mTutorialCondition>("renewUserCd", this);
}