留言板

Liferay 7 Service Builder Table Creation Issue

thumbnail
Sai Mohan Gadamsetty,修改在7 年前。

Liferay 7 Service Builder Table Creation Issue

Junior Member 帖子: 92 加入日期: 13-2-6 最近的帖子
I am trying to create a sample service builder as provided in the documentation (Liferay 7).
https://web.liferay.com/web/zhao.jin/blog/-/blogs/creating-service-builder-mvc-portlet-in-liferay-7-with-liferay-ide-3-
I did build and Deploy with out any errors but table not get created in the database. I used default Foo (Sample) to build and generate tables.
And in log it says Foo api and service started.
Verified in ServiceComponent table as well, I didn't see Name sample with (Foo) given in the service.xml file.
Liferay Version: Liferay 7 GA2
Database: MariaDB (10.1.16) (and tried with MySql 5.6 also)

I used to create Service Builder with (using Liferay 7 sdk), it deployed and created tables without any errors.
What I'm missing here please help me to know this issue.






!!
thumbnail
Juan Gonzalez,修改在7 年前。

RE: Liferay 7 Service Builder Table Creation Issue

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
thumbnail
Sai Mohan Gadamsetty,修改在7 年前。

RE: Liferay 7 Service Builder Table Creation Issue

Junior Member 帖子: 92 加入日期: 13-2-6 最近的帖子
Hi Juan Gonzalez,

Worked your instructions, I am able generate sql tables after changes 'compileOnly' to 'compile' (build.gradle file)

Thank you very much for your help.
thumbnail
Juan Gonzalez,修改在7 年前。

RE: Liferay 7 Service Builder Table Creation Issue

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
Sai Mohan Gadamsetty:
Hi Juan Gonzalez,

Worked your instructions, I am able generate sql tables after changes 'compileOnly' to 'compile' (build.gradle file)

Thank you very much for your help.


Glad it worked for you ;-).
thumbnail
Sai Mohan Gadamsetty,修改在7 年前。

RE: Liferay 7 Service Builder Table Creation Issue

Junior Member 帖子: 92 加入日期: 13-2-6 最近的帖子
I might ask this in a different thread but it related to Service builder table generation so I keeping my request here..

When I try to create an association table, I found one default column is creating with new table, new column didn't specified in service.xml file

E.g: in my service.xml (attached service.xml file) file I used one relationship for two tables to store their main id's
After executing build service then it generate sql query as below

create table Sai_Course (
courseId LONG not null primary key,
courseName VARCHAR(75) null,
courseGroup VARCHAR(75) null
);

create table Sai_Student (
studentId LONG not null primary key,
studentName VARCHAR(75) null,
studentPlace VARCHAR(75) null,
studentCollege VARCHAR(75) null
);

create table Sai_Students_Courses (
companyId LONG not null,
courseId LONG not null,
studentId LONG not null,
primary key (courseId, studentId)
);
When I try to run the deploy target then its showing me below error (attached log file)

I didn't face this issue with previous version of Liferay (6.1 or 6.2). Could you please advise your inputs how to overcome this. Did I miss any thing here please advise your thoughts.