@Override public void createData(final EdmEntitySet entitySet, final Object data) throws ODataNotImplementedException, EdmException, ODataApplicationException { DataStore<Object> dataStore = getDataStore(entitySet); dataStore.create(data); }
/** * Are the key values equal for both instances. * If all compared key values are <code>null</code> this also means equal. * * @param first first instance to check for key equal * @param second second instance to check for key equal * @return <code>true</code> if object instance have equal keys set. */ public boolean isKeyEqual(final T first, final T second) { KeyElement firstKeys = getKeys(first); KeyElement secondKeys = getKeys(second); return firstKeys.equals(secondKeys); }
@Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { final String methodName = getSetterMethodName(getGetterMethodName(property)); if (methodName != null) { setValue(data, methodName, value); } }
@Override public void deleteData(final EdmEntitySet entitySet, final Map<String, Object> keys) throws ODataNotImplementedException, ODataNotFoundException, EdmException, ODataApplicationException { DataStore<Object> dataStore = getDataStore(entitySet); Object keyInstance = dataStore.createInstance(); ANNOTATION_HELPER.setKeyFields(keyInstance, keys); dataStore.delete(keyInstance); }
public AnnotationInMemoryDs(final Collection<Class<?>> annotatedClasses, final boolean persistInMemory) throws ODataException { this.persistInMemory = persistInMemory; init(annotatedClasses); }
@SuppressWarnings("unchecked") public static <T> DataStore<T> createInMemory(final Class<T> clazz, final boolean keepExisting) throws DataStoreException { return (DataStore<T>) InMemoryDataStore.getInstance(clazz, !keepExisting); }
private <T> Object getPropertyValue(final T data, final List<EdmProperty> propertyPath) throws ODataException { Object dataObject = data; for (final EdmProperty property : propertyPath) { if (dataObject != null) { dataObject = valueAccess.getPropertyValue(dataObject, property); } } return dataObject; }
@Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { final String methodName = getSetterMethodName(getGetterMethodName(property)); if (methodName != null) { setValue(data, methodName, value); } }
@Override public void deleteData(final EdmEntitySet entitySet, final Map<String, Object> keys) throws ODataNotImplementedException, ODataNotFoundException, EdmException, ODataApplicationException { DataStore<Object> dataStore = getDataStore(entitySet); Object keyInstance = dataStore.createInstance(); ANNOTATION_HELPER.setKeyFields(keyInstance, keys); dataStore.delete(keyInstance); }
@Override public void createData(final EdmEntitySet entitySet, final Object data) throws ODataNotImplementedException, EdmException, ODataApplicationException { DataStore<Object> dataStore = getDataStore(entitySet); dataStore.create(data); }
/** * Are the key values equal for both instances. * If all compared key values are <code>null</code> this also means equal. * * @param first first instance to check for key equal * @param second second instance to check for key equal * @return <code>true</code> if object instance have equal keys set. */ public boolean isKeyEqual(final T first, final T second) { KeyElement firstKeys = getKeys(first); KeyElement secondKeys = getKeys(second); return firstKeys.equals(secondKeys); }
public AnnotationInMemoryDs(final Collection<Class<?>> annotatedClasses, final boolean persistInMemory) throws ODataException { this.persistInMemory = persistInMemory; init(annotatedClasses); }
@SuppressWarnings("unchecked") public static <T> DataStore<T> createInMemory(final Class<T> clazz, final boolean keepExisting) throws DataStoreException { return (DataStore<T>) InMemoryDataStore.getInstance(clazz, !keepExisting); }
private <T> Object getPropertyValue(final T data, final List<EdmProperty> propertyPath) throws ODataException { Object dataObject = data; for (final EdmProperty property : propertyPath) { if (dataObject != null) { dataObject = valueAccess.getPropertyValue(dataObject, property); } } return dataObject; }
@Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { final String methodName = getSetterMethodName(getGetterMethodName(property)); if (methodName != null) { setValue(data, methodName, value); } }
@Override public void createData(final EdmEntitySet entitySet, final Object data) throws ODataNotImplementedException, EdmException, ODataApplicationException { DataStore<Object> dataStore = getDataStore(entitySet); dataStore.create(data); }
/** * Are the key values equal for both instances. * If all compared key values are <code>null</code> this also means equal. * * @param first first instance to check for key equal * @param second second instance to check for key equal * @return <code>true</code> if object instance have equal keys set. */ public boolean isKeyEqual(final T first, final T second) { KeyElement firstKeys = getKeys(first); KeyElement secondKeys = getKeys(second); return firstKeys.equals(secondKeys); }
public AnnotationInMemoryDs(final Collection<Class<?>> annotatedClasses, final boolean persistInMemory) throws ODataException { this.persistInMemory = persistInMemory; init(annotatedClasses); }
@SuppressWarnings("unchecked") public static <T> DataStore<T> createInMemory(final Class<T> clazz, final boolean keepExisting) throws DataStoreException { return (DataStore<T>) InMemoryDataStore.getInstance(clazz, !keepExisting); }
private <T> Object getPropertyValue(final T data, final List<EdmProperty> propertyPath) throws ODataException { Object dataObject = data; for (final EdmProperty property : propertyPath) { if (dataObject != null) { dataObject = valueAccess.getPropertyValue(dataObject, property); } } return dataObject; }