diff --git a/modules/global/src/com/haulmont/chile/jpa/loader/JPAAnnotationsLoader.java b/modules/global/src/com/haulmont/chile/jpa/loader/JPAAnnotationsLoader.java index 1d8d64e35a..de48fb8c3c 100644 --- a/modules/global/src/com/haulmont/chile/jpa/loader/JPAAnnotationsLoader.java +++ b/modules/global/src/com/haulmont/chile/jpa/loader/JPAAnnotationsLoader.java @@ -2,10 +2,6 @@ * Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved. * Haulmont Technology proprietary and confidential. * Use is subject to license terms. - - * Author: FIRSTNAME LASTNAME - * Created: 06.11.2008 9:49:55 - * $Id: JPAAnnotationsLoader.java 5981 2011-09-20 07:35:58Z krivopustov $ */ package com.haulmont.chile.jpa.loader; @@ -17,6 +13,7 @@ import com.haulmont.chile.core.model.Range; import com.haulmont.chile.core.model.Session; import com.haulmont.chile.core.model.MetaProperty; import com.haulmont.chile.core.model.impl.MetaClassImpl; +import com.haulmont.cuba.core.entity.annotation.SystemLevel; import org.apache.commons.lang.StringUtils; import static org.apache.commons.lang.StringUtils.isBlank; @@ -35,6 +32,10 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; +/** + * @author krivopustov + * @version $Id$ + */ public class JPAAnnotationsLoader extends ChileAnnotationsLoader implements ClassMetadataLoader { private Log log = LogFactory.getLog(JPAMetadataLoader.class); @@ -236,6 +237,11 @@ public class JPAAnnotationsLoader extends ChileAnnotationsLoader implements Clas if (temporal != null) { metaProperty.getAnnotations().put("temporal", temporal.value()); } + + SystemLevel systemLevel = field.getAnnotation(SystemLevel.class); + if (systemLevel != null) { + metaProperty.getAnnotations().put("system", true); + } } protected boolean isPersistent(Field field) { @@ -246,4 +252,4 @@ public class JPAAnnotationsLoader extends ChileAnnotationsLoader implements Clas || field.isAnnotationPresent(ManyToMany.class) || field.isAnnotationPresent(Embedded.class); } -} +} \ No newline at end of file diff --git a/modules/global/src/com/haulmont/cuba/core/entity/annotation/SystemLevel.java b/modules/global/src/com/haulmont/cuba/core/entity/annotation/SystemLevel.java index 56290d5756..2b09d319a8 100644 --- a/modules/global/src/com/haulmont/cuba/core/entity/annotation/SystemLevel.java +++ b/modules/global/src/com/haulmont/cuba/core/entity/annotation/SystemLevel.java @@ -12,14 +12,15 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * Indicates that annotated entity is low-level and should not be available for end-user in various entity lists. + * Indicates that annotated entity/field is low-level and should not be available for end-user in various entity/field lists.
+ * For field indicates that attribute should not be available for dynamic filters in UI. * * @author krivopustov * @version $Id$ */ -@Target({ElementType.TYPE}) +@Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface SystemLevel { boolean value() default true; -} +} \ No newline at end of file diff --git a/modules/global/src/com/haulmont/cuba/security/entity/User.java b/modules/global/src/com/haulmont/cuba/security/entity/User.java index 2b0ffdcf85..a9f42d7a29 100644 --- a/modules/global/src/com/haulmont/cuba/security/entity/User.java +++ b/modules/global/src/com/haulmont/cuba/security/entity/User.java @@ -15,6 +15,7 @@ import com.haulmont.chile.core.annotations.NamePattern; import com.haulmont.cuba.core.entity.StandardEntity; import com.haulmont.cuba.core.entity.annotation.Listeners; import com.haulmont.cuba.core.entity.annotation.OnDeleteInverse; +import com.haulmont.cuba.core.entity.annotation.SystemLevel; import com.haulmont.cuba.core.entity.annotation.TrackEditScreenHistory; import com.haulmont.cuba.core.global.DeletePolicy; import com.haulmont.cuba.core.sys.AppContext; @@ -42,9 +43,11 @@ public class User extends StandardEntity { @Column(name = "LOGIN", length = LOGIN_FIELD_LEN, nullable = false) protected String login; + @SystemLevel @Column(name = "LOGIN_LC", length = LOGIN_FIELD_LEN, nullable = false) protected String loginLowerCase; + @SystemLevel @Column(name = "PASSWORD", length = 255) protected String password; @@ -254,4 +257,4 @@ public class User extends StandardEntity { public String getSalt() { return id != null ? id.toString() : ""; } -} +} \ No newline at end of file diff --git a/modules/gui/src/com/haulmont/cuba/gui/app/security/user/browse/user-browse-filter.xml b/modules/gui/src/com/haulmont/cuba/gui/app/security/user/browse/user-browse-filter.xml deleted file mode 100644 index 8d722dfcd1..0000000000 --- a/modules/gui/src/com/haulmont/cuba/gui/app/security/user/browse/user-browse-filter.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - select g from sec$Group g - - - - - - - - -