Ricevo l'errore "ORA-00972: identificatore è troppo lungo" durante il salvataggio di un oggetto classe dominio.ORA-00972: l'identificatore è troppo lungo - La migliore strategia per evitarlo in Grails
Caused by: org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.intelligrape.model.Address.studentsForPermanentAddressId#79366215]
Quali potrebbero essere le possibili soluzioni per risolvere questo problema, tranne riducendo la lunghezza del campo studentsForPermanentAddressId. Il motivo è che questa è una tabella di database legacy che non posso modificare.
EDIT: Aggiunta la descrizione della classe di dominio come chiesto da Rob Hruska
package com.intelligrape.model
class Address {
String address1
String address2
String boxNumber
String city
Long stateLid
String province
String zipCode
Long countryLid
Double latitude
Double longitude
Long radius
static hasMany = [studentsForPermanentAddressId: Student, studentsForLocalAddressId: Student]
static constraints = {
address1 nullable: true
address2 nullable: true
boxNumber nullable: true, size: 1..25
city nullable: true, size: 1..30
stateLid nullable: true
province nullable: true, size: 1..64
zipCode nullable: true, size: 1..15
countryLid nullable: true
latitude nullable: true
longitude nullable: true
radius nullable: true
studentsForPermanentAddressId nullable: true
studentsForLocalAddressId nullable: true
}
}
Questo è interessante, il limite di lunghezza di Oracle è 30 e 'studentsForPermanentAddressId'" solo "ha 29 caratteri. – NullUserException
@NullUserException - Non penso che 'studentsForPermanentAddressId' sia il nome della colonna del database attuale; probabilmente sta mappando qualcosa come 'students_for_permanent _...'. –
@Mohd: puoi fornire il codice della classe di dominio che definisce la relazione in questione? –