import org.simantics.databoard.binding.Binding;
import org.simantics.databoard.binding.impl.ObjectVariantBinding;
import org.simantics.databoard.type.Datatype;
import org.simantics.databoard.binding.Binding;
import org.simantics.databoard.binding.impl.ObjectVariantBinding;
import org.simantics.databoard.type.Datatype;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.WriteGraph;
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
import org.simantics.db.common.validation.L0Validations;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.WriteGraph;
import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
import org.simantics.db.common.validation.L0Validations;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.exception.MissingVariableValueException;
import org.simantics.db.layer0.exception.PendingVariableException;
import org.simantics.db.layer0.exception.MissingVariableValueException;
import org.simantics.db.layer0.exception.PendingVariableException;
import org.simantics.db.layer0.function.All;
import org.simantics.db.layer0.request.PropertyInfo;
import org.simantics.db.layer0.request.PropertyInfoRequest;
import org.simantics.db.layer0.function.All;
import org.simantics.db.layer0.request.PropertyInfo;
import org.simantics.db.layer0.request.PropertyInfoRequest;
import org.simantics.db.layer0.util.Layer0Utils;
import org.simantics.layer0.Layer0;
import org.simantics.utils.Development;
import org.simantics.db.layer0.util.Layer0Utils;
import org.simantics.layer0.Layer0;
import org.simantics.utils.Development;
private static final Logger LOGGER = LoggerFactory.getLogger(StandardGraphPropertyVariable.class);
protected static final PropertyInfo NO_PROPERTY = new PropertyInfo(null, null,
private static final Logger LOGGER = LoggerFactory.getLogger(StandardGraphPropertyVariable.class);
protected static final PropertyInfo NO_PROPERTY = new PropertyInfo(null, null,
- false, Collections.<String> emptySet(), null, null, null, null, null, null,
+ false, false, Collections.<String> emptySet(), null, null, null, null, null, null,
Collections.<String, Pair<Resource, ChildReference>> emptyMap(),
null, false);
Collections.<String, Pair<Resource, ChildReference>> emptyMap(),
null, false);
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- //throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }
- return (T)getValueAccessor(graph).getValue(graph, this, binding);
- } catch (PendingVariableException e) {
- throw e;
+ return (T) getValueAccessor(graph).getValue(graph, this, binding);
+ } catch (SCLDatabaseException e) { // these can be thrown when compiling e.g. derived properties
+ throw e;
+ } catch (MissingVariableValueException | PendingVariableException e) {
+ throw e;
public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {
if(Development.DEVELOPMENT) {
public void setValue(WriteGraph graph, Object value, Binding binding) throws DatabaseException {
if(Development.DEVELOPMENT) {
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- //throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }
public void setValue(WriteGraph graph, Object value) throws DatabaseException {
if(Development.DEVELOPMENT) {
public void setValue(WriteGraph graph, Object value) throws DatabaseException {
if(Development.DEVELOPMENT) {
- String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
- if(error != null) {
- LOGGER.error(error);
- throw new ValidationException(error);
+ if(Development.<Boolean>getProperty(DevelopmentKeys.L0_VALIDATION, Bindings.BOOLEAN)) {
+ String error = L0Validations.checkValueType(graph, parentResource, property.predicate);
+ if(error != null) {
+ LOGGER.error(error);
+ throw new ValidationException(error);
+ }