public PreparedStatement prepareSelectAll(Session session, EntityMeta entityMeta) {
log.trace("Generate prepared statement for SELECT of {}", entityMeta);
PropertyMeta idMeta = entityMeta.getIdMeta();
final EntityMetaConfig metaConfig = entityMeta.config();
Selection select = select();
for (PropertyMeta pm : entityMeta.forOperations().getColumnsMetaToLoad()) {
select = pm.forStatementGeneration().prepareSelectField(select);
}
Select from = select.from(metaConfig.getKeyspaceName(), metaConfig.getTableName());
Optional<PropertyMeta> staticMeta = Optional.absent();
if (entityMeta.structure().hasOnlyStaticColumns()) {
staticMeta = Optional.fromNullable(entityMeta.getAllMetasExceptId().get(0));
}