On Thu, 30 Aug 2012 19:15:11 -0300, Miguel O. Carvajal <tapes...@carvajalonline.com> wrote:

Hey all,

Hi!

I saw in the issue 2550 (https://issues.apache.org/jira/browse/TAPESTRY-2550) that ServiceBuilder was created exactly for this purpose, but since I have no way of determining the generic type (or other way of determining what Hibernate/JPA entity I am working with) within the ServiceBuilder implementation. I just don't see how this can be done with ServiceBuilder.

ServiceBuilder is an interface, so you should create at least one implementation for it. Pass the entity class in the constructor of your ServiceBuilder implementation. Something like this (not tested):

public class DaoBuilder implements DaoBuilder<Dao> {
        final private Class entityClass;
        public DaoBuilder(Class entityclass) {
                this.entityClass = entityClass;
        }
        Dao buildService(ServiceResources resources) {
                // use entityClass to create the Dao and return it.
        }
}

--
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to