anchor.diff:  							</form>
   						</td>
   					</tr>
  -
  -					<%
  -						EntityManagerFactory entityManagerFactory = Persistence
  -								.createEntityManagerFactory("salesorderprocessing");
  -						EntityManager entityManager = entityManagerFactory
  -								.createEntityManager();
  -						DataGenerator dataGenerator = new DataGenerator(entityManager);
  -
  -						Number result1 = null;
  -						Number existingCount = null;
  -
  -						String msg = null;
  -						if (request.getParameter("button") != null) {
  -							if (request.getParameter("button").equalsIgnoreCase("Generate")) {
  -								Query q = entityManager
  -										.createQuery("SELECT COUNT(x) FROM SalesOrderHeader x");
  -								existingCount = (Number) q.getSingleResult();
  -								if (existingCount.intValue() == 0) { // Generate only if no data!
  -									dataGenerator.generate();
  -									result1 = (Number) q.getSingleResult();
  -									System.out
  -											.println("Data not existing earlier.... Generated number of Items - "
  -													+ result1);
  -									msg = result1 + " items generated ";
  -
  -								} else {
  -									System.err
  -											.println("Data already existing.... No Item generated by Data Generator !!");
  -									msg = "Data exists. No Item generated !!";
  -								}
  -							} else { //Clean
  -
  -								// Check if data already exists
  -								Query q = entityManager
  -										.createQuery("SELECT COUNT(x) FROM SalesOrderHeader x");
  -								Number result = (Number) q.getSingleResult();
  -								if (result.intValue() > 0) { // Generate only if no data!
  -									dataGenerator.clean();
  -									msg = "Data Cleaned. " + result + " items cleaned.";
  -								} else {
  -									msg = " Nothing to clean!!";
  -								}
  -							}
  -					%>
  -					<tr>
  -						<td colspan="2"><h5><%=(msg)%></h5></td>
  -					</tr>
  -					<%
  -						}
  -					%>
  -
   				</table>
   			</td>
   		</tr>
   	</table>
  +
   	<hr>
  -	<h4>Metadata and Service Document</h4>
  -	<ul>
  -		<li><a href="SalesOrderProcessing.svc?_wadl" target="_blank">wadl</a></li>
  -		<li><a href="SalesOrderProcessing.svc/" target="_blank">service
  -				document</a></li>
  -		<li><a href="SalesOrderProcessing.svc/$metadata" target="_blank">metadata</a></li>
  -	</ul>
  -
  -	<h4>System Query Options</h4>
  -	<table width=80% border="1" cellpadding="3" cellspacing="0">
  -
  +	<table width=100% cellspacing="1">
   		<tr>
  -			<th>OData Request</th>
  -			<th>JPQL Statement</th>
  +			<td width="2%">
  +				<div id="s1e" onClick="toggle('s1','s1e');"
  +					style="cursor: hand; cursor: pointer; color: blue; width: 100%;">
  +					[ <b>:.</b> ]
  +				</div>
  +			</td>
  +			<td width="98%"><b>Service Document and Metadata</b></td>
   		</tr>
  -
  +	</table>
  +	<br>
  +
  +	<div id="s1" style="display: none">
  +		<ul>
  +			<li><a href="SalesOrderProcessing.svc?_wadl" target="_blank">wadl</a></li>
  +			<li><a href="SalesOrderProcessing.svc/" target="_blank">service
  +					document</a></li>
  +			<li><a href="SalesOrderProcessing.svc/$metadata" target="_blank">metadata</a></li>
  +		</ul>
  +	</div>
  +
  +
  +	<table width=100% cellspacing="1">
   		<tr>
  -			<td width=40%><font size="3"><a
  -				href="SalesOrderProcessing.svc/SalesOrderHeaders" target="_blank">Simple
  -					Query</a></font></td>
  -			<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1</code></td>
  +			<td width="2%">
  +				<div id="s2e" onClick="toggle('s2','s2e');"
  +					style="cursor: hand; cursor: pointer; color: blue; width: 100%;">
  +					[ <b>:.</b> ]
  +				</div>
  +			</td>
  +			<td width="98%"><b>System Query Options</b></td>
   		</tr>
  -		<tr>
  -			<td width=40%><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=SoId eq 1"
  -			target="_blank">Query for Sales Order Id 1</a></td>
  -			<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1 WHERE E1.soId = 1</code></td>
  -		</tr>
  -		
  -
   	</table>
  -	<ul>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerId eq 2"
  -			target="_blank">Query for Buyer Id 2</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerName eq 'buyerName_3'"
  -			target="_blank">Query for Buyer Name</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=CurrencyCode eq 'Code_4'"
  -			target="_blank">Query for Currency Code</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=DeliveryStatus eq false"
  -			target="_blank">Query for Delivery Status</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=CreationDate eq SYSDATE"
  -			target="_blank">Query for Creation Date</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerAddress/HouseNumber eq 7"
  -			target="_blank">Query for Member Expression:House Number</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerAddress/StreetName eq 'Test_Street_Name_8'"
  -			target="_blank">Query for Member Expression:Street Name</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerAddress/City eq 'Test_City_9'"
  -			target="_blank">Query for Member Expression:City</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerAddress/Country eq 'Test_Country_10'"
  -			target="_blank">Query for Member Expression:Country</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerId le 5 and BuyerAddress/Country eq 'Test_Country_3'"
  -			target="_blank">Query using AND operator</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerId le 5 or SoId gt 5"
  -			target="_blank">Query using OR operator</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$orderby=BuyerId desc"
  -			target="_blank">ORDERBY System query option:Descending Order</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$orderby=SoId asc"
  -			target="_blank">ORDERBY System query option:Ascending Order</a></li>
  -		<li><a href="SalesOrderProcessing.svc/SalesOrderHeaders?$top=3"
  -			target="_blank">Top System query option</a></li>
  -		<li><a href="SalesOrderProcessing.svc/SalesOrderHeaders?$skip=2"
  -			target="_blank">Skip System query option</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$inlinecount=allpages"
  -			target="_blank">Inlinecount System query option</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$select=BuyerId,BuyerAddress/Country"
  -			target="_blank">Select System query option</a></li>
  -		<li><a
  -			href="SalesOrderProcessing.svc/SalesOrderHeaders?$skip=2&$top=2&$orderby=SoId"
  -			target="_blank">Mixed Query Example</a></li>
  -	</ul>
  +	<br>
  +	<div id="s2" style="display: none">
  +		<table width=100% border="1" cellpadding="3" cellspacing="0">
  +
  +			<tr bgcolor="#F0F0F0">
  +				<th align="left">Use Case</th>
  +				<th align="left">OData Request</th>
  +				<th align="left">JPQL Statement</th>
  +			</tr>
  +
  +			<tr style="font-size: 12pts">
  +				<td width=20%>Query all Sales Orders</td>
  +				<td width=40%><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders" target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders
  +				</a></td>
  +				<td width=40%><code>SELECT E1 FROM SalesOrderHeader E1</code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td width=20%>Query for Sales Order with So ID = 1</td>
  +				<td width=40%><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=SoId eq 1"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$filter=SoId
  +						eq 1</a></td>
  +				<td width=40%><code>SELECT E1 FROM SalesOrderHeader E1
  +						WHERE E1.soId = 1</code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for Sales Order with Buyer Name = buyerName_3</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerName eq 'buyerName_3'"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerName
  +						eq 'buyerName_3'</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						WHERE E1.buyerName = 'buyerName_3'</code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for undelivered Sales Orders</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=DeliveryStatus eq false"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$filter=DeliveryStatus
  +						eq false</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						WHERE E1.deliveryStatus = 'false'</code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for Sales Order created today</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=CreationDate eq SYSDATE"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$filter=CreationDate
  +						eq SYSDATE</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						WHERE E1.creationDate = d'xx'</code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for Sales Order with Buyer Address House number = 7</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerAddress/HouseNumber eq 7"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerAddress/HouseNumber
  +						eq 7 </a></td>
  +				<td width=60%><code> </code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for SalesOrders with buyer id less than 5 and Buyer
  +					Country = Test_Country_3</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerId le 5 and BuyerAddress/Country eq 'Test_Country_3'"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerId
  +						le 5 and BuyerAddress/Country eq 'Test_Country_3'</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						WHERE E1.buyerId &lt; 5 and E1.buyerAddress.Country =
  +						'Test_Country_3'</code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for SalesOrders with buyer id less than 5 or Sales
  +					Order Id greater than 5</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerId le 5 or SoId gt 5"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$filter=BuyerId
  +						le 5 or SoId gt 5</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						WHERE E1.buyerId &lt; 5 or E1.soId &gt; 5 </code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for SalesOrders in the descending order of Buyer Id</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$orderby=BuyerId desc"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$orderby=BuyerId
  +						desc</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						ORDERBY E1.buyerId desc </code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for SalesOrders in the ascending order of Sales Order
  +					Id</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$orderby=SoId asc"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$orderby=SoId
  +						asc</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						ORDERBY E1.soId </code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for top 3 SalesOrders</td>
  +				<td><a href="SalesOrderProcessing.svc/SalesOrderHeaders?$top=3"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$top=3</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						ORDERBY E1.soId </code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for SalesOrders and Skip top 3</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$skip=2"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$skip=2</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1
  +						ORDERBY E1.soId </code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for SalesOrders and count Number of Sales Orders
  +					Inline</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$inlinecount=allpages"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$inlinecount=allpages</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1</code></td>
  +			</tr>
  +			<tr style="font-size: 12pts">
  +				<td>Query for SalesOrders and fetch only Buyer Id and Buyer Country</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$select=BuyerId,BuyerAddress/Country"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$select=BuyerId,BuyerAddress/Country</a></td>
  +				<td width=60%><code>SELECT E1.buyerId, E1.buyerAddress.country FROM SalesOrderHeader E1</code></td>
  +			</tr>		
  +			<tr style="font-size: 12pts">
  +				<td>Mixed Query Example</td>
  +				<td><a
  +					href="SalesOrderProcessing.svc/SalesOrderHeaders?$skip=2&$top=2&$orderby=SoId"
  +					target="_blank">SalesOrderProcessing.svc/SalesOrderHeaders?$skip=2&amp;$top=2&amp;$orderby=SoId</a></td>
  +				<td width=60%><code>SELECT E1 FROM SalesOrderHeader E1 ORDERBY E1.soId asc</code></td>
  +			</tr>	
  +		</table>
  +	</div>
   
   	<h4>Read Operation</h4>
   	<ul>
  
positive.code: 
  <html>
  <head>
  
  <style type="text/css">
  body {
  	font-family: "Arial";
  
negative.code: 			target="_blank">Exception Handling:Case 3</a></li>
  	</ul>
  
  	<hr>
  
  </body>
  </html>