package io.ebeaninternal.server.persist.dmlbind;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.deploy.BeanProperty;
import io.ebeaninternal.server.deploy.BeanPropertyAssocOne;
public class FactoryVersion {
public FactoryVersion() {
}
public Bindable create(BeanDescriptor<?> desc) {
BeanProperty versionProperty = desc.getVersionProperty();
return (versionProperty == null) ? null : new BindablePropertyVersion(versionProperty);
}
public Bindable createForDelete(BeanDescriptor<?> desc) {
BeanProperty versionProperty = desc.getVersionProperty();
return (versionProperty == null) ? null : new BindableProperty(versionProperty);
}
public Bindable createTenantId(BeanDescriptor<?> desc) {
BeanProperty tenant = desc.getTenantProperty();
if (tenant == null) {
return null;
} else if (tenant instanceof BeanPropertyAssocOne) {
return new BindableAssocTenant((BeanPropertyAssocOne<?>) tenant);
} else {
return new BindableProperty(tenant);
}
}
}