I'm trying to map the column names of this class:
class Amount{
String total //Total amount of something
String type //Type of amount, Dollars, %, Times something
Bonification bonificationRate //the amount can be "x times another bonification"
static belongsTo = [parentBonification: Bonification]
static mapping = {
table "AMOUNTS"
total column: "AMOU_TTOTAL"
type column: "AMOU_TTYPE"
parentBonification column: "BONI_CID"
bonificationRate column: "BONI_TRATE_CID"
}
}
class Bonification {
//among other things:
Amount amount
}
The thing is none of the field with the Bonification
class are created in the DB,
not with the name I give them and neither with the default suppossed names.
Comment Edit:
- Both are Domain Classes;
- Datasource is on
dbCreate = "update"
- I dropped the Table in Oracle and let Grails create it again. Still no Bonification columns.
- I can not
dbCreate = "create-drop"
because there is data that I can't delete for now. - I mounted a new local Derby Database with
dbCreate = create-drop
. Still no luck.
(PD: All other fields are persisted and mapped with the right column names, only those two Bonification
fields are the problem)
Is there another way of doing this?
Grails: 1.3.9
BD: Oracle 9
Edit for asked DataSource.groovy
(External file accessed from Config.groovy
grails.config.locations = [ "file:${extConfig}/${appName}Config.groovy"]
)
package xx.xxx.xxxx.xxxXxxx
dataSource
{
pooled = true
dialect = "org.hibernate.dialect.Oracle10gDialect"
driverClassName = "oracle.jdbc.OracleDriver"
username = "XXX"
password = "XXX"
properties {
maxActive = 100
maxIdle = 25
minIdle = 5
initialSize = 5
minEvictableIdleTimeMillis = 60000
timeBetweenEvictionRunsMillis = 60000
maxWait = 10000
validationQuery = "select 1 from dual"
}
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}
// environment specific settings
environments {
development {
println "Including external DataSource"
dataSource {
dbCreate = "update"
url = "jdbc:oracle:thin:@xxx.xxx.xx:xxxx:XXXX"
}
}
}