Skip to content

Commit

Permalink
Added summary projection for Orders.
Browse files Browse the repository at this point in the history
Removed explicit dependency on Spring HATEOAS to pull in the version Spring Data REST requires. This is to make sure the collection rels get rendered correctly when the projection is applied to a collection resource.
  • Loading branch information
odrotbohm committed Feb 27, 2014
1 parent 7be06e2 commit e780f51
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<version>${sd.rest}</version>
</dependency>

<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>0.9.0.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2014 the original author or authors.
*
* Licensed 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
*
* 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 specific language governing permissions and
* limitations under the License.
*/
package org.springsource.restbucks.order.web;

import org.joda.time.DateTime;
import org.springframework.data.rest.core.config.Projection;
import org.springsource.restbucks.order.Order;
import org.springsource.restbucks.order.Order.Status;

/**
* Projection interface to render {@link Order} summaries.
*
* @author Oliver Gierke
*/
@Projection(name = "summary", types = Order.class)
public interface OrderProjection {

/**
* @see Order#getOrderedDate()
* @return
*/
DateTime getOrderedDate();

/**
* @see Order#getStatus()
* @return
*/
Status getStatus();
}

0 comments on commit e780f51

Please sign in to comment.