io.ebeaninternal.server.deploy.id.IdBinderFactory 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.deploy.id;
import io.ebeaninternal.server.deploy.BeanProperty;
import io.ebeaninternal.server.deploy.BeanPropertyAssocOne;
/**
* Creates the appropriate IdConvertSet depending on the type of Id property(s).
*/
public class IdBinderFactory {
private static final IdBinderEmpty EMPTY = new IdBinderEmpty();
private final boolean idInExpandedForm;
public IdBinderFactory(boolean idInExpandedForm) {
this.idInExpandedForm = idInExpandedForm;
}
/**
* Create the IdConvertSet for the given type of Id properties.
*/
public IdBinder createIdBinder(BeanProperty id) {
if (id == null) {
// for report type beans that don't need an id
return EMPTY;
}
if (id.isEmbedded()) {
return new IdBinderEmbedded(idInExpandedForm, (BeanPropertyAssocOne>) id);
} else {
return new IdBinderSimple(id);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy