]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/RevisionTGValueModifier.java
Index query fixes after commit 4e7fd7de
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / RevisionTGValueModifier.java
1 package org.simantics.db.layer0.util;
2
3 import org.simantics.databoard.binding.Binding;
4 import org.simantics.databoard.type.Datatype;
5 import org.simantics.databoard.type.LongType;
6 import org.simantics.db.exception.DatabaseException;
7
8 public enum RevisionTGValueModifier implements TGValueModifier {
9     INSTANCE;
10     
11     public static final Long DEFAULT_VALUE = Long.valueOf(-1); 
12     
13     @Override
14     public boolean mayNeedModification(Datatype type) {
15         return type instanceof LongType 
16                 && "revision".equals(type.metadata.get("unit"));
17     }
18
19     @Override
20     public Object modify(final DomainProcessorState state, Binding binding, Object value) throws DatabaseException {
21         return DEFAULT_VALUE;
22     }
23 }