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

io.ebeaninternal.server.persist.dmlbind.FactoryProperty Maven / Gradle / Ivy

There is a newer version: 15.8.1
Show newest version
package io.ebeaninternal.server.persist.dmlbind;

import io.ebeaninternal.server.deploy.BeanProperty;
import io.ebeaninternal.server.persist.dml.DmlMode;

/**
 * Creates the appropriate Bindable for a BeanProperty.
 * 

* Lob properties can be excluded and it creates BindablePropertyInsertGenerated * and BindablePropertyUpdateGenerated as required. *

*/ public class FactoryProperty { private final boolean bindEncryptDataFirst; public FactoryProperty(boolean bindEncryptDataFirst) { this.bindEncryptDataFirst = bindEncryptDataFirst; } /** * Create a Bindable for the property given the mode and withLobs flag. */ public Bindable create(BeanProperty prop, DmlMode mode, boolean withLobs) { if (DmlMode.INSERT == mode && !prop.isDbInsertable()) { return null; } if (DmlMode.UPDATE == mode && !prop.isDbUpdatable()) { return null; } if (prop.isLob()) { if (!withLobs) { // Lob exclusion return null; } else { return prop.isDbEncrypted() ? new BindableEncryptedProperty(prop, bindEncryptDataFirst) : new BindableProperty(prop); } } return prop.isDbEncrypted() ? new BindableEncryptedProperty(prop, bindEncryptDataFirst) : new BindableProperty(prop); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy