Advertisement
mstranieri

Entity Disney

Jan 27th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.21 KB | None | 0 0
  1. package com.softfobia.margiani.bincy.disney.model;
  2.  
  3. import java.io.Serializable;
  4. import java.util.Date;
  5. import java.util.List;
  6.  
  7. import javax.persistence.Entity;
  8. import javax.persistence.Table;
  9.  
  10. import org.hibernate.annotations.Cache;
  11. import org.hibernate.annotations.CacheConcurrencyStrategy;
  12. import org.riotfamily.common.hibernate.ActiveRecordBeanSupport;
  13. import org.riotfamily.common.web.cache.TagCacheItems;
  14. import org.riotfamily.core.dao.ListParams;
  15.  
  16. /**
  17.  * @author mstranieri
  18.  */
  19. @Entity
  20. @Table(name="margiani_violetta_promo")
  21. @Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region="margiani_violetta_promo")
  22. @TagCacheItems
  23. public class ViolettaPromo extends ActiveRecordBeanSupport implements Serializable   {
  24.  
  25.     private static final long serialVersionUID = -4762324989377385474L;
  26.    
  27.     private Date data;
  28.     private String ip;
  29.     private String email;
  30.     private String swid;
  31.     private String blue;
  32.     private String value;
  33.    
  34.     public String getEmail() {
  35.         return email;
  36.     }
  37.  
  38.     public void setEmail(String email) {
  39.         this.email = email;
  40.     }
  41.  
  42.     public Date getDataRegistrazione() {
  43.         return data;
  44.     }
  45.  
  46.     public void setDataRegistrazione(Date dataRegistrazione) {
  47.         this.data = dataRegistrazione;
  48.     }
  49.  
  50.     public static List<ViolettaPromo> findAll(ListParams params) {
  51.         return query(ViolettaPromo.class, "from {} order by id").setMaxResults(params.getPageSize()).setFirstResult(params.getOffset()).cache().find();
  52.     }
  53.    
  54.     public static ViolettaPromo load(Long id) {
  55.         return load(ViolettaPromo.class, id);
  56.     }
  57.    
  58.     public static ViolettaPromo findByEmail(String email) {
  59.        
  60.         return (ViolettaPromo) query(ViolettaPromo.class, "from {} where email = ?",email).uniqueResult();
  61.     }
  62.  
  63.     public String getIp() {
  64.         return ip;
  65.     }
  66.  
  67.     public void setIp(String ip) {
  68.         this.ip = ip;
  69.     }
  70.  
  71.     public String getSwid() {
  72.         return swid;
  73.     }
  74.  
  75.     public void setSwid(String swid) {
  76.         this.swid = swid;
  77.     }
  78.  
  79.     public String getBlue() {
  80.         return blue;
  81.     }
  82.  
  83.     public void setBlue(String blue) {
  84.         this.blue = blue;
  85.     }
  86.  
  87.     /**
  88.      * @return the value
  89.      */
  90.     public String getValue() {
  91.         return value;
  92.     }
  93.  
  94.     /**
  95.      * @param value the value to set
  96.      */
  97.     public void setValue(String value) {
  98.         this.value = value;
  99.     }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement