コード例 #1
0
 private static EdmProperty mockEdmPropertyOfSource1() {
   EdmProperty edmProperty = EasyMock.createMock(EdmProperty.class);
   EdmType type = EasyMock.createMock(EdmType.class);
   EasyMock.expect(type.getKind()).andStubReturn(EdmTypeKind.SIMPLE);
   EasyMock.replay(type);
   EdmMapping mapping = EasyMock.createMock(EdmMapping.class);
   EasyMock.expect(mapping.getInternalName()).andStubReturn("id");
   EasyMock.replay(mapping);
   try {
     EasyMock.expect(edmProperty.getName()).andStubReturn("id");
     EasyMock.expect(edmProperty.getType()).andStubReturn(type);
     EasyMock.expect(edmProperty.getMapping()).andStubReturn(mapping);
   } catch (EdmException e) {
     fail(
         ODataJPATestConstants.EXCEPTION_MSG_PART_1
             + e.getMessage()
             + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
   }
   EasyMock.replay(edmProperty);
   return edmProperty;
 }
コード例 #2
0
 private int getKeyValue(KeyPredicate key) throws ODataException {
   EdmProperty property = key.getProperty();
   EdmSimpleType type = (EdmSimpleType) property.getType();
   return type.valueOfString(
       key.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(), Integer.class);
 }