@Override public final void run(T configuration, Environment environment) throws Exception { GuiceSupport.Builder<T> guiceBuilder = GuiceSupport.newBuilder(); configure(configuration, guiceBuilder); @SuppressWarnings("unchecked") Class<T> configurationClass = (Class<T>) Generics.getTypeParameter(this.getClass()); //this will initialize any registered bundles guiceBuilder.addModule(new GuiceBootstrapModule()); GuiceSupport<T> guiceBundle = guiceBuilder .setConfigClass(configurationClass) .build(); guiceBundle.run(configuration, environment); //intialize the injector guiceBundle.getInjector(); }
public BaseDao(SessionFactory sessionFactory) { super(sessionFactory); clazz = Generics.getTypeParameter(this.getClass()); }
public List<T> findAll() { Class<?> clazz = Generics.getTypeParameter(this.getClass()); return list(namedQuery(clazz.getName() + FIND_ALL)); }
public List<T> findAllByCriteria(Criteria criteria) { Class<?> clazz = Generics.getTypeParameter(this.getClass()); Field[] fields = clazz.getDeclaredFields(); Arrays.asList(fields).forEach((it) -> System.err.println(it.getName())); return null; }
public CommonJpaDao(final SessionFactory sessionFactory) { super(sessionFactory); entityClass = Generics.getTypeParameter(getClass()); }
@Override public final void initialize(Bootstrap<?> bootstrap) { final Class<T> klass = Generics.getTypeParameter(getClass(), Configuration.class); bootstrap.addCommand(new CouchbaseTestCommand("cbtest", "Tests the connection to Couchbase.", this, klass)); bootstrap.addCommand(new CouchbaseInitCommand("cbinit", "Syncs all design documents with Couchbase.", this, klass)); }
@Override public final void initialize(final Bootstrap<?> bootstrap) { final Class<T> klass = Generics.getTypeParameter(getClass(), Configuration.class); bootstrap.addCommand(new DbCommand<T>(name(), this, this, klass)); }
/** * Specify the class that this exception logger can handle */ protected ExceptionLogger() { this.clazz = Generics.getTypeParameter(this.getClass(), Exception.class); }
@Override public final void initialize(Bootstrap<?> bootstrap) { final Class<T> klass = Generics.getTypeParameter(getClass(), Configuration.class); bootstrap.addCommand(new RoutingDbCommand<>(this, klass)); }