Using delegator in Java Events

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

Using delegator in Java Events

Foo Shyn Chung
Hi all,

I'm using Ofbiz 11.04 branch as the base for my project currently. The
database i'm using is Postgres.

In one of the module, due to the restriction of using the service, i need
to use Java Events to retrieve the value from a form and save it into the
database. I'm using the delegator to store the value to the database.
(delegator.create and delegator.storeAll)

I notice that whenever a database column is of text type, if the field is
empty or null during the transaction, the value stored into the database
will be 2 single quotes: ''

There's no such issue when i use service to store value in other module. Is
this intentional, a bug or I did something wrong that provoked such problem?

Appreciate any pointers.

Thanx
FooShyn
Reply | Threaded
Open this post in threaded view
|

Re: Using delegator in Java Events

Jacques Le Roux
Administrator
I think there is something wrong in your code.
At least this is not intended (could be an OOTB bug I mean)

Jacques

From: "Foo Shyn Chung" <[hidden email]>

> Hi all,
>
> I'm using Ofbiz 11.04 branch as the base for my project currently. The
> database i'm using is Postgres.
>
> In one of the module, due to the restriction of using the service, i need
> to use Java Events to retrieve the value from a form and save it into the
> database. I'm using the delegator to store the value to the database.
> (delegator.create and delegator.storeAll)
>
> I notice that whenever a database column is of text type, if the field is
> empty or null during the transaction, the value stored into the database
> will be 2 single quotes: ''
>
> There's no such issue when i use service to store value in other module. Is
> this intentional, a bug or I did something wrong that provoked such problem?
>
> Appreciate any pointers.
>
> Thanx
> FooShyn
>
Reply | Threaded
Open this post in threaded view
|

Re: Using delegator in Java Events

Foo Shyn Chung
Sorry i think i'd might have raised a false alarm, after further check on
postgres forum i found this:

" It's just a data visualization problem, the field actually contains an
empty string and each and every program that accesses that row will get an
empty string.
I suspect you get that in PgAdmin, and it's a way of telling you it's an
empty string and not a null. "

A comment from one of the forumer.

Thanx and sorry for the trouble.
FooShyn

On Tue, Mar 27, 2012 at 1:51 AM, Jacques Le Roux <
[hidden email]> wrote:

> I think there is something wrong in your code.
> At least this is not intended (could be an OOTB bug I mean)
>
> Jacques
>
> From: "Foo Shyn Chung" <[hidden email]>
>
>  Hi all,
>>
>> I'm using Ofbiz 11.04 branch as the base for my project currently. The
>> database i'm using is Postgres.
>>
>> In one of the module, due to the restriction of using the service, i need
>> to use Java Events to retrieve the value from a form and save it into the
>> database. I'm using the delegator to store the value to the database.
>> (delegator.create and delegator.storeAll)
>>
>> I notice that whenever a database column is of text type, if the field is
>> empty or null during the transaction, the value stored into the database
>> will be 2 single quotes: ''
>>
>> There's no such issue when i use service to store value in other module.
>> Is
>> this intentional, a bug or I did something wrong that provoked such
>> problem?
>>
>> Appreciate any pointers.
>>
>> Thanx
>> FooShyn
>>
>>