mirror of
https://github.com/apache/olingo-odata4.git
synced 2025-03-04 15:49:12 +00:00
[OLINGO-366,OLINGO-367,OLINGO-370] chahnged entity, entity collection and complex creation methods (still missing complex collection creator). Provided delayed HTTP request for navigation property. Provided select query option support on entity set (still missing query options support for entity collections)
This commit is contained in:
parent
b9db730f3c
commit
989babb1dc
@ -21,13 +21,21 @@ package org.apache.olingo.ext.proxy;
|
||||
import org.apache.olingo.client.api.CommonEdmEnabledODataClient;
|
||||
import org.apache.olingo.client.core.ODataClientFactory;
|
||||
import org.apache.olingo.commons.api.format.ODataFormat;
|
||||
import org.apache.olingo.ext.proxy.api.ComplexType;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.EntityType;
|
||||
import org.apache.olingo.ext.proxy.api.PersistenceManager;
|
||||
import org.apache.olingo.ext.proxy.commons.ComplexInvocationHandler;
|
||||
import org.apache.olingo.ext.proxy.commons.EntityCollectionInvocationHandler;
|
||||
import org.apache.olingo.ext.proxy.commons.EntityContainerInvocationHandler;
|
||||
import org.apache.olingo.ext.proxy.commons.EntityInvocationHandler;
|
||||
import org.apache.olingo.ext.proxy.commons.NonTransactionalPersistenceManagerImpl;
|
||||
import org.apache.olingo.ext.proxy.commons.TransactionalPersistenceManagerImpl;
|
||||
import org.apache.olingo.ext.proxy.context.Context;
|
||||
import org.apache.olingo.ext.proxy.utils.ClassUtils;
|
||||
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@ -105,7 +113,6 @@ public final class Service<C extends CommonEdmEnabledODataClient<?>> {
|
||||
|
||||
return getInstance(ODataClientFactory.getEdmEnabledV4(serviceRoot), transactional);
|
||||
}
|
||||
|
||||
private final CommonEdmEnabledODataClient<?> client;
|
||||
|
||||
private final Context context;
|
||||
@ -162,4 +169,33 @@ public final class Service<C extends CommonEdmEnabledODataClient<?>> {
|
||||
}
|
||||
return reference.cast(ENTITY_CONTAINERS.get(reference));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <NE extends EntityType> NE newEntity(final Class<NE> reference) {
|
||||
final EntityInvocationHandler handler = EntityInvocationHandler.getInstance(reference, this);
|
||||
|
||||
return (NE) Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {reference},
|
||||
handler);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends EntityType, NEC extends EntityCollection<T>> NEC newEntityCollection(final Class<NEC> reference) {
|
||||
final Class<T> ref = (Class<T>) ClassUtils.extractTypeArg(reference, EntityCollection.class);
|
||||
|
||||
return (NEC) Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {reference},
|
||||
new EntityCollectionInvocationHandler<T>(this, new ArrayList<T>(), ref));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <NE extends ComplexType> NE newComplex(final Class<NE> reference) {
|
||||
return (NE) Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {reference},
|
||||
ComplexInvocationHandler.getInstance(reference, this));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,11 @@ import java.io.Serializable;
|
||||
* Interface for synchronous CRUD operations on an EntitySet.
|
||||
*/
|
||||
public interface AbstractEntitySet<
|
||||
T extends StructuredType, KEY extends Serializable, EC extends AbstractEntityCollection<T>>
|
||||
T extends StructuredType, KEY extends Serializable, EC extends EntityCollection<T>>
|
||||
extends Iterable<T>, Serializable {
|
||||
|
||||
void add(final T entity);
|
||||
|
||||
/**
|
||||
* Returns whether an entity with the given id exists.
|
||||
*
|
||||
@ -102,5 +104,5 @@ public interface AbstractEntitySet<
|
||||
* @param reference
|
||||
* @return the new search instance
|
||||
*/
|
||||
<S extends T, SEC extends AbstractEntityCollection<S>> Search<S, SEC> createSearch(Class<SEC> reference);
|
||||
<S extends T, SEC extends EntityCollection<S>> Search<S, SEC> createSearch(Class<SEC> reference);
|
||||
}
|
||||
|
@ -21,6 +21,6 @@ package org.apache.olingo.ext.proxy.api;
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface AbstractSingleton<
|
||||
T extends Serializable, KEY extends Serializable, EC extends AbstractEntityCollection<T>>
|
||||
T extends Serializable, KEY extends Serializable, EC extends EntityCollection<T>>
|
||||
extends Serializable {
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ package org.apache.olingo.ext.proxy.api;
|
||||
import org.apache.olingo.client.api.uri.URIFilter;
|
||||
|
||||
public interface CollectionQuery<
|
||||
T extends StructuredType, EC extends AbstractEntityCollection<T>, CT extends CollectionQuery<T, EC, ?>>
|
||||
T extends StructuredType, EC extends EntityCollection<T>, CT extends CollectionQuery<T, EC, ?>>
|
||||
extends CommonQuery<CollectionQuery<T, EC, CT>> {
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
#*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -15,18 +15,8 @@
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*#
|
||||
package ${package};
|
||||
*/
|
||||
package org.apache.olingo.ext.proxy.api;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Property;
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("$namespace")
|
||||
public interface ComplexCreator {
|
||||
#foreach($complex in $complexes)
|
||||
#set( $type = "${namespace}.${complex.Name}" )
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "$complex.Name", type = "$type")
|
||||
$utility.getJavaType($type) new$utility.capitalize($complex.Name)();
|
||||
|
||||
#end
|
||||
public interface ComplexType extends StructuredType {
|
||||
}
|
@ -21,5 +21,5 @@ package org.apache.olingo.ext.proxy.api;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface AbstractEntityCollection<T extends Serializable> extends Collection<T>, Serializable {
|
||||
public interface EntityCollection<T extends Serializable> extends Collection<T>, Serializable {
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
package org.apache.olingo.ext.proxy.api;
|
||||
|
||||
public interface EntityCollectionQuery<
|
||||
T extends StructuredType, EC extends AbstractEntityCollection<T>, CT extends EntityCollectionQuery<T, EC, ?>>
|
||||
T extends StructuredType, EC extends EntityCollection<T>, CT extends EntityCollectionQuery<T, EC, ?>>
|
||||
extends CollectionQuery<T, EC, CT> {
|
||||
|
||||
/**
|
||||
|
@ -19,7 +19,7 @@
|
||||
package org.apache.olingo.ext.proxy.api;
|
||||
|
||||
public interface EntitySetQuery<
|
||||
T extends StructuredType, EC extends AbstractEntityCollection<T>, CT extends EntitySetQuery<T, EC, ?>>
|
||||
T extends StructuredType, EC extends EntityCollection<T>, CT extends EntitySetQuery<T, EC, ?>>
|
||||
extends CollectionQuery<T, EC, CT> {
|
||||
|
||||
/**
|
||||
@ -30,5 +30,5 @@ public interface EntitySetQuery<
|
||||
* @param reference entity collection class to be returned
|
||||
* @return all entities of the given subtype
|
||||
*/
|
||||
<S extends T, SEC extends AbstractEntityCollection<S>> SEC execute(Class<SEC> reference);
|
||||
<S extends T, SEC extends EntityCollection<S>> SEC execute(Class<SEC> reference);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
#*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
@ -15,23 +15,8 @@
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*#
|
||||
package ${package};
|
||||
*/
|
||||
package org.apache.olingo.ext.proxy.api;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Property;
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("$namespace")
|
||||
public interface EntityCreator {
|
||||
|
||||
#foreach($entity in $entities)
|
||||
#set( $type = "${namespace}.${entity.Name}" )
|
||||
#set( $javaType = $utility.getJavaType($type) )
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "$entity.Name", type = "$type")
|
||||
$javaType new$utility.capitalize($entity.Name)();
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "$entity.Name", type = "$type")
|
||||
${javaType}Collection new${utility.capitalize($entity.Name)}Collection();
|
||||
|
||||
#end
|
||||
public interface EntityType extends StructuredType {
|
||||
}
|
@ -28,7 +28,7 @@ import java.io.Serializable;
|
||||
* @param <T> search result type
|
||||
* @param <EC>
|
||||
*/
|
||||
public interface Search<T extends Serializable, EC extends AbstractEntityCollection<T>> extends Serializable {
|
||||
public interface Search<T extends Serializable, EC extends EntityCollection<T>> extends Serializable {
|
||||
|
||||
/**
|
||||
* Sets the <tt>$search</tt> expression for this search.
|
||||
|
@ -33,5 +33,7 @@ public @interface EntitySet {
|
||||
|
||||
String name();
|
||||
|
||||
String container() default "";
|
||||
|
||||
boolean contained() default false;
|
||||
}
|
||||
|
@ -32,4 +32,6 @@ import java.lang.annotation.Target;
|
||||
public @interface Singleton {
|
||||
|
||||
String name();
|
||||
|
||||
String container() default "";
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ import org.apache.olingo.commons.api.domain.CommonODataEntitySet;
|
||||
import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
|
||||
import org.apache.olingo.commons.api.domain.v4.ODataEntitySet;
|
||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractSingleton;
|
||||
import org.apache.olingo.ext.proxy.api.Sort;
|
||||
@ -42,9 +42,10 @@ import java.lang.reflect.Type;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
|
||||
public abstract class AbstractEntityCollectionInvocationHandler<
|
||||
T extends StructuredType, EC extends AbstractEntityCollection<T>>
|
||||
T extends StructuredType, EC extends EntityCollection<T>>
|
||||
extends AbstractInvocationHandler {
|
||||
|
||||
private static final long serialVersionUID = 98078202642671727L;
|
||||
@ -62,9 +63,9 @@ public abstract class AbstractEntityCollectionInvocationHandler<
|
||||
@SuppressWarnings("unchecked")
|
||||
public AbstractEntityCollectionInvocationHandler(
|
||||
final Class<?> ref,
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final CommonURIBuilder<?> uri) {
|
||||
super(containerHandler);
|
||||
super(service);
|
||||
|
||||
this.uri = uri;
|
||||
this.baseURI = uri.build();
|
||||
@ -81,9 +82,9 @@ public abstract class AbstractEntityCollectionInvocationHandler<
|
||||
public AbstractEntityCollectionInvocationHandler(
|
||||
final Class<?> itemRef,
|
||||
final Class<EC> collItemRef,
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final CommonURIBuilder<?> uri) {
|
||||
super(containerHandler);
|
||||
super(service);
|
||||
|
||||
this.uri = uri;
|
||||
this.baseURI = uri == null ? null : uri.build();
|
||||
@ -100,7 +101,7 @@ public abstract class AbstractEntityCollectionInvocationHandler<
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <S extends T, SEC extends AbstractEntityCollection<S>> SEC fetchWholeEntitySet(
|
||||
public <S extends T, SEC extends EntityCollection<S>> SEC fetchWholeEntitySet(
|
||||
final CommonURIBuilder<?> uriBuilder, final Class<S> typeRef, final Class<SEC> collTypeRef) {
|
||||
|
||||
final List<S> items = new ArrayList<S>();
|
||||
@ -115,7 +116,7 @@ public abstract class AbstractEntityCollectionInvocationHandler<
|
||||
}
|
||||
|
||||
final EntityCollectionInvocationHandler<S> entityCollectionHandler =
|
||||
new EntityCollectionInvocationHandler<S>(containerHandler, items, typeRef, uriBuilder);
|
||||
new EntityCollectionInvocationHandler<S>(service, items, typeRef, uriBuilder);
|
||||
entityCollectionHandler.setAnnotations(annotations);
|
||||
|
||||
return (SEC) Proxy.newProxyInstance(
|
||||
@ -168,7 +169,7 @@ public abstract class AbstractEntityCollectionInvocationHandler<
|
||||
entity,
|
||||
null,
|
||||
typeRef,
|
||||
containerHandler);
|
||||
service);
|
||||
|
||||
final EntityInvocationHandler handlerInTheContext = getContext().entityContext().getEntity(handler.getUUID());
|
||||
|
||||
|
@ -61,24 +61,18 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
|
||||
|
||||
private static final long serialVersionUID = 358520026931462958L;
|
||||
|
||||
protected Service<?> factory;
|
||||
protected Service<?> service;
|
||||
|
||||
protected EntityContainerInvocationHandler containerHandler;
|
||||
|
||||
protected AbstractInvocationHandler(final Service<?> factory) {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
protected AbstractInvocationHandler(final EntityContainerInvocationHandler containerHandler) {
|
||||
this.containerHandler = containerHandler;
|
||||
protected AbstractInvocationHandler(final Service<?> service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
protected CommonEdmEnabledODataClient<?> getClient() {
|
||||
return factory == null ? containerHandler.getFactory().getClient() : factory.getClient();
|
||||
return service.getClient();
|
||||
}
|
||||
|
||||
protected Context getContext() {
|
||||
return factory == null ? containerHandler.getFactory().getContext() : factory.getContext();
|
||||
return service.getContext();
|
||||
}
|
||||
|
||||
protected boolean isSelfMethod(final Method method, final Object[] args) {
|
||||
@ -111,13 +105,13 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
|
||||
final List<Object> items = new ArrayList<Object>();
|
||||
|
||||
for (CommonODataEntity entityFromSet : entitySet.getEntities()) {
|
||||
items.add(getEntityProxy(entityFromSet, entityContainerName, null, typeRef, null, checkInTheContext));
|
||||
items.add(getEntityProxy(entityFromSet, entityContainerName, uri, typeRef, null, checkInTheContext));
|
||||
}
|
||||
|
||||
return Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {typeCollectionRef},
|
||||
new EntityCollectionInvocationHandler(containerHandler, items, typeRef,
|
||||
new EntityCollectionInvocationHandler(service, items, typeRef,
|
||||
uri == null ? null : getClient().newURIBuilder(uri.toASCIIString())));
|
||||
}
|
||||
|
||||
@ -128,7 +122,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
|
||||
return Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {typeRef},
|
||||
EntitySetInvocationHandler.getInstance(typeRef, containerHandler, uri));
|
||||
EntitySetInvocationHandler.getInstance(typeRef, service, uri));
|
||||
}
|
||||
|
||||
protected Object getEntityProxy(
|
||||
@ -139,7 +133,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
|
||||
final String eTag,
|
||||
final boolean checkInTheContext) {
|
||||
|
||||
EntityInvocationHandler handler = EntityInvocationHandler.getInstance(entity, entitySetURI, type, containerHandler);
|
||||
EntityInvocationHandler handler = EntityInvocationHandler.getInstance(entity, entitySetURI, type, service);
|
||||
|
||||
if (StringUtils.isNotBlank(eTag)) {
|
||||
// override ETag into the wrapped object.
|
||||
@ -148,6 +142,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
|
||||
|
||||
if (checkInTheContext && getContext().entityContext().isAttached(handler)) {
|
||||
handler = getContext().entityContext().getEntity(handler.getUUID());
|
||||
handler.setEntity(entity);
|
||||
} else {
|
||||
handler.attach(AttachedEntityStatus.ATTACHED, false);
|
||||
}
|
||||
@ -209,7 +204,7 @@ abstract class AbstractInvocationHandler implements InvocationHandler {
|
||||
|
||||
// 2. IMPORTANT: flush any pending change *before* invoke if this operation is side effecting
|
||||
if (annotation.type() == OperationType.ACTION) {
|
||||
containerHandler.getFactory().getPersistenceManager().flush();
|
||||
service.getPersistenceManager().flush();
|
||||
}
|
||||
|
||||
// 3. invoke
|
||||
|
@ -61,10 +61,10 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
|
||||
private static final long serialVersionUID = 2065240290461241515L;
|
||||
|
||||
protected final Service<?> factory;
|
||||
protected final Service<?> service;
|
||||
|
||||
AbstractPersistenceManager(final Service<?> factory) {
|
||||
this.factory = factory;
|
||||
this.service = factory;
|
||||
}
|
||||
|
||||
protected abstract void doFlush(final PersistenceChanges changes, final TransactionItems items);
|
||||
@ -76,7 +76,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
|
||||
int pos = 0;
|
||||
final List<EntityLinkDesc> delayedUpdates = new ArrayList<EntityLinkDesc>();
|
||||
for (AttachedEntity attachedEntity : factory.getContext().entityContext()) {
|
||||
for (AttachedEntity attachedEntity : service.getContext().entityContext()) {
|
||||
final AttachedEntityStatus status = attachedEntity.getStatus();
|
||||
if (((status != AttachedEntityStatus.ATTACHED
|
||||
&& status != AttachedEntityStatus.LINKED) || attachedEntity.getEntity().isChanged())
|
||||
@ -91,7 +91,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
|
||||
doFlush(changes, items);
|
||||
|
||||
factory.getContext().detachAll();
|
||||
service.getContext().detachAll();
|
||||
}
|
||||
|
||||
private ODataLink buildNavigationLink(final String name, final URI uri, final ODataLinkType type) {
|
||||
@ -99,11 +99,11 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
|
||||
switch (type) {
|
||||
case ENTITY_NAVIGATION:
|
||||
result = factory.getClient().getObjectFactory().newEntityNavigationLink(name, uri);
|
||||
result = service.getClient().getObjectFactory().newEntityNavigationLink(name, uri);
|
||||
break;
|
||||
|
||||
case ENTITY_SET_NAVIGATION:
|
||||
result = factory.getClient().getObjectFactory().newEntitySetNavigationLink(name, uri);
|
||||
result = service.getClient().getObjectFactory().newEntitySetNavigationLink(name, uri);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -120,25 +120,24 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
final List<EntityLinkDesc> delayedUpdates,
|
||||
final PersistenceChanges changeset) {
|
||||
|
||||
LOG.debug("Process '{}'", handler);
|
||||
|
||||
items.put(handler, null);
|
||||
|
||||
final CommonODataEntity entity = handler.getEntity();
|
||||
entity.getNavigationLinks().clear();
|
||||
|
||||
final AttachedEntityStatus currentStatus = factory.getContext().entityContext().getStatus(handler);
|
||||
final AttachedEntityStatus currentStatus = service.getContext().entityContext().getStatus(handler);
|
||||
LOG.debug("Process '{}({})'", handler, currentStatus);
|
||||
|
||||
if (AttachedEntityStatus.DELETED != currentStatus) {
|
||||
entity.getProperties().clear();
|
||||
CoreUtils.addProperties(factory.getClient(), handler.getPropertyChanges(), entity);
|
||||
CoreUtils.addProperties(service.getClient(), handler.getPropertyChanges(), entity);
|
||||
|
||||
if (entity instanceof ODataEntity) {
|
||||
((ODataEntity) entity).getAnnotations().clear();
|
||||
CoreUtils.addAnnotations(factory.getClient(), handler.getAnnotations(), (ODataEntity) entity);
|
||||
CoreUtils.addAnnotations(service.getClient(), handler.getAnnotations(), (ODataEntity) entity);
|
||||
|
||||
for (Map.Entry<String, AnnotatableInvocationHandler> entry : handler.getPropAnnotatableHandlers().entrySet()) {
|
||||
CoreUtils.addAnnotations(factory.getClient(),
|
||||
CoreUtils.addAnnotations(service.getClient(),
|
||||
entry.getValue().getAnnotations(), ((ODataEntity) entity).getProperty(entry.getKey()));
|
||||
}
|
||||
}
|
||||
@ -150,19 +149,28 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
: ODataLinkType.ENTITY_NAVIGATION;
|
||||
|
||||
final Set<EntityInvocationHandler> toBeLinked = new HashSet<EntityInvocationHandler>();
|
||||
|
||||
for (Object proxy : type == ODataLinkType.ENTITY_SET_NAVIGATION
|
||||
? (Collection<?>) property.getValue() : Collections.singleton(property.getValue())) {
|
||||
|
||||
final EntityInvocationHandler target = (EntityInvocationHandler) Proxy.getInvocationHandler(proxy);
|
||||
|
||||
final AttachedEntityStatus status = factory.getContext().entityContext().getStatus(target);
|
||||
final AttachedEntityStatus status;
|
||||
if (!service.getContext().entityContext().isAttached(target)) {
|
||||
status = resolveNavigationLink(property.getKey(), target);
|
||||
} else {
|
||||
status = service.getContext().entityContext().getStatus(target);
|
||||
}
|
||||
|
||||
LOG.debug("Found link to '{}({})'", target, status);
|
||||
|
||||
final URI editLink = target.getEntity().getEditLink();
|
||||
|
||||
if ((status == AttachedEntityStatus.ATTACHED || status == AttachedEntityStatus.LINKED) && !target.isChanged()) {
|
||||
LOG.debug("Add link to '{}'", target);
|
||||
entity.addLink(buildNavigationLink(
|
||||
property.getKey().name(),
|
||||
URIUtils.getURI(factory.getClient().getServiceRoot(), editLink.toASCIIString()), type));
|
||||
URIUtils.getURI(service.getClient().getServiceRoot(), editLink.toASCIIString()), type));
|
||||
} else {
|
||||
if (!items.contains(target)) {
|
||||
pos = processEntityContext(target, pos, items, delayedUpdates, changeset);
|
||||
@ -175,9 +183,10 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
LOG.debug("Schedule '{}' from '{}' to '{}'", type.name(), handler, target);
|
||||
toBeLinked.add(target);
|
||||
} else if (status == AttachedEntityStatus.CHANGED) {
|
||||
LOG.debug("Changed: '{}' from '{}' to (${}) '{}'", type.name(), handler, targetPos, target);
|
||||
entity.addLink(buildNavigationLink(
|
||||
property.getKey().name(),
|
||||
URIUtils.getURI(factory.getClient().getServiceRoot(), editLink.toASCIIString()), type));
|
||||
URIUtils.getURI(service.getClient().getServiceRoot(), editLink.toASCIIString()), type));
|
||||
} else {
|
||||
// create the link for the current object
|
||||
LOG.debug("'{}' from '{}' to (${}) '{}'", type.name(), handler, targetPos, target);
|
||||
@ -196,7 +205,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
for (Map.Entry<String, AnnotatableInvocationHandler> entry
|
||||
: handler.getNavPropAnnotatableHandlers().entrySet()) {
|
||||
|
||||
CoreUtils.addAnnotations(factory.getClient(),
|
||||
CoreUtils.addAnnotations(service.getClient(),
|
||||
entry.getValue().getAnnotations(),
|
||||
(org.apache.olingo.commons.api.domain.v4.ODataLink) entity.getNavigationLink(entry.getKey()));
|
||||
}
|
||||
@ -217,10 +226,11 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
final URI targetURI = currentStatus == AttachedEntityStatus.NEW
|
||||
? URI.create("$" + startingPos)
|
||||
: URIUtils.getURI(
|
||||
factory.getClient().getServiceRoot(), handler.getEntity().getEditLink().toASCIIString());
|
||||
service.getClient().getServiceRoot(), handler.getEntity().getEditLink().toASCIIString());
|
||||
queueUpdate(handler, targetURI, entity, changeset);
|
||||
pos++;
|
||||
items.put(handler, pos);
|
||||
LOG.debug("{}: Update media properties for '{}' into the process queue", pos, handler);
|
||||
}
|
||||
|
||||
// update media content
|
||||
@ -228,28 +238,30 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
final URI targetURI = currentStatus == AttachedEntityStatus.NEW
|
||||
? URI.create("$" + startingPos + "/$value")
|
||||
: URIUtils.getURI(
|
||||
factory.getClient().getServiceRoot(),
|
||||
handler.getEntity().getEditLink().toASCIIString() + "/$value");
|
||||
service.getClient().getServiceRoot(),
|
||||
handler.getEntity().getEditLink().toASCIIString() + "/$value");
|
||||
|
||||
queueUpdateMediaEntity(handler, targetURI, handler.getStreamChanges(), changeset);
|
||||
|
||||
// update media info (use null key)
|
||||
pos++;
|
||||
items.put(null, pos);
|
||||
LOG.debug("{}: Update media info for '{}' into the process queue", pos, handler);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, InputStream> streamedChanges : handler.getStreamedPropertyChanges().entrySet()) {
|
||||
final URI targetURI = currentStatus == AttachedEntityStatus.NEW
|
||||
? URI.create("$" + startingPos) : URIUtils.getURI(
|
||||
factory.getClient().getServiceRoot(),
|
||||
CoreUtils.getMediaEditLink(streamedChanges.getKey(), entity).toASCIIString());
|
||||
service.getClient().getServiceRoot(),
|
||||
CoreUtils.getMediaEditLink(streamedChanges.getKey(), entity).toASCIIString());
|
||||
|
||||
queueUpdateMediaResource(handler, targetURI, streamedChanges.getValue(), changeset);
|
||||
|
||||
// update media info (use null key)
|
||||
pos++;
|
||||
items.put(handler, pos);
|
||||
LOG.debug("{}: Update media info (null key) for '{}' into the process queue", pos, handler);
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,14 +279,14 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
items.put(delayedUpdate.getSource(), pos);
|
||||
|
||||
final CommonODataEntity changes =
|
||||
factory.getClient().getObjectFactory().newEntity(delayedUpdate.getSource().getEntity().getTypeName());
|
||||
service.getClient().getObjectFactory().newEntity(delayedUpdate.getSource().getEntity().getTypeName());
|
||||
|
||||
AttachedEntityStatus status = factory.getContext().entityContext().getStatus(delayedUpdate.getSource());
|
||||
AttachedEntityStatus status = service.getContext().entityContext().getStatus(delayedUpdate.getSource());
|
||||
|
||||
final URI sourceURI;
|
||||
if (status == AttachedEntityStatus.CHANGED) {
|
||||
sourceURI = URIUtils.getURI(
|
||||
factory.getClient().getServiceRoot(),
|
||||
service.getClient().getServiceRoot(),
|
||||
delayedUpdate.getSource().getEntity().getEditLink().toASCIIString());
|
||||
} else {
|
||||
int sourcePos = items.get(delayedUpdate.getSource());
|
||||
@ -282,21 +294,21 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
}
|
||||
|
||||
for (EntityInvocationHandler target : delayedUpdate.getTargets()) {
|
||||
status = factory.getContext().entityContext().getStatus(target);
|
||||
status = service.getContext().entityContext().getStatus(target);
|
||||
|
||||
final URI targetURI;
|
||||
if (status == AttachedEntityStatus.CHANGED) {
|
||||
targetURI = URIUtils.getURI(
|
||||
factory.getClient().getServiceRoot(), target.getEntity().getEditLink().toASCIIString());
|
||||
service.getClient().getServiceRoot(), target.getEntity().getEditLink().toASCIIString());
|
||||
} else {
|
||||
int targetPos = items.get(target);
|
||||
targetURI = URI.create("$" + targetPos);
|
||||
}
|
||||
|
||||
changes.addLink(delayedUpdate.getType() == ODataLinkType.ENTITY_NAVIGATION
|
||||
? factory.getClient().getObjectFactory().
|
||||
? service.getClient().getObjectFactory().
|
||||
newEntityNavigationLink(delayedUpdate.getSourceName(), targetURI)
|
||||
: factory.getClient().getObjectFactory().
|
||||
: service.getClient().getObjectFactory().
|
||||
newEntitySetNavigationLink(delayedUpdate.getSourceName(), targetURI));
|
||||
|
||||
LOG.debug("'{}' from {} to {}", delayedUpdate.getType().name(), sourceURI, targetURI);
|
||||
@ -311,7 +323,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
final CommonODataEntity entity,
|
||||
final PersistenceChanges changeset) {
|
||||
|
||||
switch (factory.getContext().entityContext().getStatus(handler)) {
|
||||
switch (service.getContext().entityContext().getStatus(handler)) {
|
||||
case NEW:
|
||||
queueCreate(handler, entity, changeset);
|
||||
return AttachedEntityStatus.NEW;
|
||||
@ -339,7 +351,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
|
||||
LOG.debug("Create '{}'", handler);
|
||||
|
||||
changeset.addChange(factory.getClient().getCUDRequestFactory().
|
||||
changeset.addChange(service.getClient().getCUDRequestFactory().
|
||||
getEntityCreateRequest(handler.getEntitySetURI(), entity), handler);
|
||||
}
|
||||
|
||||
@ -352,7 +364,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
LOG.debug("Update media entity '{}'", uri);
|
||||
|
||||
final ODataMediaEntityUpdateRequest<?> req =
|
||||
factory.getClient().getCUDRequestFactory().getMediaEntityUpdateRequest(uri, input);
|
||||
service.getClient().getCUDRequestFactory().getMediaEntityUpdateRequest(uri, input);
|
||||
|
||||
if (StringUtils.isNotBlank(handler.getEntity().getMediaContentType())) {
|
||||
req.setContentType(ODataFormat.fromString(handler.getEntity().getMediaContentType()).toString());
|
||||
@ -373,7 +385,7 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
|
||||
LOG.debug("Update media entity '{}'", uri);
|
||||
|
||||
final ODataStreamUpdateRequest req = factory.getClient().getCUDRequestFactory().getStreamUpdateRequest(uri, input);
|
||||
final ODataStreamUpdateRequest req = service.getClient().getCUDRequestFactory().getStreamUpdateRequest(uri, input);
|
||||
|
||||
if (StringUtils.isNotBlank(handler.getETag())) {
|
||||
req.setIfMatch(handler.getETag());
|
||||
@ -390,15 +402,15 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
LOG.debug("Update '{}'", handler.getEntityURI());
|
||||
|
||||
final ODataEntityUpdateRequest<CommonODataEntity> req =
|
||||
factory.getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0
|
||||
? ((org.apache.olingo.client.api.v3.EdmEnabledODataClient) factory.getClient()).getCUDRequestFactory().
|
||||
service.getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0
|
||||
? ((org.apache.olingo.client.api.v3.EdmEnabledODataClient) service.getClient()).getCUDRequestFactory().
|
||||
getEntityUpdateRequest(handler.getEntityURI(),
|
||||
org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes)
|
||||
: ((org.apache.olingo.client.api.v4.EdmEnabledODataClient) factory.getClient()).getCUDRequestFactory().
|
||||
org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes)
|
||||
: ((org.apache.olingo.client.api.v4.EdmEnabledODataClient) service.getClient()).getCUDRequestFactory().
|
||||
getEntityUpdateRequest(handler.getEntityURI(),
|
||||
org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes);
|
||||
org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes);
|
||||
|
||||
req.setPrefer(new ODataPreferences(factory.getClient().getServiceVersion()).returnContent());
|
||||
req.setPrefer(new ODataPreferences(service.getClient().getServiceVersion()).returnContent());
|
||||
|
||||
if (StringUtils.isNotBlank(handler.getETag())) {
|
||||
req.setIfMatch(handler.getETag());
|
||||
@ -416,15 +428,15 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
LOG.debug("Update '{}'", uri);
|
||||
|
||||
final ODataEntityUpdateRequest<CommonODataEntity> req =
|
||||
factory.getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0
|
||||
? ((org.apache.olingo.client.api.v3.EdmEnabledODataClient) factory.getClient()).getCUDRequestFactory().
|
||||
service.getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0
|
||||
? ((org.apache.olingo.client.api.v3.EdmEnabledODataClient) service.getClient()).getCUDRequestFactory().
|
||||
getEntityUpdateRequest(uri,
|
||||
org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes)
|
||||
: ((org.apache.olingo.client.api.v4.EdmEnabledODataClient) factory.getClient()).getCUDRequestFactory().
|
||||
org.apache.olingo.client.api.communication.request.cud.v3.UpdateType.PATCH, changes)
|
||||
: ((org.apache.olingo.client.api.v4.EdmEnabledODataClient) service.getClient()).getCUDRequestFactory().
|
||||
getEntityUpdateRequest(uri,
|
||||
org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes);
|
||||
org.apache.olingo.client.api.communication.request.cud.v4.UpdateType.PATCH, changes);
|
||||
|
||||
req.setPrefer(new ODataPreferences(factory.getClient().getServiceVersion()).returnContent());
|
||||
req.setPrefer(new ODataPreferences(service.getClient().getServiceVersion()).returnContent());
|
||||
|
||||
if (StringUtils.isNotBlank(handler.getETag())) {
|
||||
req.setIfMatch(handler.getETag());
|
||||
@ -438,10 +450,10 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
final CommonODataEntity entity,
|
||||
final PersistenceChanges changeset) {
|
||||
|
||||
final URI deleteURI = handler.getEntityURI() == null ? entity.getEditLink() : handler.getEntityURI();
|
||||
final URI deleteURI = entity.getEditLink() == null ? handler.getEntityURI() : entity.getEditLink();
|
||||
LOG.debug("Delete '{}'", deleteURI);
|
||||
|
||||
final ODataDeleteRequest req = factory.getClient().getCUDRequestFactory().getDeleteRequest(deleteURI);
|
||||
final ODataDeleteRequest req = service.getClient().getCUDRequestFactory().getDeleteRequest(deleteURI);
|
||||
|
||||
if (StringUtils.isNotBlank(handler.getETag())) {
|
||||
req.setIfMatch(handler.getETag());
|
||||
@ -449,4 +461,18 @@ abstract class AbstractPersistenceManager implements PersistenceManager {
|
||||
|
||||
changeset.addChange(req, handler);
|
||||
}
|
||||
|
||||
private AttachedEntityStatus resolveNavigationLink(
|
||||
final NavigationProperty property, final EntityInvocationHandler handler) {
|
||||
if (handler.getUUID().getEntitySetURI() == null) {
|
||||
final Object key = CoreUtils.getKey(service.getClient(), handler, handler.getTypeRef(), handler.getEntity());
|
||||
handler.updateUUID(CoreUtils.getTargetEntitySetURI(service.getClient(), property), handler.getTypeRef(), null);
|
||||
service.getContext().entityContext().attach(handler, AttachedEntityStatus.NEW);
|
||||
return AttachedEntityStatus.NEW;
|
||||
} else {
|
||||
// existent object
|
||||
service.getContext().entityContext().attach(handler, AttachedEntityStatus.LINKED);
|
||||
return AttachedEntityStatus.LINKED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,18 +19,15 @@
|
||||
package org.apache.olingo.ext.proxy.commons;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
|
||||
import org.apache.olingo.client.api.communication.response.ODataRetrieveResponse;
|
||||
import org.apache.olingo.client.core.uri.URIUtils;
|
||||
import org.apache.olingo.commons.api.domain.CommonODataEntity;
|
||||
import org.apache.olingo.commons.api.domain.ODataInlineEntity;
|
||||
import org.apache.olingo.commons.api.domain.ODataInlineEntitySet;
|
||||
import org.apache.olingo.commons.api.domain.ODataLink;
|
||||
import org.apache.olingo.commons.api.domain.ODataLinked;
|
||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Property;
|
||||
import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
|
||||
@ -38,16 +35,19 @@ import org.apache.olingo.ext.proxy.utils.ClassUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.URI;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.olingo.client.api.uri.CommonURIBuilder;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
import org.apache.olingo.ext.proxy.context.EntityUUID;
|
||||
import org.apache.olingo.ext.proxy.utils.CoreUtils;
|
||||
|
||||
public abstract class AbstractStructuredInvocationHandler extends AbstractInvocationHandler {
|
||||
|
||||
@ -58,6 +58,8 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
*/
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(AbstractStructuredInvocationHandler.class);
|
||||
|
||||
protected CommonURIBuilder<?> uri;
|
||||
|
||||
protected final Class<?> typeRef;
|
||||
|
||||
protected EntityInvocationHandler entityHandler;
|
||||
@ -72,10 +74,20 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
|
||||
protected AbstractStructuredInvocationHandler(
|
||||
final Class<?> typeRef,
|
||||
final Object internal,
|
||||
final EntityContainerInvocationHandler containerHandler) {
|
||||
final Service<?> service) {
|
||||
|
||||
super(containerHandler);
|
||||
super(service);
|
||||
this.internal = null;
|
||||
this.typeRef = typeRef;
|
||||
this.entityHandler = null;
|
||||
}
|
||||
|
||||
protected AbstractStructuredInvocationHandler(
|
||||
final Class<?> typeRef,
|
||||
final Object internal,
|
||||
final Service<?> service) {
|
||||
|
||||
super(service);
|
||||
this.internal = internal;
|
||||
this.typeRef = typeRef;
|
||||
this.entityHandler = null;
|
||||
@ -86,7 +98,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
final Object internal,
|
||||
final EntityInvocationHandler entityHandler) {
|
||||
|
||||
super(entityHandler == null ? null : entityHandler.containerHandler);
|
||||
super(entityHandler == null ? null : entityHandler.service);
|
||||
this.internal = internal;
|
||||
this.typeRef = typeRef;
|
||||
// prevent memory leak
|
||||
@ -123,6 +135,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
return invokeSelfMethod(method, args);
|
||||
} else if ("load".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
|
||||
load();
|
||||
attach(); // attach the current handler
|
||||
return proxy;
|
||||
} else if ("operations".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
|
||||
final Class<?> returnType = method.getReturnType();
|
||||
@ -131,13 +144,6 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {returnType},
|
||||
OperationInvocationHandler.getInstance(getEntityHandler()));
|
||||
} else if ("factory".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
|
||||
final Class<?> returnType = method.getReturnType();
|
||||
|
||||
return Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {returnType},
|
||||
ComplexFactoryInvocationHandler.getInstance(getEntityHandler(), this));
|
||||
} else if ("annotations".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
|
||||
final Class<?> returnType = method.getReturnType();
|
||||
|
||||
@ -165,9 +171,6 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
res = getPropertyValue(property.name(), getter.getGenericReturnType());
|
||||
}
|
||||
|
||||
// attach the current handler
|
||||
attach();
|
||||
|
||||
return res;
|
||||
} else if (method.getName().startsWith("set")) {
|
||||
// get the corresponding getter method (see assumption above)
|
||||
@ -198,9 +201,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
}
|
||||
|
||||
protected void attach() {
|
||||
if (entityHandler != null && !getContext().entityContext().isAttached(getEntityHandler())) {
|
||||
getContext().entityContext().attach(getEntityHandler(), AttachedEntityStatus.ATTACHED);
|
||||
}
|
||||
attach(AttachedEntityStatus.ATTACHED, false);
|
||||
}
|
||||
|
||||
protected void attach(final AttachedEntityStatus status) {
|
||||
@ -222,7 +223,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
protected Object retrieveNavigationProperty(final NavigationProperty property, final Method getter) {
|
||||
final Class<?> type = getter.getReturnType();
|
||||
final Class<?> collItemType;
|
||||
if (AbstractEntityCollection.class.isAssignableFrom(type)) {
|
||||
if (EntityCollection.class.isAssignableFrom(type)) {
|
||||
final Type[] eCollParams = ((ParameterizedType) type.getGenericInterfaces()[0]).getActualTypeArguments();
|
||||
collItemType = (Class<?>) eCollParams[0];
|
||||
} else {
|
||||
@ -254,7 +255,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
// navigate
|
||||
final URI uri = URIUtils.getURI(getEntityHandler().getEntityURI(), property.name());
|
||||
|
||||
if (AbstractEntityCollection.class.isAssignableFrom(type)) {
|
||||
if (EntityCollection.class.isAssignableFrom(type)) {
|
||||
navPropValue = getEntityCollectionProxy(
|
||||
collItemType,
|
||||
type,
|
||||
@ -265,20 +266,30 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
} else if (AbstractEntitySet.class.isAssignableFrom(type)) {
|
||||
navPropValue = getEntitySetProxy(type, uri);
|
||||
} else {
|
||||
final ODataEntityRequest<CommonODataEntity> req = getClient().getRetrieveRequestFactory().getEntityRequest(uri);
|
||||
if (getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) > 0) {
|
||||
req.setPrefer(getClient().newPreferences().includeAnnotations("*"));
|
||||
URI entitySetURI = CoreUtils.getTargetEntitySetURI(getClient(), property);
|
||||
|
||||
final EntityUUID uuid = new EntityUUID(entitySetURI, collItemType, null);
|
||||
LOG.debug("Ask for '{}({})'", collItemType.getSimpleName(), null);
|
||||
|
||||
EntityInvocationHandler handler = getContext().entityContext().getEntity(uuid);
|
||||
|
||||
if (handler == null) {
|
||||
final CommonODataEntity entity = getClient().getObjectFactory().newEntity(new FullQualifiedName(
|
||||
collItemType.getAnnotation(Namespace.class).value(), ClassUtils.getEntityTypeName(collItemType)));
|
||||
|
||||
handler = EntityInvocationHandler.getInstance(
|
||||
entity, URIUtils.getURI(this.uri.build(), property.name()), entitySetURI, collItemType, service);
|
||||
|
||||
} else if (getContext().entityContext().getStatus(handler) == AttachedEntityStatus.DELETED) {
|
||||
// object deleted
|
||||
LOG.debug("Object '{}({})' has been deleted", collItemType.getSimpleName(), uuid);
|
||||
handler = null;
|
||||
}
|
||||
|
||||
final ODataRetrieveResponse<CommonODataEntity> res = req.execute();
|
||||
|
||||
navPropValue = getEntityProxy(
|
||||
res.getBody(),
|
||||
property.targetContainer(),
|
||||
getClient().newURIBuilder().appendEntitySetSegment(property.targetEntitySet()).build(),
|
||||
type,
|
||||
res.getETag(),
|
||||
true);
|
||||
navPropValue = handler == null ? null : Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {collItemType},
|
||||
handler);
|
||||
}
|
||||
}
|
||||
|
||||
@ -297,26 +308,7 @@ public abstract class AbstractStructuredInvocationHandler extends AbstractInvoca
|
||||
getContext().entityContext().attach(getEntityHandler(), AttachedEntityStatus.CHANGED);
|
||||
}
|
||||
|
||||
// 2) attach the target entity handlers
|
||||
for (Object link : AbstractEntityCollection.class.isAssignableFrom(value.getClass())
|
||||
? (AbstractEntityCollection) value : Collections.singleton(value)) {
|
||||
|
||||
final InvocationHandler etih = Proxy.getInvocationHandler(link);
|
||||
if (!(etih instanceof EntityInvocationHandler)) {
|
||||
throw new IllegalArgumentException("Invalid argument type");
|
||||
}
|
||||
|
||||
final EntityInvocationHandler linkedHandler = (EntityInvocationHandler) etih;
|
||||
if (!linkedHandler.getTypeRef().isAnnotationPresent(EntityType.class)) {
|
||||
throw new IllegalArgumentException("Invalid argument type " + linkedHandler.getTypeRef().getSimpleName());
|
||||
}
|
||||
|
||||
if (!getContext().entityContext().isAttached(linkedHandler)) {
|
||||
getContext().entityContext().attach(linkedHandler, AttachedEntityStatus.LINKED);
|
||||
}
|
||||
}
|
||||
|
||||
// 3) add links
|
||||
// 2) add links
|
||||
addLinkChanges(property, value);
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
|
||||
public class AnnotatableInvocationHandler extends AbstractInvocationHandler implements Annotatable {
|
||||
|
||||
@ -53,13 +54,13 @@ public class AnnotatableInvocationHandler extends AbstractInvocationHandler impl
|
||||
new HashMap<Class<? extends AbstractTerm>, Object>();
|
||||
|
||||
public AnnotatableInvocationHandler(
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final String propName,
|
||||
final String navPropName,
|
||||
final EntityInvocationHandler entityHandler,
|
||||
final AbstractStructuredInvocationHandler targetHandler) {
|
||||
|
||||
super(containerHandler);
|
||||
super(service);
|
||||
|
||||
this.propName = propName;
|
||||
this.navPropName = navPropName;
|
||||
@ -158,7 +159,7 @@ public class AnnotatableInvocationHandler extends AbstractInvocationHandler impl
|
||||
res = annotation == null || annotation.hasNullValue()
|
||||
? null
|
||||
: CoreUtils.getObjectFromODataValue(
|
||||
getClient(), annotation.getValue(), null, targetHandler.getEntityHandler());
|
||||
getClient(), annotation.getValue(), null, targetHandler.getEntityHandler());
|
||||
if (res != null) {
|
||||
annotations.put(term, res);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import org.apache.olingo.ext.proxy.utils.ClassUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
|
||||
public class AnnotatationsInvocationHandler extends AbstractInvocationHandler {
|
||||
|
||||
@ -39,17 +40,17 @@ public class AnnotatationsInvocationHandler extends AbstractInvocationHandler {
|
||||
|
||||
return new AnnotatationsInvocationHandler(
|
||||
targetHandler == null
|
||||
? entityHandler == null ? null : entityHandler.containerHandler : targetHandler.containerHandler,
|
||||
? entityHandler == null ? null : entityHandler.service : targetHandler.service,
|
||||
entityHandler,
|
||||
targetHandler);
|
||||
}
|
||||
|
||||
private AnnotatationsInvocationHandler(
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final EntityInvocationHandler entityHandler,
|
||||
final AbstractStructuredInvocationHandler targetHandler) {
|
||||
|
||||
super(containerHandler);
|
||||
super(service);
|
||||
this.targetHandler = targetHandler;
|
||||
this.entityHandler = entityHandler;
|
||||
}
|
||||
@ -80,7 +81,7 @@ public class AnnotatationsInvocationHandler extends AbstractInvocationHandler {
|
||||
return Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {method.getReturnType()},
|
||||
new AnnotatableInvocationHandler(containerHandler, propName, navPropName, entityHandler, targetHandler));
|
||||
new AnnotatableInvocationHandler(service, propName, navPropName, entityHandler, targetHandler));
|
||||
} else {
|
||||
throw new NoSuchMethodException(method.getName());
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import org.apache.olingo.ext.proxy.utils.ClassUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
|
||||
class ComplexFactoryInvocationHandler extends AbstractInvocationHandler implements OperationExecutor {
|
||||
|
||||
@ -34,11 +35,11 @@ class ComplexFactoryInvocationHandler extends AbstractInvocationHandler implemen
|
||||
private final AbstractStructuredInvocationHandler invokerHandler;
|
||||
|
||||
static ComplexFactoryInvocationHandler getInstance(
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final EntityInvocationHandler entityHandler,
|
||||
final AbstractStructuredInvocationHandler targetHandler) {
|
||||
|
||||
return new ComplexFactoryInvocationHandler(containerHandler, entityHandler, targetHandler);
|
||||
return new ComplexFactoryInvocationHandler(service, entityHandler, targetHandler);
|
||||
}
|
||||
|
||||
static ComplexFactoryInvocationHandler getInstance(
|
||||
@ -49,18 +50,18 @@ class ComplexFactoryInvocationHandler extends AbstractInvocationHandler implemen
|
||||
targetHandler == null
|
||||
? entityHandler == null
|
||||
? null
|
||||
: entityHandler.containerHandler
|
||||
: targetHandler.containerHandler,
|
||||
: entityHandler.service
|
||||
: targetHandler.service,
|
||||
entityHandler,
|
||||
targetHandler);
|
||||
}
|
||||
|
||||
private ComplexFactoryInvocationHandler(
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final EntityInvocationHandler entityHandler,
|
||||
final AbstractStructuredInvocationHandler targetHandler) {
|
||||
|
||||
super(containerHandler);
|
||||
super(service);
|
||||
this.invokerHandler = targetHandler;
|
||||
this.entityHandler = entityHandler;
|
||||
}
|
||||
@ -81,9 +82,9 @@ class ComplexFactoryInvocationHandler extends AbstractInvocationHandler implemen
|
||||
new Class<?>[] {method.getReturnType()},
|
||||
entityHandler == null
|
||||
? ComplexInvocationHandler.getInstance(
|
||||
getClient(), property.name(), method.getReturnType(), containerHandler)
|
||||
getClient(), property.name(), method.getReturnType(), service)
|
||||
: ComplexInvocationHandler.getInstance(
|
||||
getClient(), property.name(), method.getReturnType(), entityHandler));
|
||||
getClient(), property.name(), method.getReturnType(), entityHandler));
|
||||
} else {
|
||||
throw new NoSuchMethodException(method.getName());
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import org.apache.olingo.commons.api.domain.ODataLinked;
|
||||
import org.apache.olingo.commons.api.edm.EdmElement;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.core.edm.EdmTypeInfo;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.ComplexType;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Property;
|
||||
@ -83,10 +84,10 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
|
||||
final CommonEdmEnabledODataClient<?> client,
|
||||
final String propertyName,
|
||||
final Class<?> reference,
|
||||
final EntityContainerInvocationHandler containerHandler) {
|
||||
final Service<?> service) {
|
||||
|
||||
final Pair<ODataComplexValue<? extends CommonODataProperty>, Class<?>> init = init(client, reference);
|
||||
return new ComplexInvocationHandler(client, init.getLeft(), init.getRight(), containerHandler);
|
||||
return new ComplexInvocationHandler(client, init.getLeft(), init.getRight(), service);
|
||||
}
|
||||
|
||||
public static ComplexInvocationHandler getInstance(
|
||||
@ -113,12 +114,29 @@ public class ComplexInvocationHandler extends AbstractStructuredInvocationHandle
|
||||
final CommonEdmEnabledODataClient<?> client,
|
||||
final ODataComplexValue<?> complex,
|
||||
final Class<?> typeRef,
|
||||
final EntityContainerInvocationHandler containerHandler) {
|
||||
final Service<?> service) {
|
||||
|
||||
super(typeRef, complex, containerHandler);
|
||||
super(typeRef, complex, service);
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public static ComplexInvocationHandler getInstance(
|
||||
final Class<?> typeRef,
|
||||
final Service<?> service) {
|
||||
final Pair<ODataComplexValue<? extends CommonODataProperty>, Class<?>> init = init(service.getClient(), typeRef);
|
||||
return new ComplexInvocationHandler(init.getLeft(), init.getRight(), service);
|
||||
}
|
||||
|
||||
private ComplexInvocationHandler(
|
||||
final ODataComplexValue<?> complex,
|
||||
final Class<?> typeRef,
|
||||
final Service<?> service) {
|
||||
|
||||
super(typeRef, service);
|
||||
this.internal = complex;
|
||||
this.client = service.getClient();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ODataComplexValue<CommonODataProperty> getComplex() {
|
||||
return (ODataComplexValue<CommonODataProperty>) this.internal;
|
||||
|
@ -22,7 +22,7 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.apache.olingo.client.api.uri.CommonURIBuilder;
|
||||
import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
import org.apache.olingo.ext.proxy.api.StructuredType;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
@ -38,10 +38,11 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
|
||||
public class EntityCollectionInvocationHandler<T extends StructuredType>
|
||||
extends AbstractEntityCollectionInvocationHandler<T, AbstractEntityCollection<T>>
|
||||
implements AbstractEntityCollection<T> {
|
||||
extends AbstractEntityCollectionInvocationHandler<T, EntityCollection<T>>
|
||||
implements EntityCollection<T> {
|
||||
|
||||
private static final long serialVersionUID = 98078202642671726L;
|
||||
|
||||
@ -54,16 +55,15 @@ public class EntityCollectionInvocationHandler<T extends StructuredType>
|
||||
private final Map<Class<? extends AbstractTerm>, Object> annotationsByTerm =
|
||||
new HashMap<Class<? extends AbstractTerm>, Object>();
|
||||
|
||||
public EntityCollectionInvocationHandler(final EntityContainerInvocationHandler containerHandler,
|
||||
final Collection<T> items, final Class<T> itemRef) {
|
||||
|
||||
this(containerHandler, items, itemRef, null);
|
||||
public EntityCollectionInvocationHandler(
|
||||
final Service<?> service, final Collection<T> items, final Class<T> itemRef) {
|
||||
this(service, items, itemRef, null);
|
||||
}
|
||||
|
||||
public EntityCollectionInvocationHandler(final EntityContainerInvocationHandler containerHandler,
|
||||
final Collection<T> items, final Class<T> itemRef, final CommonURIBuilder<?> uri) {
|
||||
public EntityCollectionInvocationHandler(
|
||||
final Service<?> service, final Collection<T> items, final Class<T> itemRef, final CommonURIBuilder<?> uri) {
|
||||
|
||||
super(itemRef, null, containerHandler, uri);
|
||||
super(itemRef, null, service, uri);
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public class EntityCollectionInvocationHandler<T extends StructuredType>
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public AbstractEntityCollection<T> execute() {
|
||||
public EntityCollection<T> execute() {
|
||||
final Triple<List<T>, URI, List<ODataAnnotation>> entitySet = fetchPartialEntitySet(this.uri.build(), itemRef);
|
||||
this.nextPageURI = entitySet.getMiddle();
|
||||
|
||||
@ -168,6 +168,11 @@ public class EntityCollectionInvocationHandler<T extends StructuredType>
|
||||
|
||||
@Override
|
||||
public boolean add(final T element) {
|
||||
final EntityInvocationHandler handler = EntityInvocationHandler.class.cast(Proxy.getInvocationHandler(element));
|
||||
if (!service.getContext().entityContext().isAttached(handler) && baseURI != null) {
|
||||
handler.updateUUID(baseURI, itemRef, null);
|
||||
service.getContext().entityContext().attachNew(handler);
|
||||
}
|
||||
return items.add(element);
|
||||
}
|
||||
|
||||
|
@ -39,11 +39,9 @@ public final class EntityContainerInvocationHandler extends AbstractInvocationHa
|
||||
|
||||
private final boolean defaultEC;
|
||||
|
||||
public static EntityContainerInvocationHandler getInstance(
|
||||
final Class<?> ref, final Service<?> factory) {
|
||||
public static EntityContainerInvocationHandler getInstance(final Class<?> ref, final Service<?> service) {
|
||||
|
||||
final EntityContainerInvocationHandler instance = new EntityContainerInvocationHandler(ref, factory);
|
||||
instance.containerHandler = instance;
|
||||
final EntityContainerInvocationHandler instance = new EntityContainerInvocationHandler(ref, service);
|
||||
return instance;
|
||||
}
|
||||
|
||||
@ -61,8 +59,8 @@ public final class EntityContainerInvocationHandler extends AbstractInvocationHa
|
||||
this.namespace = ((EntityContainer) annotation).namespace();
|
||||
}
|
||||
|
||||
protected Service<?> getFactory() {
|
||||
return factory;
|
||||
protected Service<?> getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
protected boolean isDefaultEntityContainer() {
|
||||
@ -82,7 +80,7 @@ public final class EntityContainerInvocationHandler extends AbstractInvocationHa
|
||||
if (isSelfMethod(method, args)) {
|
||||
return invokeSelfMethod(method, args);
|
||||
} else if ("flush".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
|
||||
factory.getPersistenceManager().flush();
|
||||
service.getPersistenceManager().flush();
|
||||
return ClassUtils.returnVoid();
|
||||
} else if ("operations".equals(method.getName()) && ArrayUtils.isEmpty(args)) {
|
||||
final Class<?> returnType = method.getReturnType();
|
||||
@ -97,7 +95,7 @@ public final class EntityContainerInvocationHandler extends AbstractInvocationHa
|
||||
return Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {returnType},
|
||||
ComplexFactoryInvocationHandler.getInstance(this, null, null));
|
||||
ComplexFactoryInvocationHandler.getInstance(service, null, null));
|
||||
} else {
|
||||
final Class<?> returnType = method.getReturnType();
|
||||
|
||||
@ -108,13 +106,13 @@ public final class EntityContainerInvocationHandler extends AbstractInvocationHa
|
||||
return Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {returnType},
|
||||
SingletonInvocationHandler.getInstance(returnType, this, singleton.name()));
|
||||
SingletonInvocationHandler.getInstance(returnType, service, singleton.name()));
|
||||
}
|
||||
} else {
|
||||
return Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {returnType},
|
||||
EntitySetInvocationHandler.getInstance(returnType, this, entitySet.name()));
|
||||
EntitySetInvocationHandler.getInstance(returnType, service, entitySet.name()));
|
||||
}
|
||||
|
||||
throw new NoSuchMethodException(method.getName());
|
||||
|
@ -30,8 +30,10 @@ import org.apache.olingo.commons.api.domain.CommonODataProperty;
|
||||
import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
|
||||
import org.apache.olingo.commons.api.domain.v4.ODataEntity;
|
||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||
import org.apache.olingo.commons.api.format.ODataFormat;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
import org.apache.olingo.ext.proxy.api.Annotatable;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.CompoundKey;
|
||||
@ -68,8 +70,6 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
|
||||
private URI baseURI;
|
||||
|
||||
private CommonURIBuilder<?> uri;
|
||||
|
||||
protected final Map<String, Object> propertyChanges = new HashMap<String, Object>();
|
||||
|
||||
protected final Map<NavigationProperty, Object> linkChanges = new HashMap<NavigationProperty, Object>();
|
||||
@ -97,7 +97,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
entity,
|
||||
entitySet.getURI(),
|
||||
typeRef,
|
||||
entitySet.containerHandler);
|
||||
entitySet.service);
|
||||
}
|
||||
|
||||
static EntityInvocationHandler getInstance(
|
||||
@ -105,18 +105,75 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
final CommonODataEntity entity,
|
||||
final URI entitySetURI,
|
||||
final Class<?> typeRef,
|
||||
final EntityContainerInvocationHandler containerHandler) {
|
||||
final Service<?> service) {
|
||||
|
||||
return new EntityInvocationHandler(key, entity, entitySetURI, typeRef, containerHandler);
|
||||
return new EntityInvocationHandler(key, entity, entitySetURI, typeRef, service);
|
||||
}
|
||||
|
||||
public static EntityInvocationHandler getInstance(
|
||||
final CommonODataEntity entity,
|
||||
final URI entitySetURI,
|
||||
final Class<?> typeRef,
|
||||
final EntityContainerInvocationHandler containerHandler) {
|
||||
final Service<?> service) {
|
||||
|
||||
return new EntityInvocationHandler(null, entity, entitySetURI, typeRef, containerHandler);
|
||||
return new EntityInvocationHandler(null, entity, entitySetURI, typeRef, service);
|
||||
}
|
||||
|
||||
public static EntityInvocationHandler getInstance(
|
||||
final CommonODataEntity entity,
|
||||
final URI entitySetURI,
|
||||
final URI entityURI,
|
||||
final Class<?> typeRef,
|
||||
final Service<?> service) {
|
||||
|
||||
return new EntityInvocationHandler(entity, entityURI, entitySetURI, typeRef, service);
|
||||
}
|
||||
|
||||
public static EntityInvocationHandler getInstance(
|
||||
final Class<?> typeRef,
|
||||
final Service<?> service) {
|
||||
|
||||
return new EntityInvocationHandler(typeRef, service);
|
||||
}
|
||||
|
||||
private EntityInvocationHandler(
|
||||
final Class<?> typeRef,
|
||||
final Service<?> service) {
|
||||
|
||||
super(typeRef, service);
|
||||
|
||||
final String name = typeRef.getAnnotation(org.apache.olingo.ext.proxy.api.annotations.EntityType.class).name();
|
||||
final String namespace = typeRef.getAnnotation(Namespace.class).value();
|
||||
|
||||
this.internal = service.getClient().getObjectFactory().newEntity(new FullQualifiedName(namespace, name));
|
||||
CommonODataEntity.class.cast(this.internal).setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
|
||||
|
||||
this.uuid = new EntityUUID(
|
||||
null,
|
||||
typeRef,
|
||||
null);
|
||||
}
|
||||
|
||||
private EntityInvocationHandler(
|
||||
final CommonODataEntity entity,
|
||||
final URI entitySetURI,
|
||||
final URI entityURI,
|
||||
final Class<?> typeRef,
|
||||
final Service<?> service) {
|
||||
super(typeRef, entity, service);
|
||||
|
||||
if (entityURI != null) {
|
||||
this.baseURI = entityURI;
|
||||
this.uri = getClient().newURIBuilder(baseURI.toASCIIString());
|
||||
} else {
|
||||
this.baseURI = null;
|
||||
this.uri = null;
|
||||
}
|
||||
|
||||
this.internal = entity;
|
||||
getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
|
||||
|
||||
this.uuid = new EntityUUID(entitySetURI, typeRef, null);
|
||||
}
|
||||
|
||||
private EntityInvocationHandler(
|
||||
@ -124,12 +181,12 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
final CommonODataEntity entity,
|
||||
final URI entitySetURI,
|
||||
final Class<?> typeRef,
|
||||
final EntityContainerInvocationHandler containerHandler) {
|
||||
final Service<?> service) {
|
||||
|
||||
super(typeRef, entity, service);
|
||||
|
||||
super(typeRef, entity, containerHandler);
|
||||
|
||||
final Object key = entityKey == null ? CoreUtils.getKey(getClient(), this, typeRef, entity) : entityKey;
|
||||
|
||||
|
||||
if (entity.getEditLink() != null) {
|
||||
this.baseURI = entity.getEditLink();
|
||||
this.uri = getClient().newURIBuilder(baseURI.toASCIIString());
|
||||
@ -155,11 +212,7 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
this.internal = entity;
|
||||
getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
|
||||
|
||||
this.uuid = new EntityUUID(
|
||||
containerHandler.getEntityContainerName(),
|
||||
entitySetURI,
|
||||
typeRef,
|
||||
key);
|
||||
this.uuid = new EntityUUID(entitySetURI, typeRef, key);
|
||||
}
|
||||
|
||||
public void setEntity(final CommonODataEntity entity) {
|
||||
@ -167,7 +220,6 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
|
||||
|
||||
this.uuid = new EntityUUID(
|
||||
getUUID().getContainerName(),
|
||||
getUUID().getEntitySetURI(),
|
||||
getUUID().getType(),
|
||||
CoreUtils.getKey(getClient(), this, typeRef, entity));
|
||||
@ -190,8 +242,9 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public String getEntityContainerName() {
|
||||
return uuid.getContainerName();
|
||||
public EntityUUID updateUUID(final URI entitySetURI, final Class<?> type, final Object key) {
|
||||
this.uuid = new EntityUUID(entitySetURI, type, key);
|
||||
return this.uuid;
|
||||
}
|
||||
|
||||
public URI getEntitySetURI() {
|
||||
@ -539,9 +592,12 @@ public class EntityInvocationHandler extends AbstractStructuredInvocationHandler
|
||||
setEntity(entity);
|
||||
setETag(etag);
|
||||
|
||||
if (!key.equals(CoreUtils.getKey(getClient(), this, typeRef, entity))) {
|
||||
if (key != null && !key.equals(CoreUtils.getKey(getClient(), this, typeRef, entity))) {
|
||||
throw new IllegalArgumentException("Invalid " + typeRef.getSimpleName() + "(" + key + ")");
|
||||
}
|
||||
|
||||
IOUtils.closeQuietly(this.stream);
|
||||
this.stream = null;
|
||||
} catch (IllegalArgumentException e) {
|
||||
LOG.warn("Entity '" + uuid + "' not found", e);
|
||||
throw e;
|
||||
|
@ -18,7 +18,6 @@
|
||||
*/
|
||||
package org.apache.olingo.ext.proxy.commons;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.apache.olingo.client.api.communication.request.retrieve.ODataValueRequest;
|
||||
import org.apache.olingo.client.api.uri.CommonURIBuilder;
|
||||
@ -29,7 +28,7 @@ import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
|
||||
import org.apache.olingo.commons.api.format.ODataFormat;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractSingleton;
|
||||
import org.apache.olingo.ext.proxy.api.Search;
|
||||
@ -44,14 +43,21 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Singleton;
|
||||
|
||||
class EntitySetInvocationHandler<
|
||||
T extends StructuredType, KEY extends Serializable, EC extends AbstractEntityCollection<T>>
|
||||
T extends StructuredType, KEY extends Serializable, EC extends EntityCollection<T>>
|
||||
extends AbstractEntityCollectionInvocationHandler<T, EC>
|
||||
implements AbstractEntitySet<T, KEY, EC> {
|
||||
|
||||
@ -62,74 +68,78 @@ class EntitySetInvocationHandler<
|
||||
*/
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EntitySetInvocationHandler.class);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
static EntitySetInvocationHandler getInstance(
|
||||
final Class<?> itemRef,
|
||||
final Class<?> collItemRef,
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final String entitySetName) {
|
||||
|
||||
final CommonURIBuilder<?> uriBuilder = buildURI(containerHandler, entitySetName);
|
||||
|
||||
uriBuilder.appendDerivedEntityTypeSegment(new FullQualifiedName(
|
||||
ClassUtils.getNamespace(itemRef), ClassUtils.getEntityTypeName(itemRef)).toString());
|
||||
|
||||
return new EntitySetInvocationHandler(itemRef, collItemRef, containerHandler, entitySetName, uriBuilder);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
static EntitySetInvocationHandler getInstance(
|
||||
final Class<?> ref,
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final String entitySetName) {
|
||||
|
||||
return new EntitySetInvocationHandler(
|
||||
ref, containerHandler, entitySetName, buildURI(containerHandler, entitySetName));
|
||||
return new EntitySetInvocationHandler(ref, service, entitySetName, buildURI(ref, service, entitySetName));
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
static EntitySetInvocationHandler getInstance(
|
||||
final Class<?> ref, final EntityContainerInvocationHandler containerHandler, final URI uri) {;
|
||||
final Class<?> ref, final Service<?> service, final URI uri) {;
|
||||
|
||||
return new EntitySetInvocationHandler(ref, containerHandler, (ref.getAnnotation(EntitySet.class)).name(),
|
||||
containerHandler.getClient().newURIBuilder(uri.toASCIIString()));
|
||||
return new EntitySetInvocationHandler(
|
||||
ref,
|
||||
service,
|
||||
(ref.getAnnotation(EntitySet.class)).name(),
|
||||
service.getClient().newURIBuilder(uri.toASCIIString()));
|
||||
}
|
||||
|
||||
private static CommonURIBuilder<?> buildURI(
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Class<?> ref,
|
||||
final Service<?> service,
|
||||
final String entitySetName) {
|
||||
final CommonURIBuilder<?> uriBuilder = containerHandler.getClient().newURIBuilder();
|
||||
final CommonURIBuilder<?> uriBuilder = service.getClient().newURIBuilder();
|
||||
|
||||
final Edm edm = service.getClient().getCachedEdm();
|
||||
final String containerNS;
|
||||
Annotation ann = ref.getAnnotation(EntitySet.class);
|
||||
if (ann instanceof EntitySet) {
|
||||
containerNS = EntitySet.class.cast(ann).container();
|
||||
} else {
|
||||
ann = ref.getAnnotation(Singleton.class);
|
||||
if (ann instanceof Singleton) {
|
||||
containerNS = Singleton.class.cast(ann).container();
|
||||
} else {
|
||||
containerNS = null;
|
||||
}
|
||||
}
|
||||
|
||||
final StringBuilder entitySetSegment = new StringBuilder();
|
||||
if (!containerHandler.isDefaultEntityContainer()) {
|
||||
entitySetSegment.append(containerHandler.getEntityContainerName()).append('.');
|
||||
if (StringUtils.isNotBlank(containerNS)) {
|
||||
final EdmEntityContainer container = edm.getEntityContainer(new FullQualifiedName(containerNS));
|
||||
if (!container.isDefault()) {
|
||||
entitySetSegment.append(container.getFullQualifiedName().toString()).append('.');
|
||||
}
|
||||
}
|
||||
|
||||
entitySetSegment.append(entitySetName);
|
||||
|
||||
uriBuilder.appendEntitySetSegment(entitySetSegment.toString());
|
||||
|
||||
return uriBuilder;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected EntitySetInvocationHandler(
|
||||
final Class<?> ref,
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final String entitySetName,
|
||||
final CommonURIBuilder<?> uri) {
|
||||
|
||||
super(ref, containerHandler, uri);
|
||||
super(ref, service, uri);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected EntitySetInvocationHandler(
|
||||
final Class<?> itemRef,
|
||||
final Class<EC> collItemRef,
|
||||
final EntityContainerInvocationHandler containerHandler,
|
||||
final Service<?> service,
|
||||
final String entitySetName,
|
||||
final CommonURIBuilder<?> uri) {
|
||||
|
||||
super(itemRef, collItemRef, containerHandler, uri);
|
||||
super(itemRef, collItemRef, service, uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,38 +154,18 @@ class EntitySetInvocationHandler<
|
||||
return proxy;
|
||||
} else if (isSelfMethod(method, args)) {
|
||||
return invokeSelfMethod(method, args);
|
||||
} else if (method.getName().startsWith("new") && ArrayUtils.isEmpty(args)) {
|
||||
if (method.getName().endsWith("Collection")) {
|
||||
return newEntityCollection(method.getReturnType());
|
||||
} else {
|
||||
return newEntity(method.getReturnType());
|
||||
}
|
||||
} else {
|
||||
throw new NoSuchMethodException(method.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <NE> NE newEntity(final Class<NE> reference) {
|
||||
final CommonODataEntity entity = getClient().getObjectFactory().newEntity(
|
||||
new FullQualifiedName(containerHandler.getSchemaName(), ClassUtils.getEntityTypeName(reference)));
|
||||
|
||||
final EntityInvocationHandler handler =
|
||||
EntityInvocationHandler.getInstance(entity, this.baseURI, reference, containerHandler);
|
||||
getContext().entityContext().attachNew(handler);
|
||||
|
||||
return (NE) Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {reference},
|
||||
handler);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <NEC> NEC newEntityCollection(final Class<NEC> reference) {
|
||||
return (NEC) Proxy.newProxyInstance(
|
||||
Thread.currentThread().getContextClassLoader(),
|
||||
new Class<?>[] {reference},
|
||||
new EntityCollectionInvocationHandler<T>(containerHandler, new ArrayList<T>(), itemRef));
|
||||
@Override
|
||||
public void add(final T entity) {
|
||||
final EntityInvocationHandler handler = EntityInvocationHandler.class.cast(Proxy.getInvocationHandler(entity));
|
||||
if (!getContext().entityContext().isAttached(handler)) {
|
||||
handler.updateUUID(baseURI, itemRef, null);
|
||||
getContext().entityContext().attachNew(handler);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -209,16 +199,16 @@ class EntitySetInvocationHandler<
|
||||
throw new IllegalArgumentException("Null key");
|
||||
}
|
||||
|
||||
final EntityUUID uuid = new EntityUUID(containerHandler.getEntityContainerName(), this.baseURI, typeRef, key);
|
||||
final EntityUUID uuid = new EntityUUID(this.baseURI, typeRef, key);
|
||||
LOG.debug("Ask for '{}({})'", typeRef.getSimpleName(), key);
|
||||
|
||||
EntityInvocationHandler handler = getContext().entityContext().getEntity(uuid);
|
||||
|
||||
if (handler == null) {
|
||||
final CommonODataEntity entity = getClient().getObjectFactory().newEntity(
|
||||
new FullQualifiedName(containerHandler.getSchemaName(), ClassUtils.getEntityTypeName(typeRef)));
|
||||
final CommonODataEntity entity = getClient().getObjectFactory().newEntity(new FullQualifiedName(
|
||||
typeRef.getAnnotation(Namespace.class).value(), ClassUtils.getEntityTypeName(typeRef)));
|
||||
|
||||
handler = EntityInvocationHandler.getInstance(key, entity, this.baseURI, typeRef, containerHandler);
|
||||
handler = EntityInvocationHandler.getInstance(key, entity, this.baseURI, typeRef, service);
|
||||
|
||||
} else if (isDeleted(handler)) {
|
||||
// object deleted
|
||||
@ -237,11 +227,11 @@ class EntitySetInvocationHandler<
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <S extends T, SEC extends AbstractEntityCollection<S>> SEC execute(final Class<SEC> collTypeRef) {
|
||||
public <S extends T, SEC extends EntityCollection<S>> SEC execute(final Class<SEC> collTypeRef) {
|
||||
final Class<S> ref = (Class<S>) ClassUtils.extractTypeArg(collTypeRef,
|
||||
AbstractEntitySet.class, AbstractSingleton.class, AbstractEntityCollection.class);
|
||||
AbstractEntitySet.class, AbstractSingleton.class, EntityCollection.class);
|
||||
final Class<S> oref = (Class<S>) ClassUtils.extractTypeArg(this.collItemRef,
|
||||
AbstractEntitySet.class, AbstractSingleton.class, AbstractEntityCollection.class);
|
||||
AbstractEntitySet.class, AbstractSingleton.class, EntityCollection.class);
|
||||
|
||||
final CommonURIBuilder<?> uriBuilder = getClient().newURIBuilder(this.uri.build().toASCIIString());
|
||||
|
||||
@ -256,7 +246,7 @@ class EntitySetInvocationHandler<
|
||||
annotations.addAll(entitySet.getRight());
|
||||
|
||||
final EntityCollectionInvocationHandler<S> entityCollectionHandler =
|
||||
new EntityCollectionInvocationHandler<S>(containerHandler, entitySet.getLeft(), ref, uriBuilder);
|
||||
new EntityCollectionInvocationHandler<S>(service, entitySet.getLeft(), ref, uriBuilder);
|
||||
entityCollectionHandler.setAnnotations(annotations);
|
||||
|
||||
entityCollectionHandler.setNextPage(entitySet.getMiddle());
|
||||
@ -277,7 +267,7 @@ class EntitySetInvocationHandler<
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <S extends T, SEC extends AbstractEntityCollection<S>> Search<S, SEC> createSearch(
|
||||
public <S extends T, SEC extends EntityCollection<S>> Search<S, SEC> createSearch(
|
||||
final Class<SEC> reference) {
|
||||
|
||||
if (getClient().getServiceVersion().compareTo(ODataServiceVersion.V30) <= 0) {
|
||||
@ -294,11 +284,7 @@ class EntitySetInvocationHandler<
|
||||
public void delete(final KEY key) throws IllegalArgumentException {
|
||||
final EntityContext entityContext = getContext().entityContext();
|
||||
|
||||
EntityInvocationHandler entity = entityContext.getEntity(new EntityUUID(
|
||||
containerHandler.getEntityContainerName(),
|
||||
baseURI,
|
||||
itemRef,
|
||||
key));
|
||||
EntityInvocationHandler entity = entityContext.getEntity(new EntityUUID(baseURI, itemRef, key));
|
||||
|
||||
if (entity == null) {
|
||||
// search for entity
|
||||
|
@ -18,11 +18,6 @@
|
||||
*/
|
||||
package org.apache.olingo.ext.proxy.commons;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.StructuredType;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.URI;
|
||||
import java.util.Collections;
|
||||
@ -30,7 +25,12 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
class EntitySetIterator<T extends StructuredType, KEY extends Serializable, EC extends AbstractEntityCollection<T>>
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.StructuredType;
|
||||
|
||||
class EntitySetIterator<T extends StructuredType, KEY extends Serializable, EC extends EntityCollection<T>>
|
||||
implements Iterator<T> {
|
||||
|
||||
private final EntitySetInvocationHandler<T, KEY, EC> esi;
|
||||
|
@ -18,15 +18,19 @@
|
||||
*/
|
||||
package org.apache.olingo.ext.proxy.commons;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.olingo.client.api.communication.request.ODataBasicRequest;
|
||||
import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
|
||||
import org.apache.olingo.client.api.communication.request.ODataRequest;
|
||||
import org.apache.olingo.client.api.communication.response.ODataEntityCreateResponse;
|
||||
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
|
||||
import org.apache.olingo.client.api.communication.response.ODataResponse;
|
||||
import org.apache.olingo.client.api.communication.request.ODataStreamedRequest;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* {@link org.apache.olingo.ext.proxy.api.PersistenceManager} implementation not using OData batch requests: any
|
||||
* read-write operation will be sent separately to the OData service when calling <tt>flush()</tt>; any intermediate
|
||||
@ -42,16 +46,41 @@ public class NonTransactionalPersistenceManagerImpl extends AbstractPersistenceM
|
||||
|
||||
@Override
|
||||
protected void doFlush(final PersistenceChanges changes, final TransactionItems items) {
|
||||
final Map<Integer, URI> responses = new HashMap<Integer, URI>();
|
||||
int virtualContentID = 0;
|
||||
|
||||
for (Map.Entry<ODataBatchableRequest, EntityInvocationHandler> entry : changes.getChanges().entrySet()) {
|
||||
virtualContentID++;
|
||||
|
||||
try {
|
||||
final ODataResponse response = ((ODataBasicRequest<?>) entry.getKey()).execute();
|
||||
final ODataRequest req = ODataRequest.class.cast(entry.getKey());
|
||||
String uri = req.getURI().toASCIIString();
|
||||
if (uri.startsWith("$")) {
|
||||
int slashIndex = uri.indexOf('/');
|
||||
final Integer toBeReplaced = Integer.valueOf(uri.substring(1, slashIndex < 0 ? uri.length() : slashIndex));
|
||||
if (responses.containsKey(toBeReplaced)) {
|
||||
uri = uri.replace("$" + toBeReplaced, responses.get(Integer.valueOf(toBeReplaced)).toASCIIString());
|
||||
req.setURI(URI.create(uri));
|
||||
}
|
||||
}
|
||||
|
||||
final ODataResponse response;
|
||||
if (ODataStreamedRequest.class.isAssignableFrom(req.getClass())) {
|
||||
response = ((ODataStreamedRequest<?, ?>) req).payloadManager().getResponse();
|
||||
} else {
|
||||
response = ((ODataBasicRequest<?>) req).execute();
|
||||
}
|
||||
|
||||
if (response instanceof ODataEntityCreateResponse && response.getStatusCode() == 201) {
|
||||
entry.getValue().setEntity(((ODataEntityCreateResponse<?>) response).getBody());
|
||||
responses.put(virtualContentID, entry.getValue().getEntityURI());
|
||||
LOG.debug("Upgrade created object '{}'", entry.getValue());
|
||||
} else if (response instanceof ODataEntityUpdateResponse && response.getStatusCode() == 200) {
|
||||
entry.getValue().setEntity(((ODataEntityUpdateResponse<?>) response).getBody());
|
||||
responses.put(virtualContentID, entry.getValue().getEntityURI());
|
||||
LOG.debug("Upgrade updated object '{}'", entry.getValue());
|
||||
} else {
|
||||
responses.put(virtualContentID, null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("While performing {}", entry.getKey().getURI(), e);
|
||||
|
@ -64,21 +64,21 @@ final class OperationInvocationHandler extends AbstractInvocationHandler impleme
|
||||
}
|
||||
|
||||
private OperationInvocationHandler(final EntityContainerInvocationHandler containerHandler) {
|
||||
super(containerHandler);
|
||||
super(containerHandler.service);
|
||||
|
||||
this.target = containerHandler;
|
||||
this.targetFQN = new FullQualifiedName(containerHandler.getSchemaName(), containerHandler.getEntityContainerName());
|
||||
}
|
||||
|
||||
private OperationInvocationHandler(final EntityInvocationHandler entityHandler) {
|
||||
super(entityHandler.containerHandler);
|
||||
super(entityHandler.service);
|
||||
|
||||
this.target = entityHandler;
|
||||
this.targetFQN = entityHandler.getEntity().getTypeName();
|
||||
}
|
||||
|
||||
private OperationInvocationHandler(final EntityCollectionInvocationHandler<?> collectionHandler) {
|
||||
super(collectionHandler.containerHandler);
|
||||
super(collectionHandler.service);
|
||||
|
||||
this.target = collectionHandler;
|
||||
|
||||
@ -156,7 +156,7 @@ final class OperationInvocationHandler extends AbstractInvocationHandler impleme
|
||||
}
|
||||
|
||||
private Map.Entry<URI, EdmOperation> getBoundOperation(final Operation operation, final List<String> parameterNames) {
|
||||
final CommonODataEntity entity = ((EntityInvocationHandler) target).getEntity();
|
||||
final CommonODataEntity entity = EntityInvocationHandler.class.cast(target).getEntity();
|
||||
|
||||
ODataOperation boundOp = entity.getOperation(operation.name());
|
||||
if (boundOp == null) {
|
||||
@ -196,7 +196,8 @@ final class OperationInvocationHandler extends AbstractInvocationHandler impleme
|
||||
boundOp = new ODataOperation();
|
||||
boundOp.setMetadataAnchor(func.getFullQualifiedName().toString());
|
||||
boundOp.setTitle(boundOp.getMetadataAnchor());
|
||||
boundOp.setTarget(URI.create(entity.getEditLink().toString() + "/"
|
||||
boundOp.setTarget(URI.create((entity.getEditLink() == null
|
||||
? EntityInvocationHandler.class.cast(target).getEntityURI() : entity.getEditLink()).toString() + "/"
|
||||
+ (useOperationFQN ? func.getFullQualifiedName().toString() : operation.name())));
|
||||
} else {
|
||||
baseType = baseType.getBaseType();
|
||||
|
@ -18,19 +18,18 @@
|
||||
*/
|
||||
package org.apache.olingo.ext.proxy.commons;
|
||||
|
||||
import java.net.URI;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.olingo.client.api.uri.v4.URIBuilder;
|
||||
import org.apache.olingo.client.api.uri.v4.URISearch;
|
||||
import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
|
||||
import org.apache.olingo.commons.api.edm.FullQualifiedName;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.Search;
|
||||
import org.apache.olingo.ext.proxy.api.StructuredType;
|
||||
import org.apache.olingo.ext.proxy.utils.ClassUtils;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
public class SearchImpl<T extends StructuredType, EC extends AbstractEntityCollection<T>> implements Search<T, EC> {
|
||||
public class SearchImpl<T extends StructuredType, EC extends EntityCollection<T>> implements Search<T, EC> {
|
||||
|
||||
private static final long serialVersionUID = 4383858176507769973L;
|
||||
|
||||
|
@ -18,14 +18,14 @@
|
||||
*/
|
||||
package org.apache.olingo.ext.proxy.commons;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractSingleton;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Method;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
import org.apache.olingo.ext.proxy.api.EntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractSingleton;
|
||||
|
||||
public class SingletonInvocationHandler<
|
||||
T extends Serializable, KEY extends Serializable, EC extends AbstractEntityCollection<T>>
|
||||
T extends Serializable, KEY extends Serializable, EC extends EntityCollection<T>>
|
||||
extends AbstractInvocationHandler
|
||||
implements AbstractSingleton<T, KEY, EC> {
|
||||
|
||||
@ -33,18 +33,17 @@ public class SingletonInvocationHandler<
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
static SingletonInvocationHandler getInstance(
|
||||
final Class<?> ref, final EntityContainerInvocationHandler containerHandler, final String singletonName) {
|
||||
final Class<?> ref, final Service<?> service, final String singletonName) {
|
||||
|
||||
return new SingletonInvocationHandler(ref, containerHandler, singletonName);
|
||||
return new SingletonInvocationHandler(ref, service, singletonName);
|
||||
}
|
||||
private final EntitySetInvocationHandler<?, ?, ?> entitySetHandler;
|
||||
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
private SingletonInvocationHandler(
|
||||
final Class<?> ref, final EntityContainerInvocationHandler containerHandler, final String singletonName) {
|
||||
private SingletonInvocationHandler(final Class<?> ref, final Service<?> service, final String singletonName) {
|
||||
|
||||
super(containerHandler);
|
||||
this.entitySetHandler = EntitySetInvocationHandler.getInstance(ref, containerHandler, singletonName);
|
||||
super(service);
|
||||
this.entitySetHandler = EntitySetInvocationHandler.getInstance(ref, service, singletonName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,9 +54,9 @@ public class TransactionalPersistenceManagerImpl extends AbstractPersistenceMana
|
||||
@Override
|
||||
protected void doFlush(final PersistenceChanges changes, final TransactionItems items) {
|
||||
final CommonODataBatchRequest request =
|
||||
factory.getClient().getBatchRequestFactory().getBatchRequest(factory.getClient().getServiceRoot());
|
||||
service.getClient().getBatchRequestFactory().getBatchRequest(service.getClient().getServiceRoot());
|
||||
((ODataRequest) request).setAccept(
|
||||
factory.getClient().getConfiguration().getDefaultBatchAcceptFormat().toContentTypeString());
|
||||
service.getClient().getConfiguration().getDefaultBatchAcceptFormat().toContentTypeString());
|
||||
|
||||
final BatchManager streamManager = (BatchManager) ((ODataStreamedRequest) request).payloadManager();
|
||||
|
||||
|
@ -89,10 +89,12 @@ public class EntityContext implements Iterable<AttachedEntity> {
|
||||
throw new IllegalStateException("An entity with the same profile has already been attached");
|
||||
}
|
||||
|
||||
allAttachedEntities.put(entity, status);
|
||||
if (entity.getUUID().getEntitySetURI() != null) {
|
||||
allAttachedEntities.put(entity, status);
|
||||
|
||||
if (entity.getUUID().getKey() != null) {
|
||||
searchableEntities.put(entity.getUUID(), entity);
|
||||
if (entity.getUUID().getKey() != null) {
|
||||
searchableEntities.put(entity.getUUID(), entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,17 +24,15 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import org.apache.olingo.ext.proxy.api.StructuredType;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.URI;
|
||||
import org.apache.olingo.ext.proxy.api.EntityType;
|
||||
|
||||
public class EntityUUID implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4855025769803086495L;
|
||||
|
||||
private final String containerName;
|
||||
|
||||
private final URI entitySetURI;
|
||||
|
||||
private final Object key;
|
||||
@ -46,12 +44,11 @@ public class EntityUUID implements Serializable {
|
||||
|
||||
private Class<?> type;
|
||||
|
||||
public EntityUUID(final String containerName, final URI entitySetURI, final Class<?> type) {
|
||||
this(containerName, entitySetURI, type, null);
|
||||
public EntityUUID(final URI entitySetURI, final Class<?> type) {
|
||||
this(entitySetURI, type, null);
|
||||
}
|
||||
|
||||
public EntityUUID(final String containerName, final URI entitySetURI, final Class<?> type, final Object key) {
|
||||
this.containerName = containerName;
|
||||
public EntityUUID(final URI entitySetURI, final Class<?> type, final Object key) {
|
||||
this.entitySetURI = entitySetURI;
|
||||
this.key = key;
|
||||
this.tempKey = (int) (Math.random() * 1000000);
|
||||
@ -63,17 +60,13 @@ public class EntityUUID implements Serializable {
|
||||
if (this.type == null
|
||||
&& (clazz.getInterfaces().length == 0
|
||||
|| ArrayUtils.contains(clazz.getInterfaces(), Serializable.class)
|
||||
|| ArrayUtils.contains(clazz.getInterfaces(), StructuredType.class))) {
|
||||
|| ArrayUtils.contains(clazz.getInterfaces(), EntityType.class))) {
|
||||
|
||||
this.type = clazz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getContainerName() {
|
||||
return containerName;
|
||||
}
|
||||
|
||||
public URI getEntitySetURI() {
|
||||
return entitySetURI;
|
||||
}
|
||||
|
@ -70,6 +70,10 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.olingo.client.api.uri.CommonURIBuilder;
|
||||
import org.apache.olingo.commons.api.edm.Edm;
|
||||
import org.apache.olingo.commons.api.edm.EdmEntityContainer;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
|
||||
|
||||
public final class CoreUtils {
|
||||
|
||||
@ -656,4 +660,26 @@ public final class CoreUtils {
|
||||
|
||||
throw new IllegalArgumentException("Invalid streamed property " + name);
|
||||
}
|
||||
|
||||
public static URI getTargetEntitySetURI(
|
||||
final CommonEdmEnabledODataClient<?> client, final NavigationProperty property) {
|
||||
final Edm edm = client.getCachedEdm();
|
||||
|
||||
final FullQualifiedName containerName =
|
||||
new FullQualifiedName(property.targetSchema(), property.targetContainer());
|
||||
|
||||
final EdmEntityContainer container = edm.getEntityContainer(containerName);
|
||||
final CommonURIBuilder<?> uriBuilder = client.newURIBuilder(client.getServiceRoot());
|
||||
|
||||
if (!container.isDefault()) {
|
||||
final StringBuilder entitySetSegment = new StringBuilder();
|
||||
entitySetSegment.append(container.getFullQualifiedName()).append('.');
|
||||
entitySetSegment.append(property.targetEntitySet());
|
||||
uriBuilder.appendEntitySetSegment(entitySetSegment.toString());
|
||||
} else {
|
||||
uriBuilder.appendEntitySetSegment(property.targetEntitySet());
|
||||
}
|
||||
|
||||
return uriBuilder.build();
|
||||
}
|
||||
}
|
||||
|
@ -283,10 +283,7 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo {
|
||||
parseObj(typesBaseDir, typesPkg, "complexType", className + ".java", objs);
|
||||
}
|
||||
|
||||
final List<EdmEntityType> entities = new ArrayList<EdmEntityType>();
|
||||
|
||||
for (EdmEntityType entity : schema.getEntityTypes()) {
|
||||
entities.add(entity);
|
||||
objs.clear();
|
||||
objs.put("entityType", entity);
|
||||
|
||||
@ -330,35 +327,24 @@ public abstract class AbstractPOJOGenMojo extends AbstractMojo {
|
||||
objs.put("namespace", schema.getNamespace());
|
||||
objs.put("complexes", complexes);
|
||||
|
||||
parseObj(base, pkg, "container",
|
||||
utility.capitalize(container.getName()) + ".java", objs);
|
||||
parseObj(base, pkg, "container", utility.capitalize(container.getName()) + ".java", objs);
|
||||
|
||||
for (EdmEntitySet entitySet : container.getEntitySets()) {
|
||||
objs.clear();
|
||||
objs.put("entitySet", entitySet);
|
||||
parseObj(base, pkg, "entitySet",
|
||||
utility.capitalize(entitySet.getName()) + ".java", objs);
|
||||
objs.put("container", container);
|
||||
parseObj(base, pkg, "entitySet", utility.capitalize(entitySet.getName()) + ".java", objs);
|
||||
}
|
||||
|
||||
if (ODataServiceVersion.valueOf(getVersion().toUpperCase()).compareTo(ODataServiceVersion.V40) >= 0) {
|
||||
for (EdmSingleton singleton : container.getSingletons()) {
|
||||
objs.clear();
|
||||
objs.put("singleton", singleton);
|
||||
parseObj(base, pkg, "singleton",
|
||||
utility.capitalize(singleton.getName()) + ".java", objs);
|
||||
objs.put("container", container);
|
||||
parseObj(base, pkg, "singleton", utility.capitalize(singleton.getName()) + ".java", objs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
objs.clear();
|
||||
objs.put("namespace", schema.getNamespace());
|
||||
objs.put("complexes", complexes);
|
||||
parseObj(base, pkg, "complexCreator", "ComplexCreator.java", objs);
|
||||
|
||||
objs.clear();
|
||||
objs.put("namespace", schema.getNamespace());
|
||||
objs.put("entities", entities);
|
||||
parseObj(base, pkg, "entityCreator", "EntityCreator.java", objs);
|
||||
}
|
||||
|
||||
final File metaInf = mkdir("META-INF");
|
||||
|
@ -18,6 +18,7 @@
|
||||
*#
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
@ -30,7 +31,6 @@ import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.ext.proxy.api.Annotatable;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
|
||||
import org.apache.olingo.commons.api.edm.geo.Geospatial;
|
||||
@ -41,6 +41,7 @@ import org.apache.olingo.commons.api.edm.geo.MultiPoint;
|
||||
import org.apache.olingo.commons.api.edm.geo.MultiPolygon;
|
||||
import org.apache.olingo.commons.api.edm.geo.Point;
|
||||
import org.apache.olingo.commons.api.edm.geo.Polygon;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
#parse( "${odataVersion}/complexType.vm" )
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#set( $clsSuffix = ".class" )
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.client.api.http.HttpMethod;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Operation;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
|
||||
@ -26,7 +27,6 @@ import org.apache.olingo.ext.proxy.api.annotations.Property;
|
||||
import org.apache.olingo.ext.proxy.api.PersistenceManager;
|
||||
import org.apache.olingo.ext.proxy.api.OperationType;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
|
||||
@ -45,6 +45,7 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Calendar;
|
||||
import javax.xml.datatype.Duration;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("$namespace")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntityContainer(name = "$container.Name",
|
||||
@ -102,19 +103,5 @@ public interface $utility.capitalize($container.Name) extends PersistenceManager
|
||||
|
||||
#end
|
||||
#end
|
||||
}
|
||||
|
||||
#if( $complexes.size() > 0 )
|
||||
ComplexFactory complexFactory();
|
||||
|
||||
interface ComplexFactory {
|
||||
#foreach($complex in $complexes)
|
||||
#set( $type = "${namespace}.${complex.Name}" )
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "$complex.Name",
|
||||
type = "$type")
|
||||
$utility.getJavaType($type) new$utility.capitalize($complex.Name)();
|
||||
|
||||
#end
|
||||
}
|
||||
#end
|
||||
}
|
||||
}
|
||||
|
@ -18,15 +18,14 @@
|
||||
*#
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.client.api.http.HttpMethod;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
import org.apache.olingo.ext.proxy.api.OperationType;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Operation;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Parameter;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
|
||||
import org.apache.olingo.commons.api.edm.geo.Geospatial;
|
||||
@ -44,11 +43,12 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Calendar;
|
||||
import javax.xml.datatype.Duration;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
#set ( $javaEntityType = $utility.getJavaType($entityType) )
|
||||
|
||||
public interface $utility.capitalize($entityType.Name)Collection extends
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<$javaEntityType, ${javaEntityType}Collection, ${javaEntityType}Collection>, AbstractEntityCollection<$javaEntityType> {
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<$javaEntityType, ${javaEntityType}Collection, ${javaEntityType}Collection>, org.apache.olingo.ext.proxy.api.EntityCollection<$javaEntityType> {
|
||||
#set( $functions = $utility.getFunctionsBoundTo($entityType.Name, true) )
|
||||
#set( $actions = $utility.getActionsBoundTo($entityType.Name, true) )
|
||||
#if( $functions.size() > 0 || $actions.size() > 0 )
|
||||
|
@ -18,12 +18,12 @@
|
||||
*#
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.EntitySet;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.CompoundKey;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.CompoundKeyElement;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
|
||||
@ -42,6 +42,7 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Calendar;
|
||||
import javax.xml.datatype.Duration;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
#set( $keys = $utility.getEntityKeyType($entitySet) )
|
||||
#if( $keys.size() > 1 )
|
||||
@ -54,14 +55,7 @@ import javax.xml.datatype.Duration;
|
||||
|
||||
#set ( $javaEntityType = $utility.getJavaType($entitySet.EntityType) )
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "$entitySet.Name")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "$entitySet.Name", container = "$container.FullQualifiedName.toString()")
|
||||
public interface $utility.capitalize($entitySet.Name)
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<$javaEntityType, ${javaEntityType}Collection, $utility.capitalize($entitySet.Name)>, AbstractEntitySet<$javaEntityType, $type, ${javaEntityType}Collection> {
|
||||
|
||||
#foreach( $dos in $utility.getDescendantsOrSelf($utility.getEdmType($entitySet)) )
|
||||
#set( $djt = $utility.getJavaType($dos) )
|
||||
#set( $sIdx = $djt.lastIndexOf('.') + 1 )
|
||||
$djt new$djt.substring($sIdx)();
|
||||
${djt}Collection new$djt.substring($sIdx)Collection();
|
||||
#end
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
*#
|
||||
#set( $clsSuffix = ".class" )
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.client.api.http.HttpMethod;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForProperty;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.AnnotationsForNavigationProperty;
|
||||
@ -38,7 +38,6 @@ import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
|
||||
import org.apache.olingo.commons.api.edm.geo.Geospatial;
|
||||
@ -49,6 +48,7 @@ import org.apache.olingo.commons.api.edm.geo.MultiPoint;
|
||||
import org.apache.olingo.commons.api.edm.geo.MultiPolygon;
|
||||
import org.apache.olingo.commons.api.edm.geo.Point;
|
||||
import org.apache.olingo.commons.api.edm.geo.Polygon;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
#if( $keyRef )@KeyRef(${keyRef}.class)#end
|
||||
|
||||
@ -59,7 +59,7 @@ import org.apache.olingo.commons.api.edm.geo.Polygon;
|
||||
isAbstract = $entityType.Abstract#if($entityType.getBaseType()),
|
||||
baseType = "$entityType.getBaseType().getFullQualifiedName().toString()"#end)
|
||||
public interface $utility.capitalize($entityType.Name)
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,#if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($entityType.Name)>#end#{if}( $entityType.isOpenType() ),AbstractOpenType#end {
|
||||
extends org.apache.olingo.ext.proxy.api.EntityType,org.apache.olingo.ext.proxy.api.Annotatable,#if( $entityType.getBaseType() )$utility.getJavaType($entityType.getBaseType())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($entityType.Name)>#end#{if}( $entityType.isOpenType() ),AbstractOpenType#end {
|
||||
|
||||
#if( $entityType.getBaseType() )
|
||||
@Override
|
||||
@ -183,18 +183,6 @@ public interface $utility.capitalize($entityType.Name)
|
||||
}
|
||||
#end
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory #if( $entityType.baseType )
|
||||
extends ${utility.getJavaType($entityType.getBaseType())}.ComplexFactory#end{
|
||||
#foreach($property in $complexProps)
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "$property.Name",
|
||||
type = "$property.Type.FullQualifiedName.toString()")
|
||||
$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
|
||||
|
||||
#end
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations #if( $entityType.baseType )
|
||||
@ -244,13 +232,6 @@ public interface $utility.capitalize($entityType.Name)
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "$property.Name", contained = true)
|
||||
interface $utility.capitalize($property.Name)
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<$javaEntityType, ${javaEntityType}Collection, $utility.capitalize($property.Name)>, AbstractEntitySet<$javaEntityType, $type, ${javaEntityType}Collection> {
|
||||
|
||||
#foreach( $dos in $utility.getDescendantsOrSelf($utility.getEdmType($property)) )
|
||||
#set( $djt = $utility.getJavaType($dos) )
|
||||
#set( $sIdx = $djt.lastIndexOf('.') + 1 )
|
||||
$djt new$djt.substring($sIdx)();
|
||||
${djt}Collection new$djt.substring($sIdx)Collection();
|
||||
#end
|
||||
}
|
||||
|
||||
#end
|
||||
|
@ -18,6 +18,7 @@
|
||||
*#
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.CompoundKey;
|
||||
@ -29,7 +30,6 @@ import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
|
||||
import org.apache.olingo.commons.api.edm.geo.Geospatial;
|
||||
@ -47,6 +47,7 @@ import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Calendar;
|
||||
import javax.xml.datatype.Duration;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.CompoundKey
|
||||
public class $keyRef extends AbstractEntityKey {
|
||||
|
@ -18,9 +18,11 @@
|
||||
*#
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.EnumType;
|
||||
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
#set( $enumName = $utility.capitalize($enumType.Name) )
|
||||
#set( $count = $enumType.MemberNames.size() )
|
||||
|
@ -18,13 +18,13 @@
|
||||
*#
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractSingleton;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.EntitySet;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Singleton;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.CompoundKey;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.CompoundKeyElement;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
|
||||
@ -42,6 +42,7 @@ import java.util.UUID;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Calendar;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
#parse( "${odataVersion}/singleton.vm" )
|
||||
|
||||
|
@ -18,13 +18,14 @@
|
||||
*#
|
||||
package ${package};
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Term;
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
#foreach($ns in $namespaces)
|
||||
import #if($basePackage)${basePackage}.#end${ns}.*;
|
||||
import #if($basePackage)${basePackage}.#end${ns}.types.*;
|
||||
#end
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("$namespace")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Term(name = "$term.Name",
|
||||
|
@ -19,7 +19,7 @@
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("$namespace")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.ComplexType(name = "$complexType.Name")
|
||||
public interface $utility.capitalize($complexType.Name)
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,#if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($complexType.Name)>#end {
|
||||
extends org.apache.olingo.ext.proxy.api.ComplexType,#if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($complexType.Name)>#end {
|
||||
|
||||
#if( $entityType.getBaseType() )
|
||||
@Override
|
||||
@ -40,15 +40,3 @@ public interface $utility.capitalize($complexType.Name)
|
||||
#end
|
||||
|
||||
#end
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory #if( $complexType.baseType )
|
||||
extends ${utility.getJavaType($complexType.getBaseType())}.ComplexFactory#end{
|
||||
#foreach($property in $complexProps)
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "$property.Name",
|
||||
type = "$property.Type.FullQualifiedName.toString()")
|
||||
$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
|
||||
|
||||
#end
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
isAbstract = $complexType.Abstract#if($complexType.getBaseType()),
|
||||
baseType = "$complexType.getBaseType().getFullQualifiedName().toString()"#end)
|
||||
public interface $utility.capitalize($complexType.Name)
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,#if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($complexType.Name)>#{end}#if( $complexType.isOpenType() ),AbstractOpenType#{end} {
|
||||
extends org.apache.olingo.ext.proxy.api.ComplexType,#if($complexType.getBaseType())$utility.getJavaType($complexType.getBaseType().getFullQualifiedName().toString())#{else}org.apache.olingo.ext.proxy.api.SingleQuery<$utility.capitalize($complexType.Name)>#{end}#if( $complexType.isOpenType() ),AbstractOpenType#{end} {
|
||||
|
||||
#if( $entityType.getBaseType() )
|
||||
@Override
|
||||
@ -74,18 +74,6 @@ public interface $utility.capitalize($complexType.Name)
|
||||
#end
|
||||
#end
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory #if( $complexType.baseType )
|
||||
extends ${utility.getJavaType($complexType.getBaseType())}.ComplexFactory#end{
|
||||
#foreach($property in $complexProps)
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "$property.Name",
|
||||
type = "$property.Type.FullQualifiedName.toString()")
|
||||
$utility.getJavaType($property.Type) new$utility.capitalize($property.Name)();
|
||||
|
||||
#end
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations #if( $complexType.baseType )
|
||||
|
@ -25,6 +25,6 @@
|
||||
#set( $type = "" )
|
||||
#end
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "$singleton.Name")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Singleton(name = "$singleton.Name", container = "$container.FullQualifiedName.toString()")
|
||||
public interface $utility.capitalize($singleton.Name) extends org.apache.olingo.ext.proxy.api.SingleQuery<$utility.getJavaType($singleton.EntityType)>,AbstractSingleton<$utility.getJavaType($singleton.EntityType), $type, $utility.getJavaType($singleton.EntityType)Collection> {
|
||||
}
|
@ -1,31 +1,31 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.client.api.v3.EdmEnabledODataClient;
|
||||
import org.apache.olingo.commons.api.format.ContentType;
|
||||
import org.apache.olingo.ext.proxy.Service;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice
|
||||
.DefaultContainer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.DefaultContainer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Aliases;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone;
|
||||
import org.junit.BeforeClass;
|
||||
@ -40,8 +40,6 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
public abstract class AbstractTestITCase {
|
||||
@ -86,11 +84,11 @@ public abstract class AbstractTestITCase {
|
||||
}
|
||||
|
||||
protected Customer getSampleCustomerProfile(
|
||||
final Integer id,
|
||||
final String sampleName,
|
||||
final DefaultContainer container) {
|
||||
final Integer id,
|
||||
final String sampleName,
|
||||
final DefaultContainer container) {
|
||||
|
||||
final Customer customer = container.getCustomer().newCustomer();
|
||||
final Customer customer = service.newEntity(Customer.class);
|
||||
|
||||
// add name attribute
|
||||
customer.setName(sampleName);
|
||||
@ -98,29 +96,30 @@ public abstract class AbstractTestITCase {
|
||||
// add key attribute
|
||||
customer.setCustomerId(id);
|
||||
|
||||
final ContactDetails cd = customer.factory().newPrimaryContactInfo();
|
||||
final ContactDetails cd = service.newComplex(ContactDetails.class); // PrimaryContactInfo
|
||||
cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
|
||||
cd.setEmailBag(Collections.<String> singleton("myname@mydomain.org"));
|
||||
cd.setMobilePhoneBag(Collections.<Phone> emptySet());
|
||||
cd.setEmailBag(Collections.<String>singleton("myname@mydomain.org"));
|
||||
cd.setMobilePhoneBag(Collections.<Phone>emptySet());
|
||||
customer.setPrimaryContactInfo(cd);
|
||||
|
||||
final Aliases aliases = cd.factory().newContactAlias();
|
||||
aliases.setAlternativeNames(Collections.<String> singleton("myAlternativeName"));
|
||||
final Aliases aliases = service.newComplex(Aliases.class);
|
||||
aliases.setAlternativeNames(Collections.<String>singleton("myAlternativeName"));
|
||||
cd.setContactAlias(aliases);
|
||||
|
||||
final ContactDetails bcd = customer.factory().newBackupContactInfo();
|
||||
final ContactDetails bcd = service.newComplex(ContactDetails.class); // BackupContactInfo;
|
||||
bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
|
||||
bcd.setEmailBag(Collections.<String> emptySet());
|
||||
bcd.setMobilePhoneBag(Collections.<Phone> emptySet());
|
||||
customer.setBackupContactInfo(Collections.<ContactDetails> singleton(bcd));
|
||||
bcd.setEmailBag(Collections.<String>emptySet());
|
||||
bcd.setMobilePhoneBag(Collections.<Phone>emptySet());
|
||||
customer.setBackupContactInfo(Collections.<ContactDetails>singleton(bcd));
|
||||
|
||||
container.getCustomer().add(customer);
|
||||
return customer;
|
||||
}
|
||||
|
||||
protected void checkSampleCustomerProfile(
|
||||
final Customer customer,
|
||||
final Integer id,
|
||||
final String sampleName) {
|
||||
final Customer customer,
|
||||
final Integer id,
|
||||
final String sampleName) {
|
||||
|
||||
assertEquals(id, customer.getCustomerId());
|
||||
assertNotNull(customer.getPrimaryContactInfo());
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
import org.apache.olingo.client.api.v3.EdmEnabledODataClient;
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AsyncCall;
|
||||
|
@ -1,35 +1,34 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.NavigationProperty;
|
||||
import org.apache.olingo.ext.proxy.commons.EntityInvocationHandler;
|
||||
import org.apache.olingo.ext.proxy.context.AttachedEntityStatus;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.CustomerInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Login;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Order;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.OrderCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.OrderCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -47,8 +46,6 @@ import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
/**
|
||||
@ -58,14 +55,17 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void attachDetachNewEntity() {
|
||||
final Customer customer1 = container.getCustomer().newCustomer();
|
||||
final Customer customer2 = container.getCustomer().newCustomer();
|
||||
final Customer customer1 = service.newEntity(Customer.class);
|
||||
final Customer customer2 = service.newEntity(Customer.class);
|
||||
|
||||
final EntityInvocationHandler source1 =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customer1);
|
||||
final EntityInvocationHandler source2 =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customer2);
|
||||
|
||||
container.getCustomer().add(customer1);
|
||||
container.getCustomer().add(customer2);
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(source1));
|
||||
assertTrue(service.getContext().entityContext().isAttached(source2));
|
||||
|
||||
@ -125,22 +125,20 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void linkTargetExisting() {
|
||||
final Customer customer = container.getCustomer().newCustomer();
|
||||
final Customer customer = service.newEntity(Customer.class);
|
||||
final CustomerInfo customerInfo = container.getCustomerInfo().getByKey(11);
|
||||
|
||||
customer.setInfo(customerInfo);
|
||||
|
||||
assertNotNull(customer.getInfo());
|
||||
|
||||
final EntityInvocationHandler source =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
final EntityInvocationHandler target =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customerInfo);
|
||||
container.getCustomer().add(customer);
|
||||
|
||||
final EntityInvocationHandler source = (EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
final EntityInvocationHandler target = (EntityInvocationHandler) Proxy.getInvocationHandler(customerInfo);
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(source));
|
||||
assertEquals(AttachedEntityStatus.NEW, service.getContext().entityContext().getStatus(source));
|
||||
assertTrue(service.getContext().entityContext().isAttached(target));
|
||||
assertEquals(AttachedEntityStatus.LINKED, service.getContext().entityContext().getStatus(target));
|
||||
assertFalse(service.getContext().entityContext().isAttached(target));
|
||||
|
||||
checkUnidirectional("Info", source, "Customer", target, false);
|
||||
|
||||
@ -154,21 +152,17 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
public void linkSourceExisting() {
|
||||
final Customer customer = container.getCustomer().getByKey(-10);
|
||||
|
||||
final CustomerInfo customerInfo = container.getCustomerInfo().newCustomerInfo();
|
||||
final CustomerInfo customerInfo = service.newEntity(CustomerInfo.class);
|
||||
|
||||
customer.setInfo(customerInfo);
|
||||
|
||||
assertNotNull(customer.getInfo());
|
||||
|
||||
final EntityInvocationHandler source =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
final EntityInvocationHandler target =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customerInfo);
|
||||
final EntityInvocationHandler source = (EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
final EntityInvocationHandler target = (EntityInvocationHandler) Proxy.getInvocationHandler(customerInfo);
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(source));
|
||||
assertEquals(AttachedEntityStatus.CHANGED, service.getContext().entityContext().getStatus(source));
|
||||
assertTrue(service.getContext().entityContext().isAttached(target));
|
||||
assertEquals(AttachedEntityStatus.NEW, service.getContext().entityContext().getStatus(target));
|
||||
assertFalse(service.getContext().entityContext().isAttached(target));
|
||||
|
||||
checkUnidirectional("Info", source, "Customer", target, false);
|
||||
|
||||
@ -184,18 +178,14 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
final CustomerInfo customerInfo = container.getCustomerInfo().getByKey(12);
|
||||
|
||||
customer.setInfo(customerInfo);
|
||||
|
||||
assertNotNull(customer.getInfo());
|
||||
|
||||
final EntityInvocationHandler source =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
final EntityInvocationHandler target =
|
||||
(EntityInvocationHandler) Proxy.getInvocationHandler(customerInfo);
|
||||
final EntityInvocationHandler source = (EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
final EntityInvocationHandler target = (EntityInvocationHandler) Proxy.getInvocationHandler(customerInfo);
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(source));
|
||||
assertEquals(AttachedEntityStatus.CHANGED, service.getContext().entityContext().getStatus(source));
|
||||
assertTrue(service.getContext().entityContext().isAttached(target));
|
||||
assertEquals(AttachedEntityStatus.LINKED, service.getContext().entityContext().getStatus(target));
|
||||
assertFalse(service.getContext().entityContext().isAttached(target));
|
||||
|
||||
checkUnidirectional("Info", source, "Customer", target, false);
|
||||
|
||||
@ -207,12 +197,12 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void linkEntitySet() {
|
||||
final Customer customer = container.getCustomer().newCustomer();
|
||||
final Customer customer = service.newEntity(Customer.class);
|
||||
|
||||
final OrderCollection toBeLinked = container.getOrder().newOrderCollection();
|
||||
toBeLinked.add(container.getOrder().newOrder());
|
||||
toBeLinked.add(container.getOrder().newOrder());
|
||||
toBeLinked.add(container.getOrder().newOrder());
|
||||
final OrderCollection toBeLinked = service.newEntityCollection(OrderCollection.class);
|
||||
toBeLinked.add(service.newEntity(Order.class));
|
||||
toBeLinked.add(service.newEntity(Order.class));
|
||||
toBeLinked.add(service.newEntity(Order.class));
|
||||
|
||||
customer.setOrders(toBeLinked);
|
||||
assertNotNull(customer.getOrders());
|
||||
@ -220,12 +210,15 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
|
||||
final EntityInvocationHandler source = (EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
|
||||
container.getCustomer().add(customer);
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(source));
|
||||
assertEquals(AttachedEntityStatus.NEW, service.getContext().entityContext().getStatus(source));
|
||||
assertEquals(3, ((Collection) (source.getLinkChanges().entrySet().iterator().next().getValue())).size());
|
||||
|
||||
for (Order order : toBeLinked) {
|
||||
final EntityInvocationHandler target = (EntityInvocationHandler) Proxy.getInvocationHandler(order);
|
||||
container.getOrder().add(order);
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(target));
|
||||
assertEquals(AttachedEntityStatus.NEW, service.getContext().entityContext().getStatus(target));
|
||||
@ -244,15 +237,15 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void addProperty() {
|
||||
final Customer customer = container.getCustomer().newCustomer();
|
||||
final Customer customer = service.newEntity(Customer.class);
|
||||
customer.setCustomerId(100);
|
||||
|
||||
final ContactDetails cd = customer.factory().newPrimaryContactInfo();
|
||||
final ContactDetails cd = service.newComplex(ContactDetails.class);
|
||||
customer.setPrimaryContactInfo(cd);
|
||||
|
||||
cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
|
||||
|
||||
final ContactDetails bcd = customer.factory().newBackupContactInfo();
|
||||
final ContactDetails bcd = service.newComplex(ContactDetails.class);
|
||||
customer.setBackupContactInfo(Collections.<ContactDetails>singletonList(bcd));
|
||||
|
||||
bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
|
||||
@ -264,6 +257,8 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
assertEquals(2, customer.getBackupContactInfo().iterator().next().getAlternativeNames().size());
|
||||
assertTrue(customer.getBackupContactInfo().iterator().next().getAlternativeNames().contains("alternative4"));
|
||||
|
||||
container.getCustomer().add(customer);
|
||||
|
||||
final EntityInvocationHandler source = (EntityInvocationHandler) Proxy.getInvocationHandler(customer);
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(source));
|
||||
@ -319,9 +314,16 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void checkContextInCaseOfErrors() {
|
||||
final Login login = container.getLogin().newLogin();
|
||||
service.getContext().entityContext().detachAll();
|
||||
|
||||
final Login login = service.newEntity(Login.class);
|
||||
|
||||
final EntityInvocationHandler handler = (EntityInvocationHandler) Proxy.getInvocationHandler(login);
|
||||
assertFalse(service.getContext().entityContext().isAttached(handler));
|
||||
|
||||
container.flush(); // Login will be ignored because not added to an entity set.
|
||||
|
||||
container.getLogin().add(login); // now has been added
|
||||
|
||||
assertTrue(service.getContext().entityContext().isAttached(handler));
|
||||
|
||||
@ -356,7 +358,7 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void flushTest() {
|
||||
Customer customer = container.getCustomer().newCustomer();
|
||||
Customer customer = service.newEntity(Customer.class);
|
||||
customer.setCustomerId(300);
|
||||
customer.setName("samplename");
|
||||
|
||||
@ -365,9 +367,9 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
keys.add(-201);
|
||||
keys.add(-202);
|
||||
|
||||
final OrderCollection toBeLinked = container.getOrder().newOrderCollection();
|
||||
final OrderCollection toBeLinked = service.newEntityCollection(OrderCollection.class);
|
||||
for (Integer key : keys) {
|
||||
final Order order = container.getOrder().newOrder();
|
||||
final Order order = service.newEntity(Order.class);
|
||||
order.setOrderId(key);
|
||||
order.setCustomerId(300);
|
||||
order.setCustomer(customer);
|
||||
@ -380,12 +382,12 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
customerInfo.setInformation("some new info ...");
|
||||
customer.setInfo(customerInfo);
|
||||
|
||||
final ContactDetails cd = customer.factory().newPrimaryContactInfo();
|
||||
final ContactDetails cd = service.newComplex(ContactDetails.class);
|
||||
cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
|
||||
cd.setEmailBag(Collections.<String>singleton("myemail@mydomain.org"));
|
||||
cd.setMobilePhoneBag(Collections.<Phone>emptySet());
|
||||
|
||||
final ContactDetails bcd = customer.factory().newBackupContactInfo();
|
||||
final ContactDetails bcd = service.newComplex(ContactDetails.class);
|
||||
bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
|
||||
bcd.setEmailBag(Collections.<String>emptySet());
|
||||
bcd.setMobilePhoneBag(Collections.<Phone>emptySet());
|
||||
@ -393,12 +395,14 @@ public class ContextTestITCase extends AbstractTestITCase {
|
||||
customer.setPrimaryContactInfo(cd);
|
||||
customer.setBackupContactInfo(Collections.<ContactDetails>singletonList(bcd));
|
||||
|
||||
container.getCustomer().add(customer);
|
||||
|
||||
assertTrue(service.getContext().entityContext().
|
||||
isAttached((EntityInvocationHandler) Proxy.getInvocationHandler(customerInfo)));
|
||||
assertTrue(service.getContext().entityContext().
|
||||
isAttached((EntityInvocationHandler) Proxy.getInvocationHandler(customer)));
|
||||
for (Order linked : toBeLinked) {
|
||||
assertTrue(service.getContext().entityContext().
|
||||
assertFalse(service.getContext().entityContext().
|
||||
isAttached((EntityInvocationHandler) Proxy.getInvocationHandler(linked)));
|
||||
}
|
||||
|
||||
|
@ -1,31 +1,31 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Message;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.MessageKey;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.MessageKey;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Order;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.OrderCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.OrderCollection;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@ -33,10 +33,7 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
/**
|
||||
* This is the unit test class to check entity create operations.
|
||||
*/
|
||||
@ -83,13 +80,14 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
|
||||
public void createEmployee() {
|
||||
final Integer id = 101;
|
||||
|
||||
final Employee employee = container.getPerson().newEmployee();
|
||||
final Employee employee = service.newEntity(Employee.class);
|
||||
employee.setPersonId(id);
|
||||
employee.setName("sample employee from proxy");
|
||||
employee.setManagersPersonId(-9918);
|
||||
employee.setSalary(2147483647);
|
||||
employee.setTitle("CEO");
|
||||
|
||||
container.getPerson().add(employee);
|
||||
container.flush();
|
||||
|
||||
Employee actual = container.getPerson().getByKey(id, Employee.class).load();
|
||||
@ -129,7 +127,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
|
||||
|
||||
Customer actual = readCustomer(container, id);
|
||||
checkSampleCustomerProfile(actual, id, sampleName);
|
||||
assertEquals(16, actual.getInfo().getCustomerInfoId(), 0);
|
||||
assertEquals(16, actual.getInfo().load().getCustomerInfoId(), 0);
|
||||
|
||||
container.getCustomer().delete(actual.getCustomerId());
|
||||
container.flush();
|
||||
@ -146,13 +144,13 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
|
||||
final String sampleName = "sample customer from proxy with back navigation";
|
||||
final Integer id = 102;
|
||||
|
||||
Order order = container.getOrder().newOrder();
|
||||
Order order = service.newEntity(Order.class);
|
||||
order.setCustomerId(id);
|
||||
order.setOrderId(id); // same id ...
|
||||
|
||||
final Customer customer = getSampleCustomerProfile(id, sampleName, container);
|
||||
|
||||
final OrderCollection orders = container.getOrder().newOrderCollection();
|
||||
final OrderCollection orders = service.newEntityCollection(OrderCollection.class);
|
||||
orders.add(order);
|
||||
|
||||
customer.setOrders(orders);
|
||||
@ -170,8 +168,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
|
||||
assertEquals(id, actual.getOrders().iterator().next().getCustomerId());
|
||||
|
||||
order = container.getOrder().getByKey(id);
|
||||
assertNotNull(order);
|
||||
assertEquals(id, order.getCustomer().getCustomerId());
|
||||
assertEquals(id, order.getCustomer().load().getCustomerId());
|
||||
|
||||
container.getOrder().delete(actual.getOrders());
|
||||
container.flush();
|
||||
@ -197,7 +194,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void multiKey() {
|
||||
Message message = container.getMessage().newMessage();
|
||||
Message message = service.newEntity(Message.class);
|
||||
message.setMessageId(100);
|
||||
message.setFromUsername("fromusername");
|
||||
message.setToUsername("myusername");
|
||||
@ -205,6 +202,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
|
||||
message.setSubject("test message");
|
||||
message.setBody("test");
|
||||
|
||||
container.getMessage().add(message);
|
||||
container.flush();
|
||||
|
||||
MessageKey key = new MessageKey();
|
||||
|
@ -1,64 +1,51 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.olingo.commons.api.edm.geo.Geospatial;
|
||||
import org.apache.olingo.commons.api.edm.geo.Geospatial.Type;
|
||||
import org.apache.olingo.commons.api.edm.geo.MultiLineString;
|
||||
import org.apache.olingo.commons.api.edm.geo.Point;
|
||||
import org.apache.olingo.ext.proxy.commons.EntityInvocationHandler;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice
|
||||
.DefaultContainer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.AllSpatialTypes;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ComputerDetail;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ConcurrencyInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.Contractor;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ContractorCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.DefaultContainer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetail;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Contractor;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContractorCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.CustomerInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.EmployeeCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.EmployeeCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Message;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.MessageKey;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.MessageKey;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Order;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.OrderCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.OrderCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Person;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.PersonCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.PersonCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Phone;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.SpecialEmployee;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.SpecialEmployeeCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.SpecialEmployee;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.SpecialEmployeeCollection;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.Proxy;
|
||||
@ -71,8 +58,6 @@ import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
/**
|
||||
@ -111,11 +96,10 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
|
||||
assertNotNull(employee);
|
||||
}
|
||||
|
||||
final SpecialEmployeeCollection specialEmployees =
|
||||
getContainer().getPerson().execute(SpecialEmployeeCollection.class);
|
||||
assertNotNull(specialEmployees);
|
||||
assertFalse(specialEmployees.isEmpty());
|
||||
for (SpecialEmployee employee : specialEmployees) {
|
||||
final SpecialEmployeeCollection specEmployees = getContainer().getPerson().execute(SpecialEmployeeCollection.class);
|
||||
assertNotNull(specEmployees);
|
||||
assertFalse(specEmployees.isEmpty());
|
||||
for (SpecialEmployee employee : specEmployees) {
|
||||
assertNotNull(employee);
|
||||
}
|
||||
|
||||
@ -126,7 +110,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
|
||||
assertNotNull(contractor);
|
||||
}
|
||||
|
||||
assertTrue(employees.size() > specialEmployees.size());
|
||||
assertTrue(employees.size() > specEmployees.size());
|
||||
assertTrue(all.size() > employees.size() + contractors.size());
|
||||
}
|
||||
|
||||
@ -168,7 +152,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
|
||||
@Test
|
||||
public void withInlineEntry() {
|
||||
final Customer customer = readCustomer(getContainer(), -10);
|
||||
final CustomerInfo customerInfo = customer.getInfo();
|
||||
final CustomerInfo customerInfo = customer.getInfo().load();
|
||||
assertNotNull(customerInfo);
|
||||
assertEquals(11, customerInfo.getCustomerInfoId(), 0);
|
||||
}
|
||||
@ -187,7 +171,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
|
||||
|
||||
try {
|
||||
assertNotNull(computerDetail.operations().getClass().getMethod(
|
||||
"resetComputerDetailsSpecifications", Collection.class, Timestamp.class));
|
||||
"resetComputerDetailsSpecifications", Collection.class, Timestamp.class));
|
||||
} catch (Exception e) {
|
||||
fail();
|
||||
}
|
||||
@ -207,7 +191,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
|
||||
public void checkForETag() {
|
||||
Product product = getContainer().getProduct().getByKey(-10).load();
|
||||
assertTrue(StringUtils.isNotBlank(
|
||||
((EntityInvocationHandler) Proxy.getInvocationHandler(product)).getETag()));
|
||||
((EntityInvocationHandler) Proxy.getInvocationHandler(product)).getETag()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -222,7 +206,7 @@ public class EntityRetrieveTestITCase extends AbstractTestITCase {
|
||||
|
||||
for (ContactDetails contact : backupContactInfo) {
|
||||
if (contact.getContactAlias() != null && contact.getContactAlias().getAlternativeNames() != null && contact.
|
||||
getContactAlias().getAlternativeNames().contains("vxiefursgkqzptijhincpdm")) {
|
||||
getContactAlias().getAlternativeNames().contains("vxiefursgkqzptijhincpdm")) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Car;
|
||||
|
@ -1,43 +1,40 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.olingo.ext.proxy.commons.EntityInvocationHandler;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ConcurrencyInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Message;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.MessageKey;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.MessageKey;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Order;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.OrderCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.OrderCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
/**
|
||||
@ -76,11 +73,11 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
|
||||
|
||||
@Test
|
||||
public void patchLink() {
|
||||
Order order = container.getOrder().newOrder();
|
||||
Order order = service.newEntity(Order.class);
|
||||
order.setOrderId(400);
|
||||
order.setCustomerId(-9);
|
||||
|
||||
OrderCollection orders = container.getOrder().newOrderCollection();
|
||||
OrderCollection orders = service.newEntityCollection(OrderCollection.class);
|
||||
orders.add(order);
|
||||
|
||||
Customer customer = container.getCustomer().getByKey(-9);
|
||||
@ -104,7 +101,7 @@ public class EntityUpdateTestITCase extends AbstractTestITCase {
|
||||
}
|
||||
}
|
||||
assertEquals(1, count);
|
||||
assertEquals(-9, order.getCustomer().getCustomerId(), 0);
|
||||
assertEquals(-9, order.getCustomer().load().getCustomerId(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.Sort;
|
||||
|
@ -1,36 +1,33 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ComputerDetail;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetail;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.CustomerCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.Dimensions;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.CustomerCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.EmployeeCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.EmployeeCollection;
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product;
|
||||
import org.junit.Test;
|
||||
|
||||
@ -50,8 +47,6 @@ import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
public class InvokeTestITCase extends AbstractTestITCase {
|
||||
@ -93,13 +88,14 @@ public class InvokeTestITCase extends AbstractTestITCase {
|
||||
// 0. create an employee
|
||||
final Integer id = 101;
|
||||
|
||||
Employee employee = container.getPerson().newEmployee();
|
||||
Employee employee = service.newEntity(Employee.class);
|
||||
employee.setPersonId(id);
|
||||
employee.setName("sample employee from proxy");
|
||||
employee.setManagersPersonId(-9918);
|
||||
employee.setSalary(2147483647);
|
||||
employee.setTitle("CEO");
|
||||
|
||||
container.getPerson().add(employee);
|
||||
container.flush();
|
||||
|
||||
employee = container.getPerson().getByKey(id, Employee.class).load();
|
||||
@ -147,16 +143,17 @@ public class InvokeTestITCase extends AbstractTestITCase {
|
||||
// 0. create a product
|
||||
final Integer id = 101;
|
||||
|
||||
Product product = container.getProduct().newProduct();
|
||||
Product product = service.newEntity(Product.class);
|
||||
product.setProductId(id);
|
||||
product.setDescription("New product");
|
||||
|
||||
final Dimensions origDimensions = product.factory().newDimensions();
|
||||
final Dimensions origDimensions = service.newComplex(Dimensions.class);
|
||||
origDimensions.setDepth(BigDecimal.ZERO);
|
||||
origDimensions.setHeight(BigDecimal.ZERO);
|
||||
origDimensions.setWidth(BigDecimal.ZERO);
|
||||
product.setDimensions(origDimensions);
|
||||
|
||||
container.getProduct().add(product);
|
||||
container.flush();
|
||||
|
||||
product = container.getProduct().getByKey(id).load();
|
||||
@ -168,7 +165,7 @@ public class InvokeTestITCase extends AbstractTestITCase {
|
||||
|
||||
try {
|
||||
// 1. invoke action bound to the product just created
|
||||
final Dimensions newDimensions = product.factory().newDimensions();
|
||||
final Dimensions newDimensions = service.newComplex(Dimensions.class);
|
||||
newDimensions.setDepth(BigDecimal.ONE);
|
||||
newDimensions.setHeight(BigDecimal.ONE);
|
||||
newDimensions.setWidth(BigDecimal.ONE);
|
||||
@ -200,11 +197,12 @@ public class InvokeTestITCase extends AbstractTestITCase {
|
||||
purchaseDate.set(Calendar.MONTH, 0);
|
||||
purchaseDate.set(Calendar.DAY_OF_MONTH, 1);
|
||||
|
||||
ComputerDetail computerDetail = container.getComputerDetail().newComputerDetail();
|
||||
ComputerDetail computerDetail = service.newEntity(ComputerDetail.class);
|
||||
computerDetail.setComputerDetailId(id);
|
||||
computerDetail.setSpecificationsBag(Collections.singleton("First spec"));
|
||||
computerDetail.setPurchaseDate(new Timestamp(purchaseDate.getTimeInMillis()));
|
||||
|
||||
container.getComputerDetail().add(computerDetail);
|
||||
container.flush();
|
||||
|
||||
computerDetail = container.getComputerDetail().getByKey(id).load();
|
||||
|
@ -1,18 +1,18 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
@ -25,6 +25,7 @@ import org.junit.Test;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import static org.apache.olingo.fit.proxy.v3.AbstractTestITCase.service;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
@ -74,11 +75,13 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
|
||||
input = container.getCar().getByKey(14).load().getStream();
|
||||
assertEquals(TO_BE_UPDATED, IOUtils.toString(input));
|
||||
IOUtils.closeQuietly(input);
|
||||
|
||||
service.getContext().detachAll();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void create() throws IOException {
|
||||
Car car = container.getCar().newCar();
|
||||
Car car = service.newEntity(Car.class);
|
||||
|
||||
final String TO_BE_UPDATED = "buffered stream sample (" + System.currentTimeMillis() + ")";
|
||||
InputStream input = IOUtils.toInputStream(TO_BE_UPDATED);
|
||||
@ -87,6 +90,7 @@ public class MediaEntityTestITCase extends AbstractTestITCase {
|
||||
car.setStream(input);
|
||||
car.setDescription(DESC);
|
||||
|
||||
container.getCar().add(car);
|
||||
container.flush();
|
||||
|
||||
int key = car.getVIN();
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
import org.apache.olingo.client.api.v3.EdmEnabledODataClient;
|
||||
@ -35,6 +36,7 @@ import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.UUID;
|
||||
import org.apache.olingo.fit.proxy.v4.opentype.microsoft.test.odata.services.opentypesservicev4.types.IndexedRow;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
@ -45,28 +47,28 @@ import static org.junit.Assert.assertTrue;
|
||||
*/
|
||||
public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||
|
||||
private static Service<EdmEnabledODataClient> otcontainerFactory;
|
||||
private static Service<EdmEnabledODataClient> otservice;
|
||||
|
||||
private static DefaultContainer otcontainer;
|
||||
|
||||
@BeforeClass
|
||||
public static void initContainer() {
|
||||
otcontainerFactory = Service.getV3(testOpenTypeServiceRootURL);
|
||||
otcontainerFactory.getClient().getConfiguration().
|
||||
otservice = Service.getV3(testOpenTypeServiceRootURL);
|
||||
otservice.getClient().getConfiguration().
|
||||
setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
|
||||
otcontainer = otcontainerFactory.getEntityContainer(DefaultContainer.class);
|
||||
otcontainer = otservice.getEntityContainer(DefaultContainer.class);
|
||||
assertNotNull(otcontainer);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void checkOpenTypeEntityTypesExist() {
|
||||
assertTrue(otcontainer.getRow().newRow().getClass().getInterfaces()[0].
|
||||
assertTrue(otservice.newEntity(Row.class).getClass().getInterfaces()[0].
|
||||
getAnnotation(EntityType.class).openType());
|
||||
assertTrue(otcontainer.getRowIndex().newRowIndex().getClass().getInterfaces()[0].
|
||||
assertTrue(otservice.newEntity(RowIndex.class).getClass().getInterfaces()[0].
|
||||
getAnnotation(EntityType.class).openType());
|
||||
assertTrue(otcontainer.getRow().newIndexedRow().getClass().getInterfaces()[0].
|
||||
assertTrue(otservice.newEntity(IndexedRow.class).getClass().getInterfaces()[0].
|
||||
getAnnotation(EntityType.class).openType());
|
||||
otcontainerFactory.getContext().detachAll();
|
||||
otservice.getContext().detachAll();
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -83,7 +85,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||
public void cud() throws ParseException {
|
||||
final Integer id = 1426;
|
||||
|
||||
RowIndex rowIndex = otcontainer.getRowIndex().newRowIndex();
|
||||
RowIndex rowIndex = otservice.newEntity(RowIndex.class);
|
||||
rowIndex.setId(id);
|
||||
rowIndex.addAdditionalProperty("aString", "string");
|
||||
rowIndex.addAdditionalProperty("aBoolean", true);
|
||||
@ -91,7 +93,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||
rowIndex.addAdditionalProperty("aByte", Byte.MAX_VALUE);
|
||||
rowIndex.addAdditionalProperty("aDate", Calendar.getInstance());
|
||||
|
||||
final ContactDetails contact = otcontainer.complexFactory().newContactDetails();
|
||||
final ContactDetails contact = otservice.newComplex(ContactDetails.class);
|
||||
contact.setFirstContacted("text".getBytes());
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
@ -115,6 +117,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||
contact.setInt(Integer.MAX_VALUE);
|
||||
rowIndex.addAdditionalProperty("aContact", contact);
|
||||
|
||||
otcontainer.getRowIndex().add(rowIndex);
|
||||
otcontainer.flush();
|
||||
|
||||
rowIndex = otcontainer.getRowIndex().getByKey(id).load();
|
||||
@ -126,7 +129,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||
assertTrue(Timestamp.class.isAssignableFrom(rowIndex.getAdditionalProperty("aDate").getClass()));
|
||||
assertEquals(ContactDetails.class, rowIndex.getAdditionalProperty("aContact").getClass().getInterfaces()[0]);
|
||||
|
||||
otcontainerFactory.getContext().detachAll();
|
||||
otservice.getContext().detachAll();
|
||||
|
||||
otcontainer.getRowIndex().delete(id);
|
||||
otcontainer.flush();
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
import org.apache.olingo.client.api.v3.EdmEnabledODataClient;
|
||||
|
@ -1,21 +1,22 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3;
|
||||
|
||||
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Driver;
|
||||
|
@ -19,16 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "AllGeoCollectionTypesSet")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "AllGeoCollectionTypesSet", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface AllGeoCollectionTypesSet
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypesCollection, AllGeoCollectionTypesSet>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypesCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes newAllSpatialCollectionTypes();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypesCollection newAllSpatialCollectionTypesCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_Simple newAllSpatialCollectionTypes_Simple();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_SimpleCollection newAllSpatialCollectionTypes_SimpleCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "AllGeoTypesSet")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "AllGeoTypesSet", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface AllGeoTypesSet
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypesCollection, AllGeoTypesSet>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypesCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes newAllSpatialTypes();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypesCollection newAllSpatialTypesCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Car")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Car", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Car
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CarCollection, Car>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CarCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car newCar();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CarCollection newCarCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Computer")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Computer", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Computer
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Computer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerCollection, Computer>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Computer, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Computer newComputer();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerCollection newComputerCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ComputerDetail")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ComputerDetail", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface ComputerDetail
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetail, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetailCollection, ComputerDetail>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetail, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetailCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetail newComputerDetail();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComputerDetailCollection newComputerDetailCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Customer")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Customer", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Customer
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Customer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerCollection, Customer>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Customer, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Customer newCustomer();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerCollection newCustomerCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "CustomerInfo")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "CustomerInfo", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface CustomerInfo
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfo, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfoCollection, CustomerInfo>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfo, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfoCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfo newCustomerInfo();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CustomerInfoCollection newCustomerInfoCollection();
|
||||
}
|
||||
|
@ -19,8 +19,10 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.OperationType;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.PersistenceManager;
|
||||
import org.apache.olingo.ext.proxy.api.OperationType;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntityContainer(name = "DefaultContainer",
|
||||
@ -95,38 +97,5 @@ public interface DefaultContainer extends PersistenceManager {
|
||||
java.lang.Integer retrieveProduct(
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
ComplexFactory complexFactory();
|
||||
|
||||
interface ComplexFactory {
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "ContactDetails",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ContactDetails newContactDetails();
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "Aliases",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Aliases newAliases();
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "Phone",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Phone")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Phone newPhone();
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "AuditInfo",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AuditInfo newAuditInfo();
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "ConcurrencyInfo",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newConcurrencyInfo();
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "Dimensions",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Dimensions newDimensions();
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "ComplexToCategory",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexToCategory")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ComplexToCategory newComplexToCategory();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Driver")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Driver", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Driver
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Driver, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.DriverCollection, Driver>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Driver, java.lang.String, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.DriverCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Driver newDriver();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.DriverCollection newDriverCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "LastLogin")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "LastLogin", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface LastLogin
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LastLogin, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LastLoginCollection, LastLogin>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LastLogin, java.lang.String, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LastLoginCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LastLogin newLastLogin();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LastLoginCollection newLastLoginCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "License")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "License", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface License
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.License, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LicenseCollection, License>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.License, java.lang.String, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LicenseCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.License newLicense();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LicenseCollection newLicenseCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Login")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Login", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Login
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Login, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LoginCollection, Login>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Login, java.lang.String, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LoginCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Login newLogin();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.LoginCollection newLoginCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "MappedEntityType")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "MappedEntityType", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface MappedEntityType
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityType, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityTypeCollection, MappedEntityType>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityType, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityTypeCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityType newMappedEntityType();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MappedEntityTypeCollection newMappedEntityTypeCollection();
|
||||
}
|
||||
|
@ -19,16 +19,15 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.MessageKey;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.*;
|
||||
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Message")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Message", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Message
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Message, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageCollection, Message>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Message, MessageKey, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Message newMessage();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageCollection newMessageCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "MessageAttachment")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "MessageAttachment", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface MessageAttachment
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachment, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachmentCollection, MessageAttachment>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachment, java.util.UUID, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachmentCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachment newMessageAttachment();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.MessageAttachmentCollection newMessageAttachmentCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Order")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Order", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Order
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Order, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderCollection, Order>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Order, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Order newOrder();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderCollection newOrderCollection();
|
||||
}
|
||||
|
@ -19,20 +19,15 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.OrderLineKey;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.*;
|
||||
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "OrderLine")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "OrderLine", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface OrderLine
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLineCollection, OrderLine>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine, OrderLineKey, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLineCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine newOrderLine();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLineCollection newOrderLineCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine newBackOrderLine();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLineCollection newBackOrderLineCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2 newBackOrderLine2();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2Collection newBackOrderLine2Collection();
|
||||
}
|
||||
|
@ -19,16 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "PageView")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "PageView", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface PageView
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PageView, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PageViewCollection, PageView>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PageView, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PageViewCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PageView newPageView();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PageViewCollection newPageViewCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPageView newProductPageView();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPageViewCollection newProductPageViewCollection();
|
||||
}
|
||||
|
@ -19,20 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Person")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Person", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Person
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Person, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonCollection, Person>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Person, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Person newPerson();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonCollection newPersonCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Contractor newContractor();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ContractorCollection newContractorCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Employee newEmployee();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.EmployeeCollection newEmployeeCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.SpecialEmployee newSpecialEmployee();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.SpecialEmployeeCollection newSpecialEmployeeCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "PersonMetadata")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "PersonMetadata", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface PersonMetadata
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadata, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadataCollection, PersonMetadata>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadata, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadataCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadata newPersonMetadata();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.PersonMetadataCollection newPersonMetadataCollection();
|
||||
}
|
||||
|
@ -19,16 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Product")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "Product", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface Product
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Product, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductCollection, Product>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Product, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Product newProduct();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductCollection newProductCollection();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.DiscontinuedProduct newDiscontinuedProduct();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.DiscontinuedProductCollection newDiscontinuedProductCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ProductDetail")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ProductDetail", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface ProductDetail
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetail, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetailCollection, ProductDetail>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetail, java.lang.Integer, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetailCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetail newProductDetail();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductDetailCollection newProductDetailCollection();
|
||||
}
|
||||
|
@ -19,16 +19,15 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ProductPhotoKey;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.*;
|
||||
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ProductPhoto")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ProductPhoto", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface ProductPhoto
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhoto, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhotoCollection, ProductPhoto>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhoto, ProductPhotoKey, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhotoCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhoto newProductPhoto();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductPhotoCollection newProductPhotoCollection();
|
||||
}
|
||||
|
@ -19,16 +19,15 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types
|
||||
.ProductReviewKey;
|
||||
import org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.*;
|
||||
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ProductReview")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "ProductReview", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface ProductReview
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductReview, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductReviewCollection, ProductReview>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductReview, ProductReviewKey, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductReviewCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductReview newProductReview();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ProductReviewCollection newProductReviewCollection();
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "RSAToken")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.EntitySet(name = "RSAToken", container = "Microsoft.Test.OData.Services.AstoriaDefaultService.DefaultContainer")
|
||||
public interface RSAToken
|
||||
extends org.apache.olingo.ext.proxy.api.EntitySetQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.RSAToken, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.RSATokenCollection, RSAToken>, AbstractEntitySet<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.RSAToken, java.lang.String, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.RSATokenCollection> {
|
||||
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.RSAToken newRSAToken();
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.RSATokenCollection newRSATokenCollection();
|
||||
}
|
||||
|
@ -19,10 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.ComplexType(name = "Aliases")
|
||||
public interface Aliases
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.SingleQuery<Aliases> {
|
||||
extends org.apache.olingo.ext.proxy.api.ComplexType,org.apache.olingo.ext.proxy.api.SingleQuery<Aliases> {
|
||||
|
||||
|
||||
|
||||
@ -32,9 +35,4 @@ public interface Aliases
|
||||
void setAlternativeNames(java.util.Collection<java.lang.String> _alternativeNames);
|
||||
|
||||
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory {
|
||||
}
|
||||
}
|
||||
|
@ -18,10 +18,11 @@
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@ -30,7 +31,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
hasStream = false,
|
||||
isAbstract = true)
|
||||
public interface AllSpatialCollectionTypes
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.ext.proxy.api.SingleQuery<AllSpatialCollectionTypes> {
|
||||
extends org.apache.olingo.ext.proxy.api.EntityType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.ext.proxy.api.SingleQuery<AllSpatialCollectionTypes> {
|
||||
|
||||
|
||||
|
||||
@ -61,11 +62,6 @@ public interface AllSpatialCollectionTypes
|
||||
|
||||
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory {
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations {
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
|
||||
import java.util.Collection;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
public interface AllSpatialCollectionTypesCollection extends
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypesCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypesCollection>, AbstractEntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes> {
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypesCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypesCollection>, org.apache.olingo.ext.proxy.api.EntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes> {
|
||||
|
||||
Object getAnnotation(Class<? extends AbstractTerm> term);
|
||||
|
||||
|
@ -18,10 +18,11 @@
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@ -31,7 +32,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
isAbstract = false,
|
||||
baseType = "Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes")
|
||||
public interface AllSpatialCollectionTypes_Simple
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes {
|
||||
extends org.apache.olingo.ext.proxy.api.EntityType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes {
|
||||
|
||||
@Override
|
||||
AllSpatialCollectionTypes_Simple load();
|
||||
@ -202,11 +203,6 @@ public interface AllSpatialCollectionTypes_Simple
|
||||
|
||||
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory extends org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes.ComplexFactory{
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations extends org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes.Annotations{
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
|
||||
import java.util.Collection;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
public interface AllSpatialCollectionTypes_SimpleCollection extends
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_Simple, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_SimpleCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_SimpleCollection>, AbstractEntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_Simple> {
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_Simple, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_SimpleCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_SimpleCollection>, org.apache.olingo.ext.proxy.api.EntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialCollectionTypes_Simple> {
|
||||
|
||||
Object getAnnotation(Class<? extends AbstractTerm> term);
|
||||
|
||||
|
@ -18,10 +18,11 @@
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@ -30,7 +31,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
hasStream = false,
|
||||
isAbstract = false)
|
||||
public interface AllSpatialTypes
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.ext.proxy.api.SingleQuery<AllSpatialTypes> {
|
||||
extends org.apache.olingo.ext.proxy.api.EntityType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.ext.proxy.api.SingleQuery<AllSpatialTypes> {
|
||||
|
||||
|
||||
|
||||
@ -429,11 +430,6 @@ public interface AllSpatialTypes
|
||||
|
||||
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory {
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations {
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
|
||||
import java.util.Collection;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
public interface AllSpatialTypesCollection extends
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypesCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypesCollection>, AbstractEntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes> {
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypesCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypesCollection>, org.apache.olingo.ext.proxy.api.EntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.AllSpatialTypes> {
|
||||
|
||||
Object getAnnotation(Class<? extends AbstractTerm> term);
|
||||
|
||||
|
@ -19,10 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.ComplexType(name = "AuditInfo")
|
||||
public interface AuditInfo
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.SingleQuery<AuditInfo> {
|
||||
extends org.apache.olingo.ext.proxy.api.ComplexType,org.apache.olingo.ext.proxy.api.SingleQuery<AuditInfo> {
|
||||
|
||||
|
||||
|
||||
@ -46,13 +49,4 @@ public interface AuditInfo
|
||||
void setConcurrency(org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo _concurrency);
|
||||
|
||||
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory {
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Property(name = "Concurrency",
|
||||
type = "Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo")
|
||||
org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.ConcurrencyInfo newConcurrency();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,11 +18,12 @@
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.KeyRef;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
@KeyRef(OrderLineKey.class)
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@ -32,7 +33,7 @@ import org.apache.olingo.ext.proxy.api.annotations.KeyRef;
|
||||
isAbstract = false,
|
||||
baseType = "Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine")
|
||||
public interface BackOrderLine
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine {
|
||||
extends org.apache.olingo.ext.proxy.api.EntityType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine {
|
||||
|
||||
@Override
|
||||
BackOrderLine load();
|
||||
@ -183,11 +184,6 @@ public interface BackOrderLine
|
||||
|
||||
}
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory extends org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine.ComplexFactory{
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations extends org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.OrderLine.Annotations{
|
||||
|
@ -18,11 +18,12 @@
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
import org.apache.olingo.ext.proxy.api.annotations.KeyRef;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
@KeyRef(OrderLineKey.class)
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@ -32,7 +33,7 @@ import org.apache.olingo.ext.proxy.api.annotations.KeyRef;
|
||||
isAbstract = false,
|
||||
baseType = "Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine")
|
||||
public interface BackOrderLine2
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine {
|
||||
extends org.apache.olingo.ext.proxy.api.EntityType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine {
|
||||
|
||||
@Override
|
||||
BackOrderLine2 load();
|
||||
@ -183,11 +184,6 @@ public interface BackOrderLine2
|
||||
|
||||
}
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory extends org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine.ComplexFactory{
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations extends org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine.Annotations{
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
|
||||
import java.util.Collection;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
public interface BackOrderLine2Collection extends
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2Collection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2Collection>, AbstractEntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2> {
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2Collection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2Collection>, org.apache.olingo.ext.proxy.api.EntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine2> {
|
||||
|
||||
Object getAnnotation(Class<? extends AbstractTerm> term);
|
||||
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
|
||||
import java.util.Collection;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
public interface BackOrderLineCollection extends
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLineCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLineCollection>, AbstractEntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine> {
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLineCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLineCollection>, org.apache.olingo.ext.proxy.api.EntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.BackOrderLine> {
|
||||
|
||||
Object getAnnotation(Class<? extends AbstractTerm> term);
|
||||
|
||||
|
@ -18,10 +18,11 @@
|
||||
*/
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
|
||||
import org.apache.olingo.client.api.edm.ConcurrencyMode;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@ -30,7 +31,7 @@ import org.apache.olingo.ext.proxy.api.annotations.Key;
|
||||
hasStream = true,
|
||||
isAbstract = false)
|
||||
public interface Car
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.ext.proxy.api.SingleQuery<Car> {
|
||||
extends org.apache.olingo.ext.proxy.api.EntityType,org.apache.olingo.ext.proxy.api.Annotatable,org.apache.olingo.ext.proxy.api.SingleQuery<Car> {
|
||||
|
||||
|
||||
|
||||
@ -133,11 +134,6 @@ public interface Car
|
||||
java.io.InputStream getStream();
|
||||
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory {
|
||||
}
|
||||
|
||||
Annotations annotations();
|
||||
|
||||
interface Annotations {
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
import org.apache.olingo.ext.proxy.api.AbstractEntityCollection;
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
import org.apache.olingo.ext.proxy.api.AbstractTerm;
|
||||
|
||||
import java.util.Collection;
|
||||
//CHECKSTYLE:ON (Maven checkstyle)
|
||||
|
||||
|
||||
public interface CarCollection extends
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CarCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CarCollection>, AbstractEntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car> {
|
||||
org.apache.olingo.ext.proxy.api.EntityCollectionQuery<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CarCollection, org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.CarCollection>, org.apache.olingo.ext.proxy.api.EntityCollection<org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types.Car> {
|
||||
|
||||
Object getAnnotation(Class<? extends AbstractTerm> term);
|
||||
|
||||
|
@ -19,10 +19,13 @@
|
||||
|
||||
package org.apache.olingo.fit.proxy.v3.actionoverloading.microsoft.test.odata.services.astoriadefaultservice.types;
|
||||
|
||||
//CHECKSTYLE:OFF (Maven checkstyle)
|
||||
|
||||
|
||||
@org.apache.olingo.ext.proxy.api.annotations.Namespace("Microsoft.Test.OData.Services.AstoriaDefaultService")
|
||||
@org.apache.olingo.ext.proxy.api.annotations.ComplexType(name = "ComplexToCategory")
|
||||
public interface ComplexToCategory
|
||||
extends org.apache.olingo.ext.proxy.api.StructuredType,org.apache.olingo.ext.proxy.api.SingleQuery<ComplexToCategory> {
|
||||
extends org.apache.olingo.ext.proxy.api.ComplexType,org.apache.olingo.ext.proxy.api.SingleQuery<ComplexToCategory> {
|
||||
|
||||
|
||||
|
||||
@ -46,9 +49,4 @@ public interface ComplexToCategory
|
||||
void setLabel(java.lang.String _label);
|
||||
|
||||
|
||||
|
||||
ComplexFactory factory();
|
||||
|
||||
interface ComplexFactory {
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user