掲示板

CLOB fields in service builder

thumbnail
13年前 に Aritz Galdos によって更新されました。

CLOB fields in service builder

Expert 投稿: 416 参加年月日: 07/05/15 最新の投稿
Hi people:

I´ve been asked to create an entity with the service builder which contains a CLOB field (image) in it.

I guess it should be declared as String in the service builder. But whats next?

I shuold manage to convert it back and forth to and from byte array and so...
Is there any lib/class for this purpouse in LR?

By the way, it is 6.0.5 version. I heard that since 6 series, images are no longer stored in the data base by default. Right?

Thnaks!
thumbnail
13年前 に Sandeep Nair によって更新されました。

RE: CLOB fields in service builder

Liferay Legend 投稿: 1744 参加年月日: 08/11/06 最新の投稿
Hi,

You can do the following steps.

Entry in service.xml

<column name="clobData" type="String" />

Build service

Open portlet-model-hints.xml

Add hint collection for clob as under

<hint-collection name="CLOB">
<hint name="max-length">2000000</hint>
</hint-collection>

Edit hint definition for the column in above case my column name is clobData

<field name="clobData" type="String">
<hint-collection name="CLOB" />
</field>

Build service again and deploy

To convert byte array to String use the following

Base64.objectToString(bytes);

To convert String to byte use the following

(byte[])Base64.stringToObject(stringValue);

Regards,
Sandeep
thumbnail
11年前 に Behzad Gadimi によって更新されました。

RE: CLOB fields in service builder

Junior Member 投稿: 36 参加年月日: 11/03/08 最新の投稿
Sandeep Nair:
Hi,

You can do the following steps.

Entry in service.xml

<column name="clobData" type="String" />

Build service

Open portlet-model-hints.xml

Add hint collection for clob as under

<hint-collection name="CLOB">
<hint name="max-length">2000000</hint>
</hint-collection>

Edit hint definition for the column in above case my column name is clobData

<field name="clobData" type="String">
<hint-collection name="CLOB" />
</field>

Build service again and deploy

To convert byte array to String use the following

Base64.objectToString(bytes);

To convert String to byte use the following

(byte[])Base64.stringToObject(stringValue);

Regards,
Sandeep


what is the maximum image size that can be stored in CLOB filed?
what is max-length in this example?