フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Friends Team
how to retrive data using primerykey from mysql.
2012/10/30 22:31
答え

Friends Team

ランク: Junior Member

投稿: 97

参加年月日: 2012/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...........
Priyanka Dhingra
RE: how to retrive data using primerykey from mysql.
2012/10/30 22:40
答え

Priyanka Dhingra

ランク: Liferay Master

投稿: 501

参加年月日: 2011/12/19

最近の投稿

you can simply use the function
.findByPrimaryKey(key);
Friends Team
RE: how to retrive data using primerykey from mysql.
2012/10/30 22:45
答え

Friends Team

ランク: Junior Member

投稿: 97

参加年月日: 2012/09/03

最近の投稿

hi priyanka iam not getting your sggestion.... plz guide me?
Gaurav Jain
RE: how to retrive data using primerykey from mysql.
2012/10/30 22:47
答え

Gaurav Jain

ランク: Regular Member

投稿: 146

参加年月日: 2011/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
Friends Team
RE: how to retrive data using primerykey from mysql.
2012/10/30 22:49
答え

Friends Team

ランク: Junior Member

投稿: 97

参加年月日: 2012/09/03

最近の投稿

thank u friend