I have two domain classes
one is User.groovy which is storing in mongodb
class User {
String firstName
String lastName
Address address
static mapWith = "mongo"
static mapping = {version false
}
static constraints = {
address nullable: true
}
}
second one is Address which is storing mysqlDB
class Address {
String address1
String address2
String city
String state
String country
static constraints = {
}
}
when i am running below logic
def userInstance=User.get(1l)
println "--->>"+userInstance?.address?.address1
Error loading association [1] of type [class com.imomentous.Address]. Associated instance no longer exists.
when i am running below logic
def userInstance=User.get(1l)
println "--->>"+userInstance?.address?.id
It gave me -->1
What is the reason behind that?