| author | Tomas Zeman <tzeman@volny.cz> |
| Fri, 10 Feb 2012 09:53:05 +0100 | |
| changeset 9 | fe20033afdf1 |
| child 65 | a35a0edf9ddd |
| permissions | -rw-r--r-- |
|
9
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
1 |
/* |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
2 |
* Copyright 2011 Tomas Zeman <tzeman@volny.cz> |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
3 |
* |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
5 |
* you may not use this file except in compliance with the License. |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
6 |
* You may obtain a copy of the License at |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
7 |
* |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
9 |
* |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
13 |
* See the License for the specific language governing permissions and |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
14 |
* limitations under the License. |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
15 |
*/ |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
16 |
package fis.geo.model |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
17 |
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
18 |
import fis.base.model.{Entity, MetaEntity}
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
19 |
import net.liftweb.record.{MetaRecord, Record}
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
20 |
import net.liftweb.record.field._ |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
21 |
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
22 |
class Country private() extends Record[Country] with Entity[Country] {
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
23 |
def meta = Country |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
24 |
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
25 |
val iso2 = new StringField(this, 2) |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
26 |
val iso3 = new StringField(this, 3) |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
27 |
lazy val cities = GeoSchema.countryToCities.left(this) |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
28 |
} |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
29 |
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
30 |
object Country extends Country with MetaRecord[Country] with |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
31 |
MetaEntity[Country] {
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
32 |
def getTable = GeoSchema.countries |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
33 |
} |
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
34 |
|
|
fe20033afdf1
bf245fe6966abb9a Geo entities (address, city, country)
Tomas Zeman <tzeman@volny.cz>
parents:
diff
changeset
|
35 |
// vim: set ts=2 sw=2 et: |