Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
Vetal Ryabenko
Service Builder and NULL value in DB
31 agosto 2010 4.57
Risposta

Vetal Ryabenko

Punteggio: New Member

Messaggi: 3

Data di Iscrizione: 31 agosto 2010

Messaggi recenti

Hello Everyone.

I've just upgraded to version 6.0.5
I'm using servisebuilder and I have a question

Previously, I was able to write entity (sample):

<entity name="EntityName" local-service="true" remote-service="false">
<column name="id" type="long" primary="true"/>
<column name="sample" type="Long"/> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<Long type (allow null value, but not allowed in liferay)

<finder name="Sample" return-type="EntityName" unique="true"> <<<<<<<<<<Create uniq index in DB
<finder-column name="sample"/>
</ Finder>
</ Entity>

Please take into acccount that the column sample has Long type but not long. In 5.x liferay version I ws able to create entity withg field value == null. This way a was able to have it in unique index because many NULL is accepted in DB.
Now (v. 605), in * hbm.xml service builder specifies the type column:
<property name="sample" type="com.liferay.portal.dao.orm.hibernate.LongType" />

but converts all NULL to zeros ....

respectively, I receive an exception

Is there any way other than manually editing the file * hbm.xml allowing insertion of NULL value in DB

I think is bug
Reinaldo Silva
RE: Service Builder and NULL value in DB
21 settembre 2010 4.35
Risposta

Reinaldo Silva

Punteggio: New Member

Messaggi: 3

Data di Iscrizione: 2 dicembre 2009

Messaggi recenti

Hi,

I have the same problem, I need to keep the NULL values on numeric database columns, but all are converted to zero.

In many contexts is important to differentiate when a user leave a field blank (not required field) and when effectively introduced a zero value.

Any workaround suggested?
Kőhegyi Mariann
RE: Service Builder and NULL value in DB
11 gennaio 2011 12.26
Risposta

Kőhegyi Mariann

Punteggio: New Member

Messaggi: 2

Data di Iscrizione: 3 gennaio 2011

Messaggi recenti

Hi,

Unfortunately, I also have the same problem.

Can someone help me?

Mariann
Jelmer Kuperus
RE: Service Builder and NULL value in DB
11 gennaio 2011 13.10
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1192

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

My recommendation would be to give up trying. I ran into way too many issues trying to use boxed primitives, and ended up changing the column type back to a primitive.
Jonas Yuan
RE: Service Builder and NULL value in DB
23 gennaio 2011 7.48
Risposta

Jonas Yuan

Punteggio: Liferay Master

Messaggi: 993

Data di Iscrizione: 26 aprile 2007

Messaggi recenti