Hi Isomorphic,
I'm currently having an issue with Datasource configuration using multiple foreignkeys to the same datasource / table.
Basically the generated SQL is not providing different aliases for the table even using relatedTableAlias.
I have the following Datasources:
sprgprojects:
And sprlog
Finally the generated SQL when performing a fetch for the first datasource is like this:
Any help will be appreciated,
Thanks
SmartGWT version:
SmartClient Version: v9.0p_2014-02-25/EVAL Deployment (expires 2014.04.26_08.14.58) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)
I'm currently having an issue with Datasource configuration using multiple foreignkeys to the same datasource / table.
Basically the generated SQL is not providing different aliases for the table even using relatedTableAlias.
I have the following Datasources:
sprgprojects:
Code:
<DataSource ID="sprgprojects" serverType="sql" tableName="sprgprojects" > <fields> <field name="projectId" title="ID Proyecto" type="integer" canEdit="false" length="10" /> <field name="projectPk" customSelectExpression="CONCAT(sprgprojects.projectId, '.0')" primaryKey="true" hidden="true" /> <field name="projectType" title="Tipo Proyecto" type="integer" canEdit="false" length="5" hidden="true" /> <field name="projectName" title="Nombre Proyecto" type="text" length="50" /> <field name="projectDesc" title="Descripcion Proyecto" type="text" length="255" /> <field name="projectFlags" title="Flags" type="integer" hidden="true" length="10" /> <field name="projectObjSelType" type="integer" hidden="true" length="5" /> <field name="projectParamsId" type="integer" hidden="true" length="10" /> <field name="areaId" type="integer" hidden="true" length="10" /> <field foreignKey="sprlog.logId" name="createLogId" hidden="true" canEdit="false" /> <field foreignKey="sprlog.logId" name="saveLogId" hidden="true" canEdit="false" /> <field name="saveVersionId" type="integer" hidden="true" length="5" /> <field foreignKey="sprlog.logId" name="lockLogId" hidden="true" canEdit="false" /> <field name="lockVersionId" type="integer" hidden="true" length="5" /> <field foreignKey="sprlog.logId" name="closeLogId" hidden="true" /> <field foreignKey="sprlog.logId" name="cancelLogId" hidden="true" /> <field name="createDate" includeFrom="sprlog.eventDate" includeVia="createLogId" /> <field name="saveDate" hidden="true" includeFrom="sprlog.eventDate" includeVia="saveLogId" /> <field name="lockDate" hidden="true" includeFrom="sprlog.eventDate" includeVia="lockLogId" /> <field name="closeDate" hidden="true" includeFrom="sprlog.eventDate" includeVia="closeLogId" /> <field name="cancellDate" hidden="true" includeFrom="sprlog.eventDate" includeVia="cancelLogId" /> <field name="fsProjectCode" type="text" hidden="true" length="20" /> <field name="isFolder" type="boolean" hidden="true" required="true" customSQL="true" /> <field name="versionDesc" type="text" customSQL="true" /> </fields> <operationBindings> <operationBinding operationType="fetch" > <tableClause>sprgprojversions, $defaultTableClause</tableClause> <whereClause>sprgprojects.projectId = sprgprojversions.projectId AND sprgprojversions.versionId = '0' AND $defaultWhereClause</whereClause> </operationBinding> </operationBindings> <serverObject className="com.em.teco.server.ds.ProjectTreeDmi" methodName="getProjectVersions" /> </DataSource>
Code:
<DataSource ID="sprlog" serverType="sql" tableName="sprlog" > <fields> <field name="logId" title="ID Log" type="integer" canEdit="false" length="10" primaryKey="true" /> <field name="logDate" title="Fecha Log" type="date" canEdit="false" /> <field name="superLogId" title="Super Log ID" type="integer" canEdit="false" length="10" hidden="true" /> <field name="userId" title="ID Usuario" type="integer" canEdit="false" /> <field name="eventType" title="Tipo de Evento" type="integer" canEdit="false" length="10" /> <field name="eventDate" title="Fecha Evento" type="date" canEdit="false" /> <field name="eventStatus" title="Estado" type="integer" canEdit="false" length="10" /> <field name="eventData" title="Datos evento" type="text" canEdit="false" length="255" /> </fields> </DataSource>
Finally the generated SQL when performing a fetch for the first datasource is like this:
Code:
SELECT sprgprojects.areaId, sprgprojects.cancelLogId, sprgprojects.closeLogId, sprgprojects.createLogId, sprgprojects.fsProjectCode, sprgprojects.lockLogId, sprgprojects.lockVersionId, sprgprojects.projectDesc, sprgprojects.projectFlags, sprgprojects.projectId, sprgprojects.projectName, sprgprojects.projectObjSelType, sprgprojects.projectParamsId, CONCAT(sprgprojects.projectId, '.0') AS projectPk, sprgprojects.projectType, sprgprojects.saveLogId, sprgprojects.saveVersionId, sprlog.eventDate AS createDate, sprlog.eventDate AS saveDate, sprlog.eventDate AS lockDate, sprlog.eventDate AS closeDate, sprlog.eventDate AS cancellDate FROM sprgprojversions, sprlog, sprgprojects WHERE sprgprojects.projectId = sprgprojversions.projectId AND sprgprojversions.versionId = '0' AND ('1' ='1') AND sprgprojects.createLogId = sprlog.logId AND sprgprojects.saveLogId = sprlog.logId AND sprgprojects.lockLogId = sprlog.logId AND sprgprojects.closeLogId = sprlog.logId AND sprgprojects.cancelLogId = sprlog.logId
Any help will be appreciated,
Thanks
SmartGWT version:
SmartClient Version: v9.0p_2014-02-25/EVAL Deployment (expires 2014.04.26_08.14.58) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)
Comment