Hi,
i've problem
my code :
Code:
<property name="Chemin" type="String" formula="(case when (NIVEAU_PARENT_FK IS null) then
ID
else
(case when ((select __niveau.NIVEAU_PARENT_FK from NIVEAU as __niveau where __niveau.id=NIVEAU_PARENT_FK) is null)
then (select (cast(ID as VARCHAR(10)) + cast(NIVEAU_PARENT_FK as VARCHAR(10))))
else (select (cast(ID as VARCHAR(10)) + cast(NIVEAU_PARENT_FK as VARCHAR(10)) + cast(__niveau.NIVEAU_PARENT_FK as VARCHAR(10))) from NIVEAU as __niveau where __niveau.id=NIVEAU_PARENT_FK) end)
end)" />
this code is good, but i should have :
Code:
(select (cast(ID as VARCHAR(10)) + '-' +cast(NIVEAU_PARENT_FK as VARCHAR(10))))
but this command return "Failded to lazily initialise a collection"
i've tried
Code:
(select (cast(ID as VARCHAR(10)) + (cast('-'as VARCHAR(10)) +cast(NIVEAU_PARENT_FK as VARCHAR(10))))
but it return the simular error.
Config nhibernate : MsSql2005Dialect
Please help. Thank you.