Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Shilpa B
in service.xml, datatype for textarea field
October 29, 2012 4:05 AM
Answer

Shilpa B

Rank: Junior Member

Posts: 51

Join Date: August 2, 2012

Recent Posts

I'm creating a table which has text area field, means i want to store a long text more than one line data. I want know what will be the datatype for that column. Im using SQLyog.

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

i trying with this one, but it storing only 75 characters. Can i get any help.

Thanks, In Advance
Tejas Kanani
RE: in service.xml, datatype for textarea field
October 29, 2012 4:37 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 653

Join Date: January 6, 2009

Recent Posts

Hi Shilpa,

You can do it via portal-model-hints.xml, which has custom DB column size modification.
You can use "CLOB" from that.

For more details visit below wiki page.
Customize DB Column Sizes

You might need to override portal-model-hints.xml.

Thanks,
Tejas
Jitendra Rajput
RE: in service.xml, datatype for textarea field
October 29, 2012 4:44 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 738

Join Date: January 7, 2011

Recent Posts

For complete example refer to this link
Manish Yadav
RE: in service.xml, datatype for textarea field
October 29, 2012 6:53 AM
Answer

Manish Yadav

Rank: Expert

Posts: 384

Join Date: May 26, 2012

Recent Posts

you can directly increase size of column in sql/tables.sql file from 75 to whatever you required
Harish Kumar
RE: in service.xml, datatype for textarea field
October 30, 2012 2:38 AM
Answer

Harish Kumar

Rank: Expert

Posts: 336

Join Date: July 31, 2010

Recent Posts

Hi Manish,

Directly modifying sql/tables.sql won't help as service implement classes have validation checks for the specified column width.
André Bunse
RE: in service.xml, datatype for textarea field
October 30, 2012 2:46 AM
Answer

André Bunse

Rank: Junior Member

Posts: 85

Join Date: March 15, 2012

Recent Posts

Change the model definition in META-INF/portlet-model-hints.xml

Default field definition looks like this:
1<field name="yourFieldName" type="String"/>

Set new field length:
1<field name="yourFieldName" type="String">
2    <hint name="max-length">255</hint>
3</field>


HTH
André
Shilpa B
RE: in service.xml, datatype for textarea field
November 23, 2012 2:39 AM
Answer

Shilpa B

Rank: Junior Member

Posts: 51

Join Date: August 2, 2012

Recent Posts

thank you for your answer
Shilpa B
RE: in service.xml, datatype for textarea field
November 23, 2012 2:39 AM
Answer

Shilpa B

Rank: Junior Member

Posts: 51

Join Date: August 2, 2012

Recent Posts

thank you , its working