<commit_before><%@page import="com.sap.core.odata.processor.jpa.api.ODataJPAContext"%>
<%@page import="java.util.List"%>
<%@page import="javax.persistence.EntityManager"%>
<%@page import="javax.persistence.EntityManagerFactory"%>
<%@page import="javax.persistence.Persistence"%>
<%@page import="javax.persistence.Query"%>
<%@page	import="com.sap.core.odata.processor.ref.JPAReferenceServiceFactory"%>
<%@page import="com.sap.core.odata.processor.ref.util.DataGenerator"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to JPA implementation</title>
</head>
<body>
    <h1>SAP OData library</h1>
    <hr />
	<%
		String version = "gen/version.html";
	%>
	<%
		try {
	%>
	<jsp:include page='<%=version%>' />
	<%
		} catch (Exception e) {
	%>
	<p>IDE Build</p>
	<%
		}
	%>
	<hr />
	<h2>Reference Scenario</h2>
	<ul>
		<li><a href="" target="_blank">index page</a></li>
		<li><a href="" target="_blank">wadl</a></li><!-- ReferenceScenario.svc?_wadl -->
		<li><a href="" target="_blank">service document</a></li><!-- ReferenceScenario.svc/ -->
		<li><a href="" target="_blank">metadata</a></li><!-- ReferenceScenario.svc/$metadata -->
	</ul>
	<hr />
        <form name="form1" method="get">
            <input type="hidden" name="button" value="Generate">
            <input type="submit" value="Generate Data" width="100%">
        </form>
        <br>
        <form name="form2" method="get">
            <input type="hidden" name="button" value="Clean">
            <input type="submit" value="   Clean Data  " width="100%">
        </form>
        
        <% 
        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 = "Data not existing earlier.... Generated number of Items - " + result1;
				} else {
					System.err.println("Data already existing.... No Item generated by Data Generator !!");
					msg = "Data already existing.... No Item generated by Data Generator !!";
				}
       		} 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. Number of items deleted - "+result;
        		}else{
        			msg = "No data existing.... Nothing to clean!!";
        		}
       		}
        %>
			<h3><%=(msg) %></h2>
        <%
            }
        %>
        
    </body>
</html><commit_msg>message size changed.<commit_after><%@page import="com.sap.core.odata.processor.jpa.api.ODataJPAContext"%>
<%@page import="java.util.List"%>
<%@page import="javax.persistence.EntityManager"%>
<%@page import="javax.persistence.EntityManagerFactory"%>
<%@page import="javax.persistence.Persistence"%>
<%@page import="javax.persistence.Query"%>
<%@page	import="com.sap.core.odata.processor.ref.JPAReferenceServiceFactory"%>
<%@page import="com.sap.core.odata.processor.ref.util.DataGenerator"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to JPA implementation</title>
</head>
<body>
    <h1>SAP OData library</h1>
    <hr />
	<%
		String version = "gen/version.html";
	%>
	<%
		try {
	%>
	<jsp:include page='<%=version%>' />
	<%
		} catch (Exception e) {
	%>
	<p>IDE Build</p>
	<%
		}
	%>
	<hr />
	<h2>Reference Scenario</h2>
	<ul>
		<li><a href="" target="_blank">index page</a></li>
		<li><a href="" target="_blank">wadl</a></li><!-- ReferenceScenario.svc?_wadl -->
		<li><a href="" target="_blank">service document</a></li><!-- ReferenceScenario.svc/ -->
		<li><a href="" target="_blank">metadata</a></li><!-- ReferenceScenario.svc/$metadata -->
	</ul>
	<hr />
        <form name="form1" method="get">
            <input type="hidden" name="button" value="Generate">
            <input type="submit" value="Generate Data" width="100%">
        </form>
        <br>
        <form name="form2" method="get">
            <input type="hidden" name="button" value="Clean">
            <input type="submit" value="   Clean Data  " width="100%">
        </form>
        
        <% 
        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 = "Data not existing earlier.... Generated number of Items - " + result1;
				} else {
					System.err.println("Data already existing.... No Item generated by Data Generator !!");
					msg = "Data already existing.... No Item generated by Data Generator !!";
				}
       		} 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. Number of items deleted - "+result;
        		}else{
        			msg = "No data existing.... Nothing to clean!!";
        		}
       		}
        %>
			<h4><%=(msg) %></h4>
        <%
            }
        %>
        
    </body>
</html>
{'fraction_non_alphanumeric': 0.17401752897936104, 'fraction_numerical': 0.008199038733389879, 'mean_word_length': 3.0614236509758896, 'pattern_counts': {'":': 0, '<': 141, '<?xml version=': 0, '>': 143, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '136408', 'n_tokens_mistral': 2414, 'n_tokens_neox': 2249, 'n_words': 475}