Guest User

Untitled

a guest
Jul 9th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.48 KB | None | 0 0
  1. package pl.grooper.offer
  2.  
  3. import pl.grooper.notification.Subscription;
  4. import pl.grooper.payment.*
  5. import pl.grooper.offer.sale.*
  6.  
  7. class Category implements Serializable{
  8.  
  9.  
  10.     String name
  11.  
  12.     Set subscriptions
  13.  
  14.    Integer specialCategory = null
  15.    
  16.    static hasMany = [subscriptions: Subscription]
  17.    
  18.     static constraints = {
  19.         name blank: false, unique: true
  20.         specialCategory nullable: true
  21.     }
  22.  
  23.    
  24.     def getSaleOfferCount() {
  25.         return SaleOffer.countByCategory(this)
  26.     }
  27.  
  28.  
  29. }
Add Comment
Please, Sign In to add comment