Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Class

former_member329386
Participant
0 Likes
429

Hi experts

What is persistence class ? give example ?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
411

persistence class.

It will generate a class combine with a table, and you can populate the table with this class, include select, insert, modify.

It offer you a way to populate table in a OO way.

But unfortunatly, single persistence class can only combine one table. And after you save the combine relation of the class and table, it is difficult to do further change.

So if your application need to populate multiple table in same time, and do some join select, persistence class won't help too much.

IN THIS CASEBO (business object) will be helpful .

If you don't want to access the relate table directly.

But BO is not a OO way.

You can go through this document to know more about persistent objects.

http://searchsap.techtarget.com/searchSAP/downloads/chapter-june.pdf

2 REPLIES 2
Read only

Former Member
0 Likes
412

persistence class.

It will generate a class combine with a table, and you can populate the table with this class, include select, insert, modify.

It offer you a way to populate table in a OO way.

But unfortunatly, single persistence class can only combine one table. And after you save the combine relation of the class and table, it is difficult to do further change.

So if your application need to populate multiple table in same time, and do some join select, persistence class won't help too much.

IN THIS CASEBO (business object) will be helpful .

If you don't want to access the relate table directly.

But BO is not a OO way.

You can go through this document to know more about persistent objects.

http://searchsap.techtarget.com/searchSAP/downloads/chapter-june.pdf

Read only

Former Member
0 Likes
411

hi

good

Persistent Classes

To use the Persistence Service for objects, the classes of these objects must be created as persistent classes in the Class Builder. The term persistent class does not imply that a class is persistent. (As a template for objects, every class is persistent). Rather, it means that the objects of that class and their state are managed by the Persistence Service. For example, the objects of these classes are instantiated in the ABAP program with a method of the Persistence Service, which ensures that the initialization is correct (not with the usual CREATE OBJECT statement). When the Class Builder creates a persistent class, it automatically generates an associated class, known as the class actor or class agent, whose methods manage the objects of persistent classes. As well as their identity, persistent classes can contain key attributes, which allow the Persistence Service to ensure that the content of each persistent object is unique.

check this example.

http://help.sap.com/saphelp_nw04/helpdata/en/fd/022008bc9311d4b2e80050dadfb92b/content.htm

thanks

mrutyun^