Message Boards

« Back to 2.- Usage ( From Xml file to CRUD Portlet)

is it possible to make the field as unique

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi,


Every one,

If we create any table in the My SQL database using xml portlet factory , we cant maintain the uniqueness of the field.Is there any tag to make unique.

RE: is it possible to make unique the field as unique
Answer
12/4/11 9:13 PM as a reply to nagesh vv Bodapati.
Hola nagesh,

There is not any tag to make a field unique, but it is a great idea, there are many aplications that it can fullfill, like National Id, or Social Security number, etc.

Do you know if there is any way to implement it in the service.xml for the service builder? if so it will be very easy to implement, else, we would have to code in the functionality.


Saludos and welcome, Jack.

[SOLVED] RE: is it possible to make the field as unique
Answer
12/9/11 2:25 PM as a reply to nagesh vv Bodapati.
Hello again Nagesh,

Just uploaded a new version with this functionality on it. Have a look here:

New XMLPortletFactory version on SourceForge (December 6, 2011)

Saludos, Jack.emoticon

Pd. : I found out that it can be expresed on service.xml, so service builder would do most of the work. Something like this:

1        <!-- Finder For unique fields  -->
2        <finder name="CourseCode" return-type="courses" unique="true">
3            <finder-column name="courseCode" />
4        </finder>


So this will generate sql unique indexes, etc:
1create unique index IX_6D1E8FCD on coursesexample_courses (courseCode);