Fórumok

How can I define custom field with database column type as CLOB

thumbnail
Raja Seth, módosítva 8 év-val korábban

How can I define custom field with database column type as CLOB

Regular Member Bejegyzések: 233 Csatlakozás dátuma: 2011.08.18. Legújabb bejegyzések
Hi Team,

I want to create one custom field inside Document. Now this field can have value with more than 4000 characters. Can I create custom field in Liferay that can hold data like "CONTENT" field in JournalArticle table have "CLOB" data type.

Please let me know if it is possible or is there any configuration than can be done to achieve this.

Thanks & Regards,
Raja
thumbnail
David H Nebinger, módosítva 8 év-val korábban

RE: How can I define custom field with database column type as CLOB

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
You just need to define the size for the field correctly in the portlet-model-hints.xml file so it will be the correct size.
thumbnail
Raja Seth, módosítva 8 év-val korábban

RE: How can I define custom field with database column type as CLOB

Regular Member Bejegyzések: 233 Csatlakozás dátuma: 2011.08.18. Legújabb bejegyzések
Hi David,

I guess this applies when I am defining my service.xml. My question is how can I define for custom field.

Thanks,
Raja
thumbnail
Raja Seth, módosítva 8 év-val korábban

RE: How can I define custom field with database column type as CLOB

Regular Member Bejegyzések: 233 Csatlakozás dátuma: 2011.08.18. Legújabb bejegyzések
I guess I cant give, because the table ExpandoValue field data_ has DATA_TYPE as VARCHAR2(4000 CHAR), which is fixed.
Govinda N, módosítva 8 év-val korábban

RE: How can I define custom field with database column type as CLOB

Junior Member Bejegyzések: 28 Csatlakozás dátuma: 2014.04.02. Legújabb bejegyzések
Yes with Liferay's custom fields you can't do it but with your own entity, column type can be changed as David mentioned.
thumbnail
David H Nebinger, módosítva 8 év-val korábban

RE: How can I define custom field with database column type as CLOB

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Raja Seth:
I guess I cant give, because the table ExpandoValue field data_ has DATA_TYPE as VARCHAR2(4000 CHAR), which is fixed.


Yeah, no you can't do clob custom fields. You'd have to create your own table for that.

You might consider a service wrapper so you can access the clob from another entity table as an expando, but that would be quite a mess. I did have to do that before for a client that wanted to edit the separate entity as though they were expandos so they could make changes in the user control panel. It was doable, but messy.
thumbnail
Raja Seth, módosítva 8 év-val korábban

RE: How can I define custom field with database column type as CLOB

Regular Member Bejegyzések: 233 Csatlakozás dátuma: 2011.08.18. Legújabb bejegyzések
Hi David & Govinda,

Thanks for your reply. As I needed to store the body section of xml which I was parsing. Now I am directly transforming the xml and showing the content which I don't need to store in my custom fields. Hence my problem is resolved.

Regards,
Raja