You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Neeraj Kumawat (JIRA)" <ji...@apache.org> on 2015/06/11 10:24:01 UTC

[jira] [Commented] (OFBIZ-3575) Union view entity support

    [ https://issues.apache.org/jira/browse/OFBIZ-3575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14581669#comment-14581669 ] 

Neeraj Kumawat commented on OFBIZ-3575:
---------------------------------------

I tried this patch set with ofbiz 12.04  release.  When i specify entity name in <member-entity> of <union-view-entity>, in that case it's working fine. But when i created a  view-entity and specifying this view entity name in <member-entity> of <union-view-entity>, than it's not generating query and showing some exception.
So for resolving that issue i replace "entityBuf.append(entry.getKey() + "." + ModelUtil.javaNameToDbName(alias.getField()));"
to "entityBuf.append(entry.getKey() + "." + entity.getField(alias.getField()).getColName());" in appendUnionViewEntitySQL(0 method of SqlJdbcUtil.java file.


> Union view entity support
> -------------------------
>
>                 Key: OFBIZ-3575
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3575
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: Trunk
>            Reporter: Bob Morley
>            Assignee: Adam Heath
>         Attachments: OFBIZ-3575.patch, OFBIZ-3575_UnionViewEntitySupport.patch
>
>
> As per conversion titled "entity-engine union support" (http://n4.nabble.com/entity-engine-union-support-td1607240.html#a1607240); here is the basic union support that we had added into our Ofbiz project.  I have changed a little of the xml schema here ... the premise is that a "UnionViewEntity" extends the standard "ViewEntity" and contains a list of union members that it will union together.  There should only be changes to the ModelReader to instantiate the new model object and then in SqlJdbcUtil to handle generating the new sql for unions.  I have included a very small unit test that executes a findList against a test union.
> Here is sample sql that was generated:
> SELECT uva.UNION_ID, uva.TESTING_NAME, uva.TESTING_SIZE, uva.TESTING_DATE FROM  ( SELECT T1.TESTING_ID AS UNION_ID, T1.TESTING_NAME AS TESTING_NAME, T1.TESTING_SIZE AS TESTING_SIZE, T1.TESTING_DATE AS TESTING_DATE FROM TESTING T1 UNION SELECT T2.TESTING_TYPE_ID AS UNION_ID, T2.TESTING_NAME AS TESTING_NAME, T2.TESTING_SIZE AS TESTING_SIZE, T2.TESTING_DATE AS TESTING_DATE FROM TESTING T2 ) uva 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)