Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Seeya S Kudtarker
Uploading Imges in liferay
March 19, 2013 11:06 PM
Answer

Seeya S Kudtarker

Rank: Regular Member

Posts: 187

Join Date: January 15, 2013

Recent Posts

I want to store images in my MySQL database.
My service.xml goes like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
<service-builder package-path="com.test.blob.upload">
<author>seeya</author>
<namespace>blob</namespace>
<entity name="blobupload" local-service="true" remote-service="true">
<column name="blobId" type="long" primary="true" />
<column name="picture" type="Blob" />
<column name="desc" type="String" />
</entity>
</service-builder>

When i build services I get BUILD SUCCESSFUL message but an error in package com.test.blob.upload in the blobuploadModelImpl class. the error is below highlighted in bold:
@Override
public void resetOriginalValues() {
blobuploadModelImpl._pictureBlobModel = null;
}
the suggestion is
change modifier of pictureBlobModel to static


How should I write function to store image in databse and retrieve it?
Jan van der Kaaden
RE: Uploading Imges in liferay
March 24, 2013 2:10 PM
Answer

Jan van der Kaaden

Rank: New Member

Posts: 20

Join Date: March 20, 2011

Recent Posts

Hi Seeya,
I think you need to start the name of your entity with a capital like Blobupload. This way there will be no confusion with classes and instances generating the code.

Regards,
Jan
Seeya S Kudtarker
RE: Uploading Imges in liferay
March 24, 2013 10:01 PM
Answer

Seeya S Kudtarker

Rank: Regular Member

Posts: 187

Join Date: January 15, 2013

Recent Posts

Jan van der Kaaden:
Thanks!! I will follow it from now on!!