cancel
Showing results for 
Search instead for 
Did you mean: 

query regarding the onload event of orderlist.java in MAM code

Former Member
0 Kudos

a) Condition condition = null;

b) condition = queryBuilder.getOrderSimpleCondition ("SYNC_KEY", RelationalOperatorType.NOT_EQUALS, "0");

}

c) context.addValue("orderListType", orderListType);

-


In the above lines of code ,

Plesae tell few things:

1) what is the purpose of Condtion Object in a) ?

2) what is the purpose of querybuilder in b)? Does it just makes a condtion for the data to be fetched or after making the condition it goes to the database and fetches the result ? .

When i debug the application condition just contains " SYNC_KEY<> 0"

3) In c) orderlisttype is the list variable that contains the orders fetched from database, if i am right ? Then who is setting the orders from the database to this list variable ?

-


Basically , i am looking for how data is fetched from database , put into variables ane then how data from these variables is shown to the user through JSP in MAM Code ?

I tried to debug the application and understanding it , but debugging takes you into JAR files ( compiles class files ), so got stuck there.

SO , could anybdy please share his knowledge on MAM Code or how to go abt it ?

Thanks & Regards,

Vipin

Accepted Solutions (0)

Answers (1)

Answers (1)

sandeep_rs
Advisor
Advisor
0 Kudos

Hi Vipin,

Condition is used so that a query can be performed on the database and only records true to the Condition can be selected. In simple terms Condition forms the where clause of the query.

As such, creating a Condition object itself will not result in a hit to the database. But Condition can be used in creating a Query object to form the Where clause part of the query.

Best Regards,

Sandeep

Former Member
0 Kudos

Hi Sandeep,

Thank you for your inputs. I got about the condition object .

Could you please hint me regarding how data is being fetched and then shown to user via JSP ? where/how are the queries fired as condtion objects are just conditions ?

actually i have understood that data is set in context and JSP takes data from the context. But how data is taken from database and set to context ??-- this i couldnt get it

Could you give any hints ( classes involved / their flow (if any ) for the same ? or may be if you have MAM code u can just give hints regarding any screen ( order list or order details )

Regards,

Vipin.

sandeep_rs
Advisor
Advisor
0 Kudos

Hi Vipin,

Data is fetched from the database into the java objects by using the MI Persistence APIs. The application will create the Condiditon objects (using MI peristence APIs) and then create Query objects, for which the Condition objects are passed as parameters. Then persistenceManager.get(Query) APIs are used to fetch the result set having the records from the database into the java objects to be passed back to the JSP.

Best Regards,

Sandeep

Former Member
0 Kudos

Hi Vipin.

I am using MAU but as it depends on MAM I guess this will also help.

You can find the MAM Sync BOs in the package:

com.sap.mbs.alm.bo

Here you find classes for the BO and its items. Furthermore you will find a manager class for each BO.

The manager class is used to get the data from the persistence or to create new BOs and write them to Persistence.

For example the MAM010Manager for notification BOs has the method:

public BOList getMam010s() throws BOException;

which returns a list of all notifications from the persistence on your client.

So if you want to extend the application it would be a good start to have a look at this package and study the Manager classes.

Best regards,

Sascha

Former Member
0 Kudos

Hi Vipin,

MAM uses specialized tag libraries to e.g. render tables (e.g. the order list). For this tag you can either set a list of BOs (select all orders that should be displayed by the list) or you define a query. THis information is handedover to the taglib via the context as far as I know. May you have a look at the PageBuilder class in the tools package (com\sap\mbs\tools\list). As well a lot of other classes doing rendering are in there. (sorry, its been a while ago when I was impl. on MAM...)

Rgds THomas

Former Member
0 Kudos

Hi all,

Thanks to everybdy for their inputs and i am able to track many things in Code nw.

Could you guys tell me few details about this function ?

public BOList getMam001s() throws BOException {

Object pTag = PerformanceLog.methodStarted(this);

try {

BOList list = (BOList)naming.create(BOList.class.getName());

RowCollection rows = dataFacade.getRows(SYNC_BO_DESC.getTopRowDescriptor());

............

..............} //Function Ends

1) what is the pupose of below line of code ?

Object pTag = PerformanceLog.methodStarted(this);

2) RowCollection rows = dataFacade.getRows(SYNC_BO_DESC.getTopRowDescriptor());

With the above line of code , are we asking the persistance to get us the data for Orders SynBO ?

If yes, then this means rows variable should have all the Orders data in it, Am i right ?

Also, as we can see from MAM code that for fetching orders data , we use following condition:

condition = queryBuilder.getOrderSimpleCondition("SYNC_KEY", RelationalOperatorType.NOT_EQUALS, "0");

I cant see this condition being used , if above statement is used for getting data ?

3)One more thing, as we know that getMam001s() fucntion fetches the data for order list. i have put a debug point in this function . But , while debugging control never reaches in this function.

Debug is able to reach following function:

class ListTag :

public int doStartTag() throws JspException

{

pageContext.getOut().print(PageBuilder.displayList(listName, pageContext, getListHeaderScope(), getListDataScope(),getNavigationLinkScope()));

}

Thanks & Regards,

Vipin.