cascade = CascadeType.ALL @Filter( name="activeAccount", condition="active_status = :active"
@Entity @Table(name="ZOOLOGY_MAMMAL") @FilterDef(name="pregnantOnly") @Filter(name="pregnantOnly", condition="IS_PREGNANT = 1") public class Mammal extends Animal{ @Column(name="IS_PREGNANT") @Type( type="numeric_boolean" ) private boolean isPregnant; public boolean isPregnant() { return isPregnant; } public void setPregnant(boolean isPregnant) { this.isPregnant = isPregnant; } }
@Entity(name = "Role") @Table(name="Roles") @FilterDef(name = "activeRoleFilter", defaultCondition = "active = true") @Filter(name = "activeRoleFilter") public static class Role extends AbstractEntity { private String name;
/** * @author Sharath Reddy */ @FilterDef(name = "byCategory", parameters = {@ParamDef(name = "category", type = "string")}) @Filter(name = "byCategory", condition = ":category = `CATEGORY`") @MappedSuperclass public class Tool extends Widget { @Column(name="`CATEGORY`") private String category; public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } }
@MappedSuperclass @FilterDef(name = "nameFilter", parameters = @ParamDef(name = "name", type = "string")) @Filter(name = "nameFilter", condition = ":name = ANIMAL_NAME") public abstract class Animal { @Id @GeneratedValue @Column(name = "ANIMAL_ID") private Integer id; @Column(name = "ANIMAL_NAME") private String name; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
@Table(name="ZOOLOGY_ANIMAL") @FilterDef(name="ignoreSome", parameters={@ParamDef(name="name", type="string")}) @Filter(name="ignoreSome", deduceAliasInjectionPoints=false, condition=":name <> {alias}.ANIMAL_NAME") public class Animal { @Id
/** * @author Sharath Reddy */ @FilterDef(name = "byName", parameters = {@ParamDef(name = "name", type = "string")}) @Filter(name = "byName", condition = ":name = name") @MappedSuperclass public class Widget { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
@Entity(name = "User") @Table(name = "`User`") @FilterDef(name = "activeUserFilter", defaultCondition = "active = true") @Filter(name = "activeUserFilter") public static class User extends AbstractEntity { private String name; @ManyToMany @Fetch(FetchMode.JOIN) @Filter(name = "activeRoleFilter") private Set<Role> roles = new HashSet<>();
@Table(name="ZOOLOGY_ANIMAL") @FilterDef(name="ignoreSome", parameters={@ParamDef(name="name", type="string")}) @Filter(name="ignoreSome", condition=":name <> ANIMAL_NAME") public class Animal { @Id
@Entity @Table(name="ZOOLOGY_HUMAN") @FilterDef(name="iqRange", parameters= { @ParamDef(name="min", type="integer"), @ParamDef(name="max", type="integer") }) @Filter(name="iqRange", condition="HUMAN_IQ BETWEEN :min AND :max") public class Human extends Mammal { @Column(name="HUMAN_IQ") private int iq; public int getIq() { return iq; } public void setIq(int iq) { this.iq = iq; } }
@Entity @Table(name="ZOOLOGY_HUMAN") @FilterDef(name="iqRange", parameters= { @ParamDef(name="min", type="integer"), @ParamDef(name="max", type="integer") }) @Filter(name="iqRange", condition="HUMAN_IQ BETWEEN :min AND :max") public class Human extends Mammal { @Column(name="HUMAN_IQ") private int iq; public int getIq() { return iq; } public void setIq(int iq) { this.iq = iq; } }
}, defaultCondition = "DELETION_TIMESTAMP = :aliveTimestamp and DELETED = :deleted") }) @Filters({@Filter(name = "aliveOnly", condition = "DELETION_TIMESTAMP = :aliveTimestamp and DELETED = :deleted")}) public static class ArticleRevision { @Id @Filter(name = "aliveOnly") private Set<ArticleTrading> articleTradings = new HashSet<ArticleTrading>();
@ParamDef(name="max", type="integer") }) @Filter(name="iqRange", condition="HUMAN_IQ BETWEEN :min AND :max") public class Human extends Mammal { @Column(name="HUMAN_IQ")
@ManyToMany(cascade = CascadeType.PERSIST) @OrderBy("expirationDate") @Where(clause = "1=1") @WhereJoinTable(clause = "2=2") @Filter(name="Groupfilter", condition = "3=3") @FilterJoinTable(name="Groupfilter", condition = "4=4") public Collection<Permission> getPermissions() { return permissions; }
@ManyToMany(cascade = CascadeType.PERSIST) @OrderBy("expirationDate") @Where(clause = "1=1") @WhereJoinTable(clause = "2=2") @Filter(name="Groupfilter", condition = "3=3") @FilterJoinTable(name="Groupfilter", condition = "4=4") public Set<Permission> getPermissions() { return permissions; }
parameters = { @ParamDef(type = "long", name = "id") } @Filter(name = "ID") public static class Customer {
@Filter(name = "statusFilter", condition = "STATUS = :status ") @Entity(name = "Student") @Table(name = "STUDENT")
@Filter( name="firstAccounts", condition="order_id <= :maxOrderId"
@Filter( name="activeAccount", condition="{a}.active = :active and {ad}.deleted = false",