user1592470
user1592470

Reputation: 401

Liferay Exception Data while persistance update

I'm using Liferay with ServiceBuilder but trying to read a code file into String and saving it into the DB, using the update method, I get this error:

   return irRulePersistence.update(rule, false);

Error: Data exception error truncated to the left.

I created this column with the service.xml file:

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

Is there any other type required for saving long Strings?

Can I save a .drl file into the DB? If yes, what can I do? Is there any guide explaining that?

Thank you so much, Oriol

Upvotes: 0

Views: 105

Answers (1)

Pankaj Kathiriya
Pankaj Kathiriya

Reputation: 4210

For storing long string , you can have entry in portlet-model-hints.xml as

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

<column name="file" type="Blob" />

You can use type Blob to store file to DB. You can refer to DBStore.java -->updateFile for detail

Upvotes: 2

Related Questions