Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-48

jpa reference application issues wtih sample data population

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • V2 1.0.0, V2 1.1.0
    • V2 1.1.0
    • odata2-jpa
    • None

    Description

      There's multiple issues in the jpa reference application:
      1. Sample data is never populated - could be fixed with the following change in the org.apache.olingo.odata2.jpa.processor.ref.web.JPAReferenceServiceFactory

      EntityManagerFactory emf = JPAEntityManagerFactory.getEntityManagerFactory(PUNIT_NAME);
      DataGenerator generator = new DataGenerator(emf.createEntityManager());
      generator.generate();
      oDataJPAContext.setEntityManagerFactory(emf);

      2. The sample data insert scripts have data constraint issues, e.g.:
      Internal Exception: java.sql.SQLException: Violation of unique constraint SYS_PK_47: duplicate value(s) for column(s) SO_ID in statement [insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(9, 9, 'buyerName_9', 'GBR', '02', '2013-01-01 00:00:00', 9, 'Test_Street_Name_9', 'Test_City_9', 'Test_Country_9');]
      Error Code: -104
      Call: insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(9, 9, 'buyerName_9', 'GBR', '02', '2013-01-01 00:00:00', 9, 'Test_Street_Name_9', 'Test_City_9', 'Test_Country_9');
      Query: DataModifyQuery(sql="insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(9, 9, 'buyerName_9', 'GBR', '02', '2013-01-01 00:00:00', 9, 'Test_Street_Name_9', 'Test_City_9', 'Test_Country_9');")

      3. (minor) In the pom file, there are leftover plugins from the initial SAP contribution:
      <plugin>
      <groupId>com.sap.research</groupId>
      <artifactId>nwcloud-maven-plugin</artifactId>
      <version>1.0.0.RELEASE</version>
      </plugin>

      Attachments

        1. dependency_2.5.0.txt
          33 kB
          Chandan V.A
        2. dependency_2.3.1.txt
          33 kB
          Chandan V.A

        Activity

          People

            chandan.v.a Chandan V.A
            shturec Georgi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: