Package org.eclipse.persistence.internal.jpa.rs.metadata.model

Examples of org.eclipse.persistence.internal.jpa.rs.metadata.model.ItemLinks


     * @see org.eclipse.persistence.jpa.rs.features.FeatureResponseBuilderImpl#buildSingleEntityResponse(org.eclipse.persistence.jpa.rs.PersistenceContext, java.util.Map, java.lang.Object, javax.ws.rs.core.UriInfo)
     */
    @Override
    public Object buildSingleEntityResponse(PersistenceContext context, Map<String, Object> queryParams, Object result, UriInfo uriInfo) {
        if (result instanceof PersistenceWeavedRest) {
            ItemLinks itemLinks = new ItemLinks();
            ClassDescriptor descriptor = context.getJAXBDescriptorForClass(result.getClass());
            PersistenceWeavedRest entity = (PersistenceWeavedRest) result;
            String href = HrefHelper.buildEntityHref(context, descriptor.getAlias(), IdHelper.stringifyId(result, descriptor.getAlias(), context));
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_SELF, href));
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_CANONICAL, href));
            entity._persistence_setLinks(itemLinks);
        }
        return result;
    }
View Full Code Here


        return response;
    }

    private Object populateReadAllQueryResultListItemLinks(PersistenceContext context, Object result) {
        // populate links for the entity
        ItemLinks itemLinks = new ItemLinks();
        ClassDescriptor descriptor = context.getJAXBDescriptorForClass(result.getClass());
        if ((result instanceof PersistenceWeavedRest) && (descriptor != null) && (context != null)) {
            PersistenceWeavedRest entity = (PersistenceWeavedRest) result;
            String href = HrefHelper.buildEntityHref(context, descriptor.getAlias(), IdHelper.stringifyId(result, descriptor.getAlias(), context));
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_SELF, href));
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_CANONICAL, href));
            entity._persistence_setLinks(itemLinks);
            return entity;
        }
        return result;
    }
View Full Code Here

    private Object populatePagedReadAllQueryItemLinks(PersistenceContext context, Object result) {
        // populate links for the entity
        ClassDescriptor descriptor = context.getJAXBDescriptorForClass(result.getClass());
        if ((result instanceof PersistenceWeavedRest) && (descriptor != null) && (context != null)) {
            ItemLinks itemLinks = new ItemLinks();
            PersistenceWeavedRest entity = (PersistenceWeavedRest) result;
            String href = HrefHelper.buildEntityHref(context, descriptor.getAlias(), IdHelper.stringifyId(result, descriptor.getAlias(), context));
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_SELF, href));
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_CANONICAL, href));
            entity._persistence_setLinks(itemLinks);
            return entity;
        }
        return result;
    }
View Full Code Here

     * @see org.eclipse.persistence.jpa.rs.features.FeatureResponseBuilderImpl#buildSingleEntityResponse(org.eclipse.persistence.jpa.rs.PersistenceContext, java.util.Map, java.lang.Object, javax.ws.rs.core.UriInfo)
     */
    @Override
    public Object buildSingleEntityResponse(PersistenceContext context, Map<String, Object> queryParams, Object result, UriInfo uriInfo) {
        if (result instanceof PersistenceWeavedRest) {
            ItemLinks itemLinks = new ItemLinks();
            ClassDescriptor descriptor = context.getJAXBDescriptorForClass(result.getClass());
            PersistenceWeavedRest entity = (PersistenceWeavedRest) result;
            String href = context.getBaseURI() + context.getVersion() + "/" + context.getName() + "/entity/" + descriptor.getAlias() + "/" + IdHelper.stringifyId(result, descriptor.getAlias(), context);
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_SELF, href));
            entity._persistence_setLinks(itemLinks);
        }
        return result;
    }
View Full Code Here

        return response;
    }

    private Object populateReadAllQueryResultListItemLinks(PersistenceContext context, Object result) {
        // populate links for the entity
        ItemLinks itemLinks = new ItemLinks();
        ClassDescriptor descriptor = context.getJAXBDescriptorForClass(result.getClass());
        if ((result instanceof PersistenceWeavedRest) && (descriptor != null) && (context != null)) {
            PersistenceWeavedRest entity = (PersistenceWeavedRest) result;
            String entityId = IdHelper.stringifyId(result, descriptor.getAlias(), context);
            String href = context.getBaseURI() + context.getVersion() + "/" + context.getName() + "/entity/" + descriptor.getAlias() + "/" + entityId;
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_SELF, href));
            entity._persistence_setLinks(itemLinks);
            return entity;
        }
        return result;
    }
View Full Code Here

    private Object populatePagedReadAllQueryItemLinks(PersistenceContext context, Object result) {
        // populate links for the entity
        ClassDescriptor descriptor = context.getJAXBDescriptorForClass(result.getClass());
        if ((result instanceof PersistenceWeavedRest) && (descriptor != null) && (context != null)) {
            ItemLinks itemLinks = new ItemLinks();
            PersistenceWeavedRest entity = (PersistenceWeavedRest) result;
            String entityId = IdHelper.stringifyId(result, descriptor.getAlias(), context);
            String href = context.getBaseURI() + context.getVersion() + "/" + context.getName() + "/entity/" + descriptor.getAlias() + "/" + entityId;
            itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_SELF, href));
            entity._persistence_setLinks(itemLinks);
            return entity;
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.jpa.rs.metadata.model.ItemLinks

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