掲示板

how to retrive data using primerykey from mysql.

11年前 に kumar g によって更新されました。

how to retrive data using primerykey from mysql.

Junior Member 投稿: 95 参加年月日: 12/09/03 最新の投稿
hi to all
I successfully stored data in database(mysql) using liferay,
now i want to retrive data using primerykey from mysql.
how i will do it.? plz guide me...........
thumbnail
11年前 に Priyanka Dhingra によって更新されました。

RE: how to retrive data using primerykey from mysql.

Liferay Master 投稿: 501 参加年月日: 11/12/20 最新の投稿
you can simply use the function
.findByPrimaryKey(key);
11年前 に kumar g によって更新されました。

RE: how to retrive data using primerykey from mysql.

Junior Member 投稿: 95 参加年月日: 12/09/03 最新の投稿
hi priyanka iam not getting your sggestion.... plz guide me?
thumbnail
11年前 に Gaurav Jain によって更新されました。

RE: how to retrive data using primerykey from mysql.

Regular Member 投稿: 145 参加年月日: 11/01/31 最新の投稿
kumar g:
hi to all
I successfully stored data in database(mysql) using liferay,
now i want to retrive data using primerykey from mysql.
how i will do it.? plz guide me...........



Hi Kumar,
I hope you have used liferay service builder to create/save data in your table? So by making an entity?
Suppose your entity name is Employee, and after building services there will be lot of code generated in yuor plugin itself by liferay service builder which include service classes i.e EmployeeLocalService, and util classes like EmployeeLocalServiceUtil

By using this util class EmployeeLocalServiceUtil you can access various methods to retrive data from your entity. Please check those classes and generated methods.

Apart from it, you can also create new method implementations. For that you need to implement your method in EmployeeLocalServiceImpl class and after rebuilding liferay services, using reverse engineering concept, liferay service builder will generate corresponding declarations and utility methods for this in *LocalService and *LocalServiceUtil classes
11年前 に kumar g によって更新されました。

RE: how to retrive data using primerykey from mysql.

Junior Member 投稿: 95 参加年月日: 12/09/03 最新の投稿
thank u friend