Search in sources :

Example 11 with DynamicPropertySet

use of com.developmentontheedge.beans.DynamicPropertySet in project be5 by DevelopmentOnTheEdge.

the class EntityModelBase method add.

@Override
public String add(Map<String, ? super Object> values) {
    Objects.requireNonNull(values);
    DynamicPropertySet dps = new DynamicPropertySetSupport();
    dpsHelper.addDpForColumnsWithoutTags(dps, entity, values.keySet(), values);
    return add(dps);
}
Also used : DynamicPropertySet(com.developmentontheedge.beans.DynamicPropertySet) DynamicPropertySetSupport(com.developmentontheedge.beans.DynamicPropertySetSupport)

Example 12 with DynamicPropertySet

use of com.developmentontheedge.beans.DynamicPropertySet in project be5 by DevelopmentOnTheEdge.

the class EntityModelBase method set.

@Override
public int set(String id, Map<String, ? super Object> values) {
    Objects.requireNonNull(id);
    Objects.requireNonNull(values);
    DynamicPropertySet dps = new DynamicPropertySetSupport();
    dpsHelper.addDpForColumnsWithoutTags(dps, entity, values.keySet(), values);
    return this.set(id, dps);
}
Also used : DynamicPropertySet(com.developmentontheedge.beans.DynamicPropertySet) DynamicPropertySetSupport(com.developmentontheedge.beans.DynamicPropertySetSupport)

Example 13 with DynamicPropertySet

use of com.developmentontheedge.beans.DynamicPropertySet in project be5 by DevelopmentOnTheEdge.

the class EntityModelBase method getColumns.

@Override
public RecordModel getColumns(List<String> columns, Map<String, ? super Object> conditions) {
    Objects.requireNonNull(conditions);
    AstSelect sql = Ast.select(addPrimaryKeyColumnIfNotEmpty(columns)).from(entity.getName()).where(conditions);
    DynamicPropertySet dps = db.select(sql.format(), rs -> {
        DynamicPropertySet newDps = new DynamicPropertySetSupport();
        dpsHelper.addDpWithoutTags(newDps, entity, rs);
        return newDps;
    }, conditions.values().toArray());
    return dps == null ? null : new RecordModelBase(this, dps);
}
Also used : AstSelect(com.developmentontheedge.sql.model.AstSelect) DynamicPropertySet(com.developmentontheedge.beans.DynamicPropertySet) DynamicPropertySetSupport(com.developmentontheedge.beans.DynamicPropertySetSupport)

Example 14 with DynamicPropertySet

use of com.developmentontheedge.beans.DynamicPropertySet in project be5 by DevelopmentOnTheEdge.

the class FilterByParamsInQueryOperation method getParameters.

@Override
public Object getParameters(Map<String, Object> presetValues) throws Exception {
    DynamicPropertySet dps = new DynamicPropertySetSupport();
    dpsHelper.addParamsFromQuery(dps, getInfo().getModel(), getQuery());
    return filterHelper.processFilterParams(dps, presetValues, context.getOperationParams());
}
Also used : DynamicPropertySet(com.developmentontheedge.beans.DynamicPropertySet) DynamicPropertySetSupport(com.developmentontheedge.beans.DynamicPropertySetSupport)

Example 15 with DynamicPropertySet

use of com.developmentontheedge.beans.DynamicPropertySet in project be5 by DevelopmentOnTheEdge.

the class SilentEditOperation method getParameters.

@Override
public Object getParameters(Map<String, Object> presetValues) throws Exception {
    Entity entity = getInfo().getEntity();
    DynamicPropertySet dps = dpsHelper.addDpExcludeAutoIncrement(new DynamicPropertySetSupport(), getInfo().getModel());
    dpsHelper.setValues(dps, database.getEntity(entity.getName()).get(context.records[0]));
    dpsHelper.setOperationParams(dps, context.getOperationParams());
    return dpsHelper.setValues(dps, presetValues);
}
Also used : DynamicPropertySet(com.developmentontheedge.beans.DynamicPropertySet) Entity(com.developmentontheedge.be5.metadata.model.Entity) DynamicPropertySetSupport(com.developmentontheedge.beans.DynamicPropertySetSupport)

Aggregations

DynamicPropertySet (com.developmentontheedge.beans.DynamicPropertySet)17 DynamicPropertySetSupport (com.developmentontheedge.beans.DynamicPropertySetSupport)11 DynamicProperty (com.developmentontheedge.beans.DynamicProperty)7 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Map (java.util.Map)3 Be5Exception (com.developmentontheedge.be5.api.exceptions.Be5Exception)2 HashMap (java.util.HashMap)2 SEARCH_PARAM (com.developmentontheedge.be5.api.FrontendConstants.SEARCH_PARAM)1 SEARCH_PRESETS_PARAM (com.developmentontheedge.be5.api.FrontendConstants.SEARCH_PRESETS_PARAM)1 Entity (com.developmentontheedge.be5.metadata.model.Entity)1 Query (com.developmentontheedge.be5.metadata.model.Query)1 JsonApiModel (com.developmentontheedge.be5.model.jsonapi.JsonApiModel)1 DocumentGenerator (com.developmentontheedge.be5.query.DocumentGenerator)1 SqlMockOperationTest (com.developmentontheedge.be5.test.SqlMockOperationTest)1 BeanInfoConstants (com.developmentontheedge.beans.BeanInfoConstants)1 DynamicPropertyBuilder (com.developmentontheedge.beans.DynamicPropertyBuilder)1 ColumnRef (com.developmentontheedge.sql.format.ColumnRef)1 FilterApplier (com.developmentontheedge.sql.format.FilterApplier)1 Formatter (com.developmentontheedge.sql.format.Formatter)1