[ https://issues.apache.org/jira/browse/OFBIZ-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638883#action_12638883 ]
Jacques Le Roux commented on OFBIZ-1252: ---------------------------------------- Hi Fabien, Sorry to be so late (near one year), but fortunately it is still mergeable without conflicts. I just did a 1st review of your patch and 2 points make me wonder. * Why do you need to do this ? {code} - <xs:attribute type="xs:string" name="entity-alias" use="required"/> - <xs:attribute type="xs:string" name="field" use="required"/> + <xs:attribute type="xs:string" name="entity-alias"/> + <xs:attribute type="xs:string" name="field"/> {code} * Are you sure that in {code} + if (fieldTypeBuffer.length() == 0) { + fieldTypeBuffer.append("currency-amount"); {code} currency-amount is the only case ? Moreover I'd really appreciate if you had an use-case or example as Adam already asked. Also I'm not sure this is not already (partially not sure for constants) accomplished as I see this in entitymodel.xsd {code} In every SELECT statement, the fields that are normally used are really defined to be expressions. This means for example that you can supply an expression like (discountPercent * 100) in place of just a field name. The complex-alias tag is the Ofbiz way to do this. The argument to the right of operator = can be any operator valid for that data type on the database system you are using. For example, *, +, -, and / are commonly available mathematical operators (min, max, sum, avg, count, count-distinct, upper, lower) You can also use any operator on any data type supported on the underlying database system including string and date operators. complex-alias can be as complex as you need by adding nested complex-alias statements and complex-alias-field can use the same functions (min, max, count, count-distinct, sum, avg, upper, and lower) as the alias tag. {code} What is for you an SQL function ? Thanks > To permit to use constant and SQL function in entities which has > complex-alias fields. > -------------------------------------------------------------------------------------- > > Key: OFBIZ-1252 > URL: https://issues.apache.org/jira/browse/OFBIZ-1252 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: sql_complexalias_constant_diff.patch > > > To permit to use constant and SQL function in entities which has > complex-alias fields. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.