Well, the question explains itself, here is how i tried to do it. I think the problem might be that the Set is empty, and those methods need at least one element to return the class.
views/product/_form.gsp
<% cl = UnidadProductiva.get(params.unidadProductiva?.id).producto %>
<p>${cl}</p>
returns []
if i add this method/attributes after producto:
.getCandidateClass() : No signature of method:
org.hibernate.collection.PersistentSet.getCandidateClass() is applicable for argument types: () values: []
.class :
class org.hibernate.collection.PersistentSet
.getElementType() : No signature of method:
org.hibernate.collection.PersistentSet.getElementType() is applicable for argument types: () values: [] Possible solutions: getElement(java.lang.Object)
.properties :
{
clearQueueEnabled=true,
session=SessionImpl(PersistenceContext[
entityKeys=[
EntityKey[
planificador.UnidadProductiva#1
]
],
collectionKeys=[
CollectionKey[
unidadesProductivas.Cocimiento.producto#1
],
CollectionKey[
planificador.UnidadProductiva.grupoRecursos#1
],
CollectionKey[
planificador.UnidadProductiva.lineaProduccion#1
]
]
];ActionQueue[
insertions=[
]updates=[
]deletions=[
]collectionCreations=[
]collectionRemovals=[
]collectionUpdates=[
]
]),
unreferenced=false,
role=unidadesProductivas.Cocimiento.producto,
directlyAccessible=false,
empty=true,
storedSnapshot={
},
operationQueueEnabled=false,
value=[
],
owner=unidadesProductivas.Cocimiento: 1,
cachedSize=-1,
class=classorg.hibernate.collection.PersistentSet,
rowUpdatePossible=false,
snapshot={
},
key=1,
putQueueEnabled=false,
dirty=false
}
i am expecting a method or a property that returns CaldoMadre
And this are the classes i am using
class UnidadProductiva {...}
class Cocimiento extends UnidadProductiva {
static hasMany = [producto:CaldoMadre];
}
class Producto {
static belongsTo = [unidadProductiva:UnidadProductiva]
}
class CaldoMadre extends Producto {...}
I am a chilean noob to grails, please be patient if i dont undestand.