org.zodiac.fastorm.rdb.mapping.LazyEntityColumnMapping Maven / Gradle / Ivy
The newest version!
package org.zodiac.fastorm.rdb.mapping;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;
import org.zodiac.fastorm.rdb.metadata.RDBColumnMetadata;
import org.zodiac.fastorm.rdb.metadata.TableOrViewMetadata;
public abstract class LazyEntityColumnMapping implements EntityColumnMapping {
public abstract EntityColumnMapping getMapping();
@Override
public TableOrViewMetadata getTable() {
return getMapping().getTable();
}
@Override
public Optional getColumnByProperty(String property) {
return getMapping().getColumnByProperty(property);
}
@Override
public Optional getPropertyByColumnName(String columnName) {
return getMapping().getPropertyByColumnName(columnName);
}
@Override
public Optional getColumnByName(String columnName) {
return getMapping().getColumnByName(columnName);
}
@Override
public Map getColumnPropertyMapping() {
return getMapping().getColumnPropertyMapping();
}
@Override
public String getId() {
return getMapping().getId();
}
@Override
public String getName() {
return getMapping().getName();
}
@Override
public Class> getEntityType() {
return getMapping().getEntityType();
}
@Override
public Object newInstance() {
return getMapping().newInstance();
}
@Override
public void reload() {
getMapping().reload();
}
public static LazyEntityColumnMapping of(Supplier mappingSupplier) {
return new LazyEntityColumnMapping() {
@Override
public EntityColumnMapping getMapping() {
return mappingSupplier.get();
}
};
}
}