All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.ebeaninternal.dbmigration.model.build.ModelBuildElementTable Maven / Gradle / Ivy

There is a newer version: 15.8.0
Show newest version
package io.ebeaninternal.dbmigration.model.build;

import io.ebeaninternal.dbmigration.model.MTable;
import io.ebeaninternal.server.deploy.visitor.VisitProperties;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.deploy.BeanPropertyAssocMany;
import io.ebeaninternal.server.deploy.BeanTable;

/**
 * Add the element collection table to the model.
 */
public class ModelBuildElementTable {

  /**
   * Build and add the MTable model for the ElementCollection property.
   */
  public static void build(ModelBuildContext ctx, BeanPropertyAssocMany manyProp) {

    BeanTable beanTable = manyProp.beanTable();
    BeanDescriptor targetDescriptor = manyProp.targetDescriptor();
    MTable table = new MTable(beanTable.getBaseTable(), manyProp.descriptor());

    VisitProperties.visit(targetDescriptor, new ModelBuildPropertyVisitor(ctx, table, targetDescriptor));
    ctx.addTableElementCollection(table);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy