apigee/usergrid-stack — pull request #22 by realbeast (2012-10-09 08:18:41+00:00)
Title: Mismatch service and custom entity(different package name)

We try to add service, custom entity(push).

example, below this.

1. source files
- org.usergrid.rest.applications.pushes.PushesResource
- org.usergrid.services.PushesService
- io.baas.entities.Push ( extends TypedEntity ) : different package name

2. Call pushes collection
- GET http://localhost:8080/test-organization/test-app/pushes

3. Resource call Service
- Service service = sm.getService("push");
- attempting to instantiate service class
Service : PushesService

4. PushesService get entity
- register entity schema : Schema.getDefaultSchema().registerEntity( io.baas.entities.Push.class );
- Schema.getEntityType, Schema.getEntityClass method is finding by package prefix. so, not found entity.

Schema.getEntityType method is returning full class name, not "push". also, Schema.getEntityClass method is mismatching entity.

I try to add method. ( Schema.scanEntities(), Schema.addEntitiesPackage, Schema.removeEntitiesPackage, Schema.getEntitiesPackage )

Using that method, It works. so I send a pull request.