Hi all, I am almost beginning on NHibernate and I have started with a small applicaton. I am excited about the potential, but I'm stumbling quite a bit on ordering for more than one field defined in a referenced tables.
I hope what I'm trying will be possible but I could not find any example.
Hibernate version:
2.0.1
Mapping documents:
Quote:
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="nhCataBilMonDB.T_Catalogo,nhCataBilMonDB" table="T_Catalogo" lazy="true">
<id name="ID" column="ID" type="System.Int32">
<generator class="native" />
</id>
<property type="System.Decimal" name="valorfacial" column="[valorfacial]" />
<property type="System.Int32" name="emision" column="[emision]" />
<property type="System.String" name="estampacion" column="[estampacion]" />
<property type="System.Int32" not-null="true" name="itemType" column="[itemType]" />
<property type="System.String" not-null="true" name="itemRef" column="[itemRef]" />
<many-to-one name="PaisId" cascade="none" column="PaisId" not-null="true" />
<many-to-one name="EpocaId" cascade="none" column="EpocaId" not-null="true" />
<many-to-one name="DivisaId" cascade="none" column="DivisaId" not-null="true" />
</class>
</hibernate-mapping>
Quote:
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="nhCataBilMonDB.T_Epoca,nhCataBilMonDB" table="T_Epoca" lazy="true">
<id name="ID" column="ID" type="System.Int32">
<generator class="native" />
</id>
<property type="System.String" not-null="true" name="epoca" column="[epoca]" />
<property type="System.Int32" not-null="true" name="ordenepoca" column="[ordenepoca]" />
<many-to-one name="PaisId" cascade="none" column="PaisId" not-null="true" />
<bag name="T_EpocaT_Catalogo" inverse="true" lazy="true" cascade="none">
<key column="EpocaId" />
<one-to-many class="nhCataBilMonDB.T_Catalogo,nhCataBilMonDB" />
</bag>
</class>
</hibernate-mapping>
Quote:
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="nhCataBilMonDB.T_Pais,nhCataBilMonDB" table="T_Pais" lazy="true">
<id name="ID" column="ID" type="System.Int32">
<generator class="native" />
</id>
<property type="System.String" not-null="true" name="pais" column="[pais]" />
<property type="System.Int32" not-null="true" name="ordenpais" column="[ordenpais]" />
<bag name="T_PaisT_Catalogo" inverse="true" lazy="true" cascade="none">
<key column="PaisId" />
<one-to-many class="nhCataBilMonDB.T_Catalogo,nhCataBilMonDB" />
<bag name="T_PaisT_Epoca" inverse="true" lazy="true" cascade="none">
<key column="PaisId" />
<one-to-many class="nhCataBilMonDB.T_Epoca,nhCataBilMonDB" />
</bag>
</class>
</hibernate-mapping>
This is my configuration:
Code:
mNhConfiguration.Properties.Add(NHibernate.Cfg.Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider")
mNhConfiguration.Properties.Add(NHibernate.Cfg.Environment.ConnectionDriver, "NHibernate.JetDriver.JetDriver, NHibernate.JetDriver")
mNhConfiguration.Properties.Add(NHibernate.Cfg.Environment.Dialect, "NHibernate.JetDriver.JetDialect, NHibernate.JetDriver")
mNhConfiguration.Properties.Add(NHibernate.Cfg.Environment.MaxFetchDepth, "-1")
mNhConfiguration.Properties.Add(NHibernate.Cfg.Environment.ReleaseConnections, "on_close")
mNhConfiguration.Properties.Add(NHibernate.Cfg.Environment.ConnectionString, "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & cbmDatabase)
'cbmDatabase is the path to the MS Access 2000 database
mNhConfiguration.Properties.Add(NHibernate.Cfg.Environment.ShowSql, "true")
I have tried:
Code:
Dim lCriteria As NHibernate.ICriteria
lMainCriteria = mISession.CreateCriteria(GetType(T_Catalogo))
lCriteria = lMainCriteria. _
CreateAlias("PaisId", "PaisId"). _
CreateAlias("EpocaId", "EpocaId"). _
AddOrder(Order.Asc("PaisId.ordenpais")). _
AddOrder(Order.Asc("EpocaId.ordenepoca"))
lCriteria.SetResultTransformer(New NHibernate.Transform.DistinctRootEntityResultTransformer())
dim mIList As IList = lCriteria.List
I have also tried:
Code:
lCriteria = lMainCriteria.CreateAlias("PaisId", "PaisId").AddOrder(Order.Asc("PaisId.ordenpais"))
lCriteria = lMainCriteria.CreateAlias("EpocaId", "EpocaId").AddOrder(Order.Asc("EpocaId.ordenepoca"))
and also:
Code:
lCriteria = addCriteria(lMainCriteria, "PaisId").AddOrder(Order.Asc("ordenpais"))
lCriteria = addCriteria(lMainCriteria, "EpocaId").AddOrder(Order.Asc("ordenepoca"))
NOTE that only one criteria works properly and give back all the records in the right order.
Full stack trace of any exception that occurs:
First and second generate the same informacion:
NHibernate: SELECT this_.ID as ID2_2_, this_.[valorfacial] as column2_2_2_, this_.[emision] as column3_2_2_, this_.[estampacion] as column4_2_2_, this_.[itemType] as column5_2_2_, this_.[itemRef] as column6_2_2_, this_.PaisId as PaisId2_2_, this_.EpocaId as EpocaId2_2_, this_.DivisaId as DivisaId2_2_, paisid1_.ID as ID14_0_, paisid1_.[pais] as column2_14_0_, paisid1_.[ordenpais] as column3_14_0_, epocaid2_.ID as ID9_1_, epocaid2_.[epoca] as column2_9_1_, epocaid2_.[ordenepoca] as column3_9_1_, epocaid2_.PaisId as PaisId9_1_ (select * from (T_Catalogo this_ inner join T_Pais paisid1_ on this_.PaisId=paisid1_.ID) inner join T_Epoca epocaid2_ on this_.EpocaId=epocaid2_.ID ORDER BY paisid1_.[ordenpais] asc) as jetJoinAlias0, epocaid2_.[ordenepoca] asc
Excepción del tipo 'System.Data.OleDb.OleDbException' en System.Data.dll
Excepción del tipo 'NHibernate.ADOException' en NHibernate.dll
Excepción del tipo 'NHibernate.ADOException' en Microsoft.VisualBasic.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>CataBilMon.vshost.exe</AppDomain><Exception><ExceptionType>NHibernate.ADOException, NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4</ExceptionType><Message>could not execute query
[ SELECT this_.ID as ID2_2_, this_.[valorfacial] as column2_2_2_, this_.[emision] as column3_2_2_, this_.[estampacion] as column4_2_2_, this_.[itemType] as column5_2_2_, this_.[itemRef] as column6_2_2_, this_.PaisId as PaisId2_2_, this_.EpocaId as EpocaId2_2_, this_.DivisaId as DivisaId2_2_, paisid1_.ID as ID14_0_, paisid1_.[pais] as column2_14_0_, paisid1_.[ordenpais] as column3_14_0_, epocaid2_.ID as ID9_1_, epocaid2_.[epoca] as column2_9_1_, epocaid2_.[ordenepoca] as column3_9_1_, epocaid2_.PaisId as PaisId9_1_ FROM T_Catalogo this_ inner join T_Pais paisid1_ on this_.PaisId=paisid1_.ID inner join T_Epoca epocaid2_ on this_.EpocaId=epocaid2_.ID ORDER BY paisid1_.[ordenpais] asc, epocaid2_.[ordenepoca] asc ]
[SQL: SELECT this_.ID as ID2_2_, this_.[valorfacial] as column2_2_2_, this_.[emision] as column3_2_2_, this_.[estampacion] as column4_2_2_, this_.[itemType] as column5_2_2_, this_.[itemRef] as column6_2_2_, this_.PaisId as PaisId2_2_, this_.EpocaId as EpocaId2_2_, this_.DivisaId as DivisaId2_2_, paisid1_.ID as ID14_0_, paisid1_.[pais] as column2_14_0_, paisid1_.[ordenpais] as column3_14_0_, epocaid2_.ID as ID9_1_, epocaid2_.[epoca] as column2_9_1_, epocaid2_.[ordenepoca] as column3_9_1_, epocaid2_.PaisId as PaisId9_1_ FROM T_Catalogo this_ inner join T_Pais paisid1_ on this_.PaisId=paisid1_.ID inner join T_Epoca epocaid2_ on this_.EpocaId=epocaid2_.ID ORDER BY paisid1_.[ordenpais] asc, epocaid2_.[ordenepoca] asc]</Message><StackTrace> at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure&amp; Failure)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at CataBilMon.m_TreeviewHandling.makeTree(TreeView&amp; TreeView, Object itemInfo) in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\M_TreeviewHandling.vb:line 32
at CataBilMon.FormMain.startUpDataWindow() in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.vb:line 1416
at CataBilMon.FormMain.openCat() in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.vb:line 1805
at CataBilMon.FormMain.FormMain_Load(Object eventSender, EventArgs eventArgs) in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.vb:line 167
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message&amp; m)
at System.Windows.Forms.Control.WndProc(Message&amp; m)
at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)
at System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)
at System.Windows.Forms.Form.WmShowWindow(Message&amp; m)
at System.Windows.Forms.Form.WndProc(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at CataBilMon.FormMain.Main() in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.Designer.vb:line 1
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>NHibernate.ADOException: could not execute query
[ SELECT this_.ID as ID2_2_, this_.[valorfacial] as column2_2_2_, this_.[emision] as column3_2_2_, this_.[estampacion] as column4_2_2_, this_.[itemType] as column5_2_2_, this_.[itemRef] as column6_2_2_, this_.PaisId as PaisId2_2_, this_.EpocaId as EpocaId2_2_, this_.DivisaId as DivisaId2_2_, paisid1_.ID as ID14_0_, paisid1_.[pais] as column2_14_0_, paisid1_.[ordenpais] as column3_14_0_, epocaid2_.ID as ID9_1_, epocaid2_.[epoca] as column2_9_1_, epocaid2_.[ordenepoca] as column3_9_1_, epocaid2_.PaisId as PaisId9_1_ FROM T_Catalogo this_ inner join T_Pais paisid1_ on this_.PaisId=paisid1_.ID inner join T_Epoca epocaid2_ on this_.EpocaId=epocaid2_.ID ORDER BY paisid1_.[ordenpais] asc, epocaid2_.[ordenepoca] asc ]
[SQL: SELECT this_.ID as ID2_2_, this_.[valorfacial] as column2_2_2_, this_.[emision] as column3_2_2_, this_.[estampacion] as column4_2_2_, this_.[itemType] as column5_2_2_, this_.[itemRef] as column6_2_2_, this_.PaisId as PaisId2_2_, this_.EpocaId as EpocaId2_2_, this_.DivisaId as DivisaId2_2_, paisid1_.ID as ID14_0_, paisid1_.[pais] as column2_14_0_, paisid1_.[ordenpais] as column3_14_0_, epocaid2_.ID as ID9_1_, epocaid2_.[epoca] as column2_9_1_, epocaid2_.[ordenepoca] as column3_9_1_, epocaid2_.PaisId as PaisId9_1_ FROM T_Catalogo this_ inner join T_Pais paisid1_ on this_.PaisId=paisid1_.ID inner join T_Epoca epocaid2_ on this_.EpocaId=epocaid2_.ID ORDER BY paisid1_.[ordenpais] asc, epocaid2_.[ordenepoca] asc] ---&gt; System.Data.OleDb.OleDbException: The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.ExecuteReader()
at NHibernate.JetDriver.JetDbCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
--- End of inner exception stack trace ---
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure&amp; Failure)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at CataBilMon.m_TreeviewHandling.makeTree(TreeView&amp; TreeView, Object itemInfo) in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\M_TreeviewHandling.vb:line 32
at CataBilMon.FormMain.startUpDataWindow() in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.vb:line 1416
at CataBilMon.FormMain.openCat() in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.vb:line 1805
at CataBilMon.FormMain.FormMain_Load(Object eventSender, EventArgs eventArgs) in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.vb:line 167
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message&amp; m)
at System.Windows.Forms.Control.WndProc(Message&amp; m)
at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)
at System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)
at System.Windows.Forms.Form.WmShowWindow(Message&amp; m)
at System.Windows.Forms.Form.WndProc(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at CataBilMon.FormMain.Main() in C:\Users\ecemagm\Documents\Proyecto Catalogo\Temp\My Project\cbmForms\FormMain.Designer.vb:line 1
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</ExceptionString><InnerException><ExceptionType>System.Data.OleDb.OleDbException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.</Message><StackTrace> at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.ExecuteReader()
at NHibernate.JetDriver.JetDbCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)</StackTrace><ExceptionString>System.Data.OleDb.OleDbException: The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object&amp; executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.OleDb.OleDbCommand.ExecuteReader()
at NHibernate.JetDriver.JetDbCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)</ExceptionString></InnerException></Exception></TraceRecord>
In the last case this is the SQL query (almost the same exception information as before):
NHibernate: SELECT this_.ID as ID2_2_, this_.[valorfacial] as column2_2_2_, this_.[emision] as column3_2_2_, this_.[estampacion] as column4_2_2_, this_.[itemType] as column5_2_2_, this_.[itemRef] as column6_2_2_, this_.PaisId as PaisId2_2_, this_.EpocaId as EpocaId2_2_, this_.DivisaId as DivisaId2_2_, t_pais1_.ID as ID14_0_, t_pais1_.[pais] as column2_14_0_, t_pais1_.[ordenpais] as column3_14_0_, t_epoca2_.ID as ID9_1_, t_epoca2_.[epoca] as column2_9_1_, t_epoca2_.[ordenepoca] as column3_9_1_, t_epoca2_.PaisId as PaisId9_1_ (select * from (T_Catalogo this_ inner join T_Pais t_pais1_ on this_.PaisId=t_pais1_.ID) inner join T_Epoca t_epoca2_ on this_.EpocaId=t_epoca2_.ID ORDER BY t_pais1_.[ordenpais] asc) as jetJoinAlias0, t_epoca2_.[ordenepoca] asc
Help is very appreciated as I have no idea on how to follow.