source: trunk/grails-app/domain/Address.groovy @ 503

Last change on this file since 503 was 397, checked in by gav, 15 years ago

Add address feature.

File size: 833 bytes
RevLine 
[397]1class Address {
2
3    AddressType addressType
4
5    Manufacturer manufacturer
6    Supplier supplier
7    Person person
8    Site site
9
10    String street1 = ''
11    String street2 = ''
12    String city = ''
13    String state = ''
14    String postCode = ''
15    String country = ''
16
17//     hasMany = []
18
19    static belongsTo = [Manufacturer, Supplier, Person, Site]
20
21    static constraints = {
22        street1(blank:false,maxSize:50)
23        street2(maxSize:50)
24        city(blank:false,maxSize:50)
25        state(blank:false,maxSize:50)
26        postCode(blank:false,maxSize:50)
27        country(blank:false,maxSize:50)
28        manufacturer(nullable:true)
29        supplier(nullable:true)
30        person(nullable:true)
31        site(nullable:true)
32    }
33
34    String toString() {
35        "${this.addressType}: ${this.street1}, ${this.city}"
36    }
37
38}
Note: See TracBrowser for help on using the repository browser.