/**
  * 一対多の関連を処理します。
  *
  * @param propertyMeta プロパティメタデータ
  * @param field フィールド
  * @param entityMeta エンティティメタデータ
  * @param oneToMany 一対多関連
  */
 protected void doOneToMany(
     PropertyMeta propertyMeta, Field field, EntityMeta entityMeta, OneToMany oneToMany) {
   propertyMeta.setRelationshipType(RelationshipType.ONE_TO_MANY);
   if (!List.class.isAssignableFrom(field.getType())) {
     throw new OneToManyNotListRuntimeException(entityMeta.getName(), propertyMeta.getName());
   }
   Class<?> relationshipClass = ReflectionUtil.getElementTypeOfList(field.getGenericType());
   if (relationshipClass == null) {
     throw new OneToManyNotGenericsRuntimeException(entityMeta.getName(), propertyMeta.getName());
   }
   if (relationshipClass.getAnnotation(Entity.class) == null) {
     throw new RelationshipNotEntityRuntimeException(
         entityMeta.getName(), propertyMeta.getName(), relationshipClass);
   }
   propertyMeta.setRelationshipClass(relationshipClass);
   String mappedBy = oneToMany.mappedBy();
   if (!StringUtil.isEmpty(mappedBy)) {
     if (propertyMeta.getJoinColumnMetaList().size() > 0) {
       throw new BothMappedByAndJoinColumnRuntimeException(
           entityMeta.getName(), propertyMeta.getName());
     }
     propertyMeta.setMappedBy(mappedBy);
   } else {
     throw new MappedByMandatoryRuntimeException(entityMeta.getName(), propertyMeta.getName());
   }
 }
 /**
  * 多対一の関連を処理します。
  *
  * @param propertyMeta プロパティメタデータ
  * @param field フィールド
  * @param entityMeta エンティティメタデータ
  * @param manyToOne 多対一関連
  */
 protected void doManyToOne(
     PropertyMeta propertyMeta,
     Field field,
     EntityMeta entityMeta,
     @SuppressWarnings("unused") ManyToOne manyToOne) {
   propertyMeta.setRelationshipType(RelationshipType.MANY_TO_ONE);
   Class<?> relationshipClass = field.getType();
   if (relationshipClass.getAnnotation(Entity.class) == null) {
     throw new RelationshipNotEntityRuntimeException(
         entityMeta.getName(), propertyMeta.getName(), relationshipClass);
   }
   propertyMeta.setRelationshipClass(relationshipClass);
 }
 /**
  * 一対一の関連を処理します。
  *
  * @param propertyMeta プロパティメタデータ
  * @param field フィールド
  * @param entityMeta エンティティメタデータ
  * @param oneToOne 一対一関連
  */
 protected void doOneToOne(
     PropertyMeta propertyMeta, Field field, EntityMeta entityMeta, OneToOne oneToOne) {
   propertyMeta.setRelationshipType(RelationshipType.ONE_TO_ONE);
   Class<?> relationshipClass = field.getType();
   if (relationshipClass.getAnnotation(Entity.class) == null) {
     throw new RelationshipNotEntityRuntimeException(
         entityMeta.getName(), propertyMeta.getName(), relationshipClass);
   }
   propertyMeta.setRelationshipClass(relationshipClass);
   String mappedBy = oneToOne.mappedBy();
   if (!StringUtil.isEmpty(mappedBy)) {
     if (propertyMeta.getJoinColumnMetaList().size() > 0) {
       throw new BothMappedByAndJoinColumnRuntimeException(
           entityMeta.getName(), propertyMeta.getName());
     }
     propertyMeta.setMappedBy(mappedBy);
   }
 }