io.ebeaninternal.server.persist.dmlbind.FactoryAssocOnes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.persist.dmlbind;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.deploy.BeanPropertyAssocOne;
import io.ebeaninternal.server.persist.dml.DmlMode;
import java.util.List;
/**
* A factory that builds Bindable for BeanPropertyAssocOne properties.
*/
public class FactoryAssocOnes {
public FactoryAssocOnes() {
}
/**
* Add foreign key columns from associated one beans.
*/
public void create(List list, BeanDescriptor> desc, DmlMode mode) {
BeanPropertyAssocOne>[] ones = desc.propertiesOneImported();
for (BeanPropertyAssocOne> one : ones) {
if (!one.isImportedPrimaryKey()) {
switch (mode) {
case INSERT:
if (!one.isInsertable()) {
continue;
}
break;
case UPDATE:
if (!one.isUpdateable()) {
continue;
}
break;
}
list.add(new BindableAssocOne(one));
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy