ProductPrice Entity, encryption=true

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ProductPrice Entity, encryption=true

twosolution
Hi,

I were wondering to put encryption=true in one of the entity field.

entity-name="ProductPrice"
<field name="price" type="currency-precise"></field>

And because, of the the field type is double in postgresql, meanwhile encrypted value are in varchar
It results of couple of places to customize.
I tried change the entity field into type="short-varchar"

It throws me error of non-setpk when i used encrypted value in ProductPrice

Its anyone been trying to do the same, or is there any workaround ?

Thanks
Jen Sing
Reply | Threaded
Open this post in threaded view
|

Re: ProductPrice Entity, encryption=true

Jacques Le Roux
Administrator
Just about short-varchar, rather use localpostnew type of config and see that it's anyway all text sql-type in fieldtypepostnew.xml
It's explained here https://issues.apache.org/jira/browse/OFBIZ-1920

Jacques

From: "twosolution" <[hidden email]>

> Hi,
>
> I were wondering to put encryption=true in one of the entity field.
>
> entity-name="ProductPrice"
> <field name="price" type="currency-precise"></field>
>
> And because, of the the field type is double in postgresql, meanwhile
> encrypted value are in varchar
> It results of couple of places to customize.
> I tried change the entity field into type="short-varchar"
>
> It throws me error of non-setpk when i used encrypted value in ProductPrice
>
> Its anyone been trying to do the same, or is there any workaround ?
>
> Thanks
> Jen Sing
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/ProductPrice-Entity-encryption-true-tp4639694.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: ProductPrice Entity, encryption=true

twosolution
Hi,

i trying to encrypt price value in the DB.

<entity entity-name="ProductPrice"
            package-name="org.ofbiz.product.price"
            title="Product Price Entity">
<field name="price" type="long-varchar" <b>encrypt="true"></field>

and, by doing so, it require me to customize in couple of places.
for instance

entity-name="ProductPriceChange"
<field name="price" type="long-varchar" encrypt="true"></field>
<field name="oldPrice" type="long-varchar" encrypt="true"></field>

and i also need to change the entity/return type of the ECA and services

<eca service="updateProductPrice" event="commit">
        <condition-field field-name="price" operator="not-equals" to-field-name="oldPrice" <b>type="String"/>
        <action service="saveProductPriceChange" mode="sync"/>
    </eca>

service named= updateProductPrice, deleteProductPrice, saveProductPriceChange

<attribute name="oldPrice" <b>type="String" mode="OUT" optional="false"/>


my question is, is this the task i need to customize should i wants to encrypt entity field other than String ?
Or rather it is not recommend to encrypt entity field that is type of decimal, double, float ?

I would worry by changing the entity field type from decimal to String, it will break logic in others place

Thank you