Changeset 3609
- Timestamp:
- 11/02/08 15:05:31 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/java/org/sarugo/restlet/jpa/EntityFinder.java
r3607 r3609 5 5 6 6 import org.restlet.Finder; 7 import org.restlet.Handler;8 7 import org.restlet.Route; 9 8 import org.restlet.data.Request; … … 109 108 */ 110 109 @Override 111 protected HandlerfindTarget(Request request, Response response) {110 protected EntityResource findTarget(Request request, Response response) { 112 111 EntityResource resource = initResource(); 113 112 if (resource != null) { trunk/src/main/java/org/sarugo/restlet/jpa/EntityInstanceFinder.java
r3607 r3609 218 218 } 219 219 220 /** Gets the parent resource for the given request. */ 221 public EntityInstance getParentResource(Request request, Response response) { 222 return (EntityInstance) getParent().findTarget(request, response); 223 } 224 220 225 /** 221 226 * Passes the request to children if possible or handles directly if no trunk/src/test/java/org/sarugo/restlet/jpa/URLMappingTests.java
r3606 r3609 58 58 59 59 public void testGetEntity() { 60 FooEntity found = (FooEntity) router.getEntity("/foo/" + foo.id); 61 assertEquals(foo.id, found.id); 60 FooEntity foundFoo = (FooEntity) router.getEntity("/foo/" + foo.id); 61 assertEquals(foo.id, foundFoo.id); 62 foundFoo = (FooEntity) router.getEntity("/foo/" + foo.id + 120485); 63 assertNull(foundFoo); 64 foundFoo = (FooEntity) router.getEntity("/fool/" + foo.id); 65 assertNull(foundFoo); 62 66 BarEntity foundBar = (BarEntity) router.getEntity("/foo/" + foo.id 63 67 + "/bar/" + bar.id);
