I'm new here and this is my second question, but as the first, I have a problem already tried to solve in different ways, but have not found a solution, so I'm resorting to you, here we go.
My code:
string sql = "SELECT NEW Filial(fil.NumSequencial, fil.Numero, fil.Nome, fil.Cnpj, fil.Empresa, fil.LstUsuario)" +
" FROM Filial fil" +
" join fetch fil.LstUsuario usrFil";
IQuery query = session.CreateQuery(sql);
lstFilial = (List<Filial>)query.List<Filial>();
I've tried with and without the line "join fetch", but the error is always the same:
{"illegal syntax near collection: id [SELECT NEW Filial(fil.NumSequencial, fil.Numero, fil.Nome, fil.Cnpj, fil.Empresa, fil.LstUsuario) FROM Leitor_NFe_XML_Entidade.Filial fil\tjoin fetch fil.LstUsuario usrFil]"}
The constructor:
public Filial(long numSequencial, int numero, string nome, string cnpj, Empresa empresa, IList<Usuario> lstUsuario)
{
this.numSequencial = numSequencial;
this.numero = numero;
this.nome = nome;
this.cnpj = cnpj;
this.empresa = empresa;
this.lstUsuario = lstUsuario;
}
Am thankful since already