Package org.apache.olingo.odata2.jpa.processor.api

Examples of org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext


    setOnWriteJPAContent(new OnJPAWriteContentMock());
    return oDataJPAContext;
  }

  public ODataJPAContext initializeODataJPAContextX() throws ODataJPARuntimeException {
    ODataJPAContext oDataJPAContext = null;
    oDataJPAContext = ODataJPAContextMock.mockODataJPAContext(context);
    setOnWriteJPAContent(null);
    return oDataJPAContext;
  }
View Full Code Here


  private OrderByExpression getOrderByExpression() {
    return null;
  }

  private ODataJPAContext getLocalmockODataJPAContext() {
    ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
    EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn("salesorderprocessing");
    EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andStubReturn(mockEntityManagerFactory());
    EasyMock.expect(odataJPAContext.getODataContext()).andStubReturn(getLocalODataContext());
    EasyMock.expect(odataJPAContext.getEntityManager()).andStubReturn(getLocalEntityManager());
    EasyMock.expect(odataJPAContext.getPageSize()).andReturn(10).anyTimes();
    odataJPAContext.setPaging(EasyMock.isA(JPAPaging.class));
    EasyMock.expectLastCall();
    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }
View Full Code Here

  public static final String NAMESPACE = "salesorderprocessing";
  public static final String MAPPING_MODEL = "SalesOrderProcessingMappingModel";
  public static final String PERSISTENCE_UNIT_NAME = "salesorderprocessing";

  public static ODataJPAContext mockODataJPAContext() {
    ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
    EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
    EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
    EasyMock.expect(odataJPAContext.getEntityManager()).andReturn(mockEntityManager());
    EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
    EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
    EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);

    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }
View Full Code Here

    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }

  public static ODataJPAContext mockODataJPAContext(final ODataContext context) {
    ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
    EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
    EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
    EasyMock.expect(odataJPAContext.getEntityManager()).andReturn(mockEntityManager());
    EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
    EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
    EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);
    EasyMock.expect(odataJPAContext.getODataContext()).andReturn(context).anyTimes();

    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }
View Full Code Here

  public static final OnJPAWriteContent onDBWriteContent = new OnDBWriteContent();

  @Override
  public ODataJPAContext initializeODataJPAContext()
      throws ODataJPARuntimeException {
    ODataJPAContext oDataJPAContext = getODataJPAContext();
    oDataJPAContext.setEntityManagerFactory(JPAEntityManagerFactory.getEntityManagerFactory(PUNIT_NAME));
    oDataJPAContext.setPersistenceUnitName(PUNIT_NAME);
    oDataJPAContext.setJPAEdmMappingModel(MAPPING_MODEL);
    oDataJPAContext
        .setJPAEdmExtension((JPAEdmExtension) new SalesOrderProcessingExtension());
    oDataJPAContext.setPageSize(PAGE_SIZE);
    oDataJPAContext.setDefaultNaming(false);
    setErrorLevel();
    setOnWriteJPAContent(onDBWriteContent);

    return oDataJPAContext;
  }
View Full Code Here

  private static final int PAGE_SIZE = 5;

  @Override
  public ODataJPAContext initializeODataJPAContext()
      throws ODataJPARuntimeException {
    ODataJPAContext oDataJPAContext = getODataJPAContext();
    oDataJPAContext.setEntityManagerFactory(JPAEntityManagerFactory.getEntityManagerFactory(PUNIT_NAME));
    oDataJPAContext.setPersistenceUnitName(PUNIT_NAME);
    oDataJPAContext.setJPAEdmMappingModel(MAPPING_MODEL);
    oDataJPAContext
        .setJPAEdmExtension((JPAEdmExtension) new SalesOrderProcessingExtension());
    oDataJPAContext.setPageSize(PAGE_SIZE);
    setErrorLevel();

    return oDataJPAContext;
  }
View Full Code Here

  }

  @Override
  public ODataJPAContext initializeODataJPAContext()
      throws ODataJPARuntimeException {
    ODataJPAContext oDataJPAContext = getODataJPAContext();
    oDataJPAContext.setEntityManagerFactory(Persistence
        .createEntityManagerFactory(PUNIT_NAME));
    oDataJPAContext.setPersistenceUnitName(PUNIT_NAME);

    oDataJPAContext.setPageSize(PAGE_SIZE);
    setDetailErrors(true);

    return oDataJPAContext;
  }
View Full Code Here

  private OrderByExpression getOrderByExpression() {
    return null;
  }

  private ODataJPAContext getLocalmockODataJPAContext() {
    ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
    EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn("salesorderprocessing");
    EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andStubReturn(mockEntityManagerFactory());
    EasyMock.expect(odataJPAContext.getODataContext()).andStubReturn(getLocalODataContext());
    EasyMock.expect(odataJPAContext.getEntityManager()).andStubReturn(getLocalEntityManager());
    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }
View Full Code Here

  public static final String NAMESPACE = "salesorderprocessing";
  public static final String MAPPING_MODEL = "SalesOrderProcessingMappingModel";
  public static final String PERSISTENCE_UNIT_NAME = "salesorderprocessing";

  public static ODataJPAContext mockODataJPAContext() {
    ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
    EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
    EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
    EasyMock.expect(odataJPAContext.getEntityManager()).andReturn(mockEntityManager());
    EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
    EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
    EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);

    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }
View Full Code Here

    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }

  public static ODataJPAContext mockODataJPAContext(final ODataContext context) {
    ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
    EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
    EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
    EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
    EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
    EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);
    EasyMock.expect(odataJPAContext.getODataContext()).andReturn(context).anyTimes();

    EasyMock.replay(odataJPAContext);
    return odataJPAContext;
  }
View Full Code Here

TOP

Related Classes of org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.