diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java index 9bee5c878f598c81375413c54bd42fb19d6a1692..183bb63a72f2c8caeb4091f9bfc1960001ad980c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/AbstractEntityProperty.java @@ -32,6 +32,8 @@ public abstract class AbstractEntityProperty implements IEntityProperty private PropertyType propertyType; + private Long ordinal; + public PropertyType getPropertyType() { return propertyType; @@ -94,12 +96,28 @@ public abstract class AbstractEntityProperty implements IEntityProperty { } + public void setOrdinal(Long ordinal) + { + this.ordinal = ordinal; + } + + public Long getOrdinal() + { + return ordinal; + } + // // Comparable // public int compareTo(IEntityProperty o) { + Long thisOrdinal = this.getOrdinal(); + Long otherOrdinal = o.getOrdinal(); + if (thisOrdinal != null && otherOrdinal != null) + { + return thisOrdinal.compareTo(otherOrdinal); + } PropertyType thisPropertyType = this.getPropertyType(); PropertyType otherPropertyType = o.getPropertyType(); if (thisPropertyType.getLabel().equals(otherPropertyType.getLabel())) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java index 57dc61f542e885a4c3c3da318635eb65df32711d..9ed120984fe44fe97314dc10f90728fb413b6a89 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/IEntityProperty.java @@ -51,4 +51,8 @@ public interface IEntityProperty extends Serializable, IsSerializable, Comparabl public void setPropertyType(final PropertyType propertyType); + void setOrdinal(Long ordinal); + + Long getOrdinal(); + } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java index 6282edf4f1a5fe042922689121dae0d163c88f5c..291ce73f26b2f9c1f4b1eedb0e58a4dd64b5b9aa 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java @@ -48,6 +48,7 @@ public final class EntityPropertyTranslator final IEntityProperty result = PropertyTranslatorUtils.createEntityProperty(typeCode); result.setPropertyType(PropertyTypeTranslator.translate(propertyPE .getEntityTypePropertyType().getPropertyType(), cacheOrNull)); + result.setOrdinal(propertyPE.getEntityTypePropertyType().getOrdinal()); switch (typeCode) { case CONTROLLEDVOCABULARY: