Forums de discussion

Service-builder foreignkeys and column length

thumbnail
Puj Z, modifié il y a 13 années.

Service-builder foreignkeys and column length

Regular Member Publications: 220 Date d'inscription: 14/01/10 Publications récentes
Hi,

I have not found anything regarding defining forein keys when using service builder. Is there a way to do that? If not, what is the reason? Because technically it doesn't seem to be difficult.

Another thing I have not found is how to define length for columns (for example with the type "String"). A default value of 75 is generated when a column is created in mysqll (varchar(75)) and then we have to manually change this, which is not an ideal way because the whole table is replaced after running service.xml later.

Is there any solutions\workarounds for this? Any help would rescue a desperate man!
thumbnail
Henrique Simoes de Andrade, modifié il y a 13 années.

RE: Service-builder foreignkeys and column length

Regular Member Publications: 165 Date d'inscription: 30/04/10 Publications récentes
Hi,

Foreign keys: I have the same problem.

Columns length: locate portlet-model-hints.xml in your project, there you can define length and other things for columns. Example:
		<field name="kaleoNodeName" type="String">
			<hint name="max-length">200</hint>
		</field>


HTH
thumbnail
Puj Z, modifié il y a 13 années.

RE: Service-builder foreignkeys and column length

Regular Member Publications: 220 Date d'inscription: 14/01/10 Publications récentes
Hi Henrique,

thanks, but the problem is this file is being overwritten if you run service-builder again, right?

Is there any persistent solution?
thumbnail
Henrique Simoes de Andrade, modifié il y a 13 années.

RE: Service-builder foreignkeys and column length

Regular Member Publications: 165 Date d'inscription: 30/04/10 Publications récentes
ehe no... this file is not overwritten.

You can edit without problem, there is a wiki http://www.liferay.com/community/wiki/-/wiki/1071674/Customize+DB+Column+Sizes/maximized with some tips about model-hints.

When run ant build-service, these changes aren't discarted.

Take a look here: http://www.liferay.com/community/wiki/-/wiki/1071674/Service+Builder+and+Liferay+Database+Table+Creation/maximized and here http://www.liferay.com/web/guest/community/forums/-/message_boards/message/3857549
thumbnail
Puj Z, modifié il y a 13 années.

RE: Service-builder foreignkeys and column length

Regular Member Publications: 220 Date d'inscription: 14/01/10 Publications récentes
Hi Henrique,

Thanks! I was not able to find this article, very useful! emoticon

I hope someone can also provide an answer on foreign-keys in Service-builder.
thumbnail
Puj Z, modifié il y a 13 années.

RE: Service-builder foreignkeys and column length

Regular Member Publications: 220 Date d'inscription: 14/01/10 Publications récentes
While searching, I stumbled upon some news claiming that service-builder in liferay6.1 will offer many to many relationship. If anyone has more info on this, please share.
thumbnail
Scott Rabon, modifié il y a 13 années.

RE: Service-builder foreignkeys and column length

Junior Member Publications: 48 Date d'inscription: 15/04/10 Publications récentes
Try looking in the DTD file of the service.xml file. There is a lot of helpful info in there. The URL is http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd.
Deepak pal, modifié il y a 6 années.

RE: Service-builder foreignkeys and column length

New Member Publications: 15 Date d'inscription: 09/03/16 Publications récentes
thanks, but the problem is this file is being overwritten if you run service-builder again, right?

Is there any persistent solution?

Hi Puj Z,
Can you provide me solution how we can icrease coulomn size of a table. And if i run service builder it should be remain same . Actually facing problem when i run build service then all the changage done by me lost and default size set 75 varchar.

Thanks for any suggetion.
thumbnail
Piyush Ramani, modifié il y a 11 années.

RE: Service-builder foreignkeys and column length

New Member Envoyer: 1 Date d'inscription: 16/03/13 Publications récentes
Thanks it really helpful to me..