#107 - Polishing.

Switched to Asciidoc for README. Renamed ApplicationConfiguration to Application. Switched to a more simple package name. Some polishing in the test cases (removed unnecessary injections).

Original pull request: #108.
This commit is contained in:
Oliver Gierke
2015-07-16 08:20:53 +02:00
parent d95ed268b2
commit 8d77a9a37e
7 changed files with 27 additions and 41 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.people;
package example.people;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@@ -28,12 +28,8 @@ import org.springframework.security.data.repository.query.SecurityEvaluationCont
* @author Thomas Darimont
*/
@SpringBootApplication
class ApplicationConfiguration {
class Application {
public @Bean LoggingEventListener mongoEventListener() {
return new LoggingEventListener();
}
@Bean
public EvaluationContextExtension securityExtension() {
return new SecurityEvaluationContextExtension();

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.people;
package example.people;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@@ -21,7 +21,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.data.annotation.Id;
/**
* An entity to represent a Person.
* An entity to represent a {@link Person}.
*
* @author Thomas Darimont
*/

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package example.springdata.mongodb.people;
package example.people;
import java.util.List;
@@ -25,9 +25,7 @@ import org.springframework.data.repository.CrudRepository;
*
* @author Thomas Darimont
*/
public interface PersonRepository extends CrudRepository<Person, String> {
List<Person> findAll();
interface PersonRepository extends CrudRepository<Person, String> {
@Query("{id: ?#{ hasRole('ROLE_ADMIN') ? {$exists:true} : principal.id}}")
List<Person> findAllForCurrentUserById();