20 Temmuz 2018 Cuma

@Filters Anotasyonu

Örnek
Şöyle yaparız.
@Entity
@Table(name="student") 
@FilterDef(name="studentFilter", parameters={

        @ParamDef( name="maxAge", type="integer" ),
        @ParamDef( name="minAge", type="integer" ),
        @ParamDef( name="minNumber", type="integer")
})
@Filters( {
    @Filter(name="studentFilter", condition=":minAge <= age and :maxAge >= age"),
    @Filter(name="studentFilter", condition=":minNumber <= number")
} )
public class Student {}

Hiç yorum yok:

Yorum Gönder