Search in sources :

Example 11 with DynamicPropertySetSupport

use of com.developmentontheedge.beans.DynamicPropertySetSupport 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)

Example 12 with DynamicPropertySetSupport

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

the class TestOperation method getParameters.

@Override
public Object getParameters(Map<String, Object> presetValues) throws Exception {
    DynamicPropertySet dps = new DynamicPropertySetSupport();
    dps.add(new DynamicProperty("name", "Name", String.class, presetValues.getOrDefault("name", "")));
    dps.add(new DynamicProperty("number", "Number", Long.class, presetValues.getOrDefault("number", "0")));
    return dps;
}
Also used : DynamicPropertySet(com.developmentontheedge.beans.DynamicPropertySet) DynamicProperty(com.developmentontheedge.beans.DynamicProperty) DynamicPropertySetSupport(com.developmentontheedge.beans.DynamicPropertySetSupport)

Aggregations

DynamicPropertySetSupport (com.developmentontheedge.beans.DynamicPropertySetSupport)12 DynamicPropertySet (com.developmentontheedge.beans.DynamicPropertySet)11 DynamicProperty (com.developmentontheedge.beans.DynamicProperty)4 Be5Exception (com.developmentontheedge.be5.api.exceptions.Be5Exception)2 Entity (com.developmentontheedge.be5.metadata.model.Entity)1 SqlMockOperationTest (com.developmentontheedge.be5.test.SqlMockOperationTest)1 Formatter (com.developmentontheedge.sql.format.Formatter)1 AstBeSqlSubQuery (com.developmentontheedge.sql.model.AstBeSqlSubQuery)1 AstSelect (com.developmentontheedge.sql.model.AstSelect)1 SQLException (java.sql.SQLException)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 Test (org.junit.Test)1