org.seasar.extension.jdbc.gen.internal.desc
クラス AssociationResolver

java.lang.Object
  上位を拡張 org.seasar.extension.jdbc.gen.internal.desc.AssociationResolver

public class AssociationResolver
extends java.lang.Object

エンティティ記述の関連を解決するクラスです。

作成者:
taedium

フィールドの概要
protected  EntitySetDesc entitySetDesc
          エンティティ集合記述
protected  PersistenceConvention persistenceConvention
          永続化層の命名規約
protected  PluralFormDictinary pluralFormDictinary
          単語を複数形に変換するための辞書
protected static java.lang.String TO_MANY_ASSOCIATION_NAME_SUFFIX
          多側に対する関連名のサフィックス
 
コンストラクタの概要
AssociationResolver(EntitySetDesc entitySetDesc, PluralFormDictinary pluralFormDictinary, PersistenceConvention persistenceConvention)
          インスタンスを構築します。
 
メソッドの概要
protected  void adjustAttributeNames(DbForeignKeyMeta fkMeta, EntityDesc entityDesc, java.lang.String associationName)
          エンティティ記述のすべての属性について必要であれば名前を調整します。
protected  void doInverseAssociationDesc(DbForeignKeyMeta fkMeta, EntityDesc ownerEntityDesc, EntityDesc inverseEntityDesc, java.lang.String mappedBy)
          被所有側の関連を処理します。
protected  AssociationDesc doOwnerAssociationDesc(DbForeignKeyMeta fkMeta, EntityDesc ownerEntityDesc, EntityDesc inverseEntityDesc)
          所有側の関連を処理します。
protected  java.lang.String getInverseAssociationName(EntityDesc inverseEntityDesc, EntityDesc ownerEntityDesc, boolean oneToMany)
          関連名を返します。
protected  java.lang.String getOwnerAssociationName(DbForeignKeyMeta fkMeta, EntityDesc ownerEntityDesc, EntityDesc inverseEntityDesc)
          関連の所有側の関連名を返します。
protected  java.lang.String pluralizeName(java.lang.String name)
          名前を複数形に変換します。
 void resolve(DbTableMeta tableMeta, DbForeignKeyMeta fkMeta)
          関連を解決します。
protected  java.lang.String toUniqueAssociationName(EntityDesc entityDesc, java.lang.String candidateName)
          一意の関連名に変換します。
protected  java.lang.String toUniqueAttributeName(EntityDesc entityDesc, java.lang.String candidateName)
          一意な属性名に変換します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

TO_MANY_ASSOCIATION_NAME_SUFFIX

protected static java.lang.String TO_MANY_ASSOCIATION_NAME_SUFFIX
多側に対する関連名のサフィックス


entitySetDesc

protected EntitySetDesc entitySetDesc
エンティティ集合記述


pluralFormDictinary

protected PluralFormDictinary pluralFormDictinary
単語を複数形に変換するための辞書


persistenceConvention

protected PersistenceConvention persistenceConvention
永続化層の命名規約

コンストラクタの詳細

AssociationResolver

public AssociationResolver(EntitySetDesc entitySetDesc,
                           PluralFormDictinary pluralFormDictinary,
                           PersistenceConvention persistenceConvention)
インスタンスを構築します。

パラメータ:
entitySetDesc - エンティティ集合記述
pluralFormDictinary - 単語を複数形に変換するための辞書
persistenceConvention - 永続化層の命名規約
メソッドの詳細

resolve

public void resolve(DbTableMeta tableMeta,
                    DbForeignKeyMeta fkMeta)
関連を解決します。

パラメータ:
tableMeta - テーブルメタデータ
fkMeta - 外部キーメタデータ

doOwnerAssociationDesc

protected AssociationDesc doOwnerAssociationDesc(DbForeignKeyMeta fkMeta,
                                                 EntityDesc ownerEntityDesc,
                                                 EntityDesc inverseEntityDesc)
所有側の関連を処理します。

パラメータ:
fkMeta - 外部キーメタデータ
ownerEntityDesc - 関連の所有者側のエンティティ記述
inverseEntityDesc - 関連の被所有者側のエンティティ記述
戻り値:

adjustAttributeNames

protected void adjustAttributeNames(DbForeignKeyMeta fkMeta,
                                    EntityDesc entityDesc,
                                    java.lang.String associationName)
エンティティ記述のすべての属性について必要であれば名前を調整します。

パラメータ:
fkMeta - 外部キーメタデータ
entityDesc - エンティティ記述
associationName - 関連名

toUniqueAttributeName

protected java.lang.String toUniqueAttributeName(EntityDesc entityDesc,
                                                 java.lang.String candidateName)
一意な属性名に変換します。

パラメータ:
entityDesc - エンティティ記述
candidateName - 候補の属性名
戻り値:
一意な属性名

doInverseAssociationDesc

protected void doInverseAssociationDesc(DbForeignKeyMeta fkMeta,
                                        EntityDesc ownerEntityDesc,
                                        EntityDesc inverseEntityDesc,
                                        java.lang.String mappedBy)
被所有側の関連を処理します。

パラメータ:
fkMeta - 外部キーメタデータ
ownerEntityDesc - 関連の所有者側のエンティティ記述
inverseEntityDesc - 関連の被所有者側のエンティティ記述
mappedBy - 関連の所有者側のプロパティ名

getOwnerAssociationName

protected java.lang.String getOwnerAssociationName(DbForeignKeyMeta fkMeta,
                                                   EntityDesc ownerEntityDesc,
                                                   EntityDesc inverseEntityDesc)
関連の所有側の関連名を返します。

パラメータ:
fkMeta - 外部キーメタデータ
ownerEntityDesc - 関連の所有者側のエンティティ記述
inverseEntityDesc - 関連の被所有者側のエンティティ記述
戻り値:
関連の所有側の関連名

getInverseAssociationName

protected java.lang.String getInverseAssociationName(EntityDesc inverseEntityDesc,
                                                     EntityDesc ownerEntityDesc,
                                                     boolean oneToMany)
関連名を返します。

パラメータ:
inverseEntityDesc - 参照する側のエンティティ記述
ownerEntityDesc - 参照される側のエンティティ記述
oneToMany - 関連がOneToManyの場合true
戻り値:
関連名

toUniqueAssociationName

protected java.lang.String toUniqueAssociationName(EntityDesc entityDesc,
                                                   java.lang.String candidateName)
一意の関連名に変換します。

パラメータ:
entityDesc - エンティティ記述
candidateName - 候補の関連名
戻り値:
一意の関連名

pluralizeName

protected java.lang.String pluralizeName(java.lang.String name)
名前を複数形に変換します。

パラメータ:
name - 名前
戻り値:
複数形に変換された名前


Copyright © 2004-2014 The Seasar Foundation. All Rights Reserved.