some property names are overwritten in api

This commit is contained in:
Peter Hormanns 2015-12-23 16:52:28 +01:00
parent 52c0ae091c
commit 0be76b6c23
3 changed files with 7 additions and 2 deletions

View File

@ -13,4 +13,5 @@ public @interface AnnFieldIO {
Class<?> referTo() default Void.class;
Class<? extends DefaultSelectableValues> selectableValues() default DefaultSelectableValues.class;
String[] referredProps() default { };
String overwriteName() default "";
}

View File

@ -69,11 +69,11 @@ public class UnixUser extends AbstractEntity implements Serializable {
@Column(name = "locked", columnDefinition = "boolean")
private boolean locked;
@AnnFieldIO(validation="[0-9]*", rw=ReadWriteAccess.READWRITE)
@AnnFieldIO(validation="[0-9]*", rw=ReadWriteAccess.READWRITE, overwriteName="quota_softlimit")
@Column(name = "quota_softlimit", columnDefinition = "integer")
private Integer quotaSoftlimit;
@AnnFieldIO(validation="[0-9]*", rw=ReadWriteAccess.READWRITE)
@AnnFieldIO(validation="[0-9]*", rw=ReadWriteAccess.READWRITE, overwriteName="quota_hardlimit")
@Column(name = "quota_hardlimit", columnDefinition = "integer")
private Integer quotaHardlimit;

View File

@ -40,6 +40,10 @@ public class PropertyRemote implements IRemote {
if (fieldIO != null) {
HashMap<String, Object> propertyProperties = new HashMap<String, Object>();
String fieldName = f.getName();
String overwrite = fieldIO.overwriteName();
if (overwrite != null && !overwrite.isEmpty()) {
fieldName = overwrite;
}
propertyProperties.put("module", (String) moduleKey);
propertyProperties.put("name", fieldName);
propertyProperties.put("searchable", "equals");