Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
kavitha pazhanee
adding new column to the service.xml deletes entries from existing table
13. Januar 2012 03:09
Antwort

kavitha pazhanee

Rang: New Member

Nachrichten: 11

Eintrittsdatum: 11. August 2011

Neue Beiträge

Hi all,
I have a plugin portlet which is connecting to a userdefined table in liferay database. Now i need to add a new column to the existing database.
i tried to define the column by
putting the following entries in service.xml
<column name="fundingFlag" type="String"/>
and a finder method as below
<finder name="FundingFlag" return-type="Collection">
<finder-column name="fundingFlag"/>
</finder>


then i ran the ant script, it built its own impl methods successfully and a war file was created.
But when i try to deploy the war file, the new column is created successfully in the database table, but the existing rows in the table is deleted.

Can anyone please help me to add the column to a table without overwriting the existing one.

i am using tomcat 5.2.3 with eclipse 3.5

Regards,
kavitha
Prakash Khanchandani
RE: adding new column to the service.xml deletes entries from existing tabl
13. Januar 2012 03:20
Antwort

Prakash Khanchandani

Rang: Expert

Nachrichten: 329

Eintrittsdatum: 10. Februar 2011

Neue Beiträge

In my case it didn't delete the other rows in the table, it just altered the table to add the required columns. Which is ideally and normally the case.

I m using Liferay 6.0 and MySQL or Oracle database. which version of liferay & database are you using?
kavitha pazhanee
RE: adding new column to the service.xml deletes entries from existing tabl
13. Januar 2012 03:27
Antwort

kavitha pazhanee

Rang: New Member

Nachrichten: 11

Eintrittsdatum: 11. August 2011

Neue Beiträge

i am using liferay 5.2.3 with mysql as the db.

Regards,
kavitha
Jitendra Rajput
RE: adding new column to the service.xml deletes entries from existing tabl
13. Januar 2012 03:40
Antwort

Jitendra Rajput

Rang: Liferay Master

Nachrichten: 858

Eintrittsdatum: 7. Januar 2011

Neue Beiträge

After successful build service analyze tables.sql ...and check create table query
kavitha pazhanee
RE: adding new column to the service.xml deletes entries from existing tabl
13. Januar 2012 04:01
Antwort

kavitha pazhanee

Rang: New Member

Nachrichten: 11

Eintrittsdatum: 11. August 2011

Neue Beiträge

it looks to be a normal create table query with a new column added as what i created.
kavitha pazhanee
RE: adding new column to the service.xml deletes entries from existing tabl
31. Januar 2012 04:37
Antwort

kavitha pazhanee

Rang: New Member

Nachrichten: 11

Eintrittsdatum: 11. August 2011

Neue Beiträge

can anyone help me in solving this issue please