io.ebeaninternal.server.persist.dml.GeneratedPropertyCollector 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.dml;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.deploy.BeanProperty;
import io.ebeaninternal.server.deploy.generatedproperty.GeneratedProperty;
import java.util.ArrayList;
import java.util.List;
/**
* Collects the generated properties for inserts and updates for a given bean type.
*/
class GeneratedPropertyCollector {
private final List preInsert = new ArrayList<>();
private final List preUpdate = new ArrayList<>();
GeneratedPropertyCollector(BeanDescriptor> desc) {
for (BeanProperty beanProperty : desc.propertiesBaseScalar()) {
add(beanProperty);
}
}
GeneratedProperties generatedProperties() {
return new GeneratedProperties(preInsert, preUpdate);
}
void add(BeanProperty prop) {
GeneratedProperty gen = prop.getGeneratedProperty();
if (gen != null) {
if (gen.includeInInsert()) {
preInsert.add(prop);
}
if (gen.includeInUpdate()) {
preUpdate.add(prop);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy