@Test @Cassandra public void testDaoFactoryListener() { DefaultPojoDaoFactory factory = new DefaultPojoDaoFactoryBuilder(getSession()).withListener(listener).build(); PojoDao<ListenerEntity> expected = factory.createPojoDao(ListenerEntity.class); verify(listener).pojoDaoCreated(eventCaptor.capture()); PojoDaoFactoryEvent<ListenerEntity> event = eventCaptor.getValue(); assertEquals("listener_entity", event.getTableName()); assertEquals(expected, event.getPojoDao()); assertEquals(ListenerEntity.class, event.getPojoBinding().getPojoType()); }
@Override public <P> PojoDao<P> createPojoDao(Class<P> pojoType) { return createPojoDao(pojoType, namingStrategy.getTableName(pojoType)); }
DefaultPojoDaoFactory implements PojoDaoFactory { @Override public <P> PojoDao<P> createPojoDao(Class<P> pojoType) { return createPojoDao(pojoType, namingStrategy.getTableName(pojoType)); } }
DefaultPojoDaoFactory implements PojoDaoFactory { @Override public <P> PojoDao<P> createPojoDao(Class<P> pojoType) { return createPojoDao(pojoType, namingStrategy.getTableName(pojoType)); } DefaultPojoDaoFactory(Session session, PojoBindingFactory bindingFactory, PojoStatementFactory statementFactory, PojoQueryContextFactory contextFactory, NamingStrategy namingStrategy, Executor executor); }
DefaultPojoDaoFactory implements PojoDaoFactory { @Override public <P> PojoDao<P> createPojoDao(Class<P> pojoType) { return createPojoDao(pojoType, namingStrategy.getTableName(pojoType)); } DefaultPojoDaoFactory(Session session, PojoBindingFactory bindingFactory, PojoStatementFactory statementFactory, PojoQueryContextFactory contextFactory, NamingStrategy namingStrategy, Executor executor); @Override DefaultPojoDaoFactory addListener(PojoDaoFactoryListener listener); @Override PojoDao<P> createPojoDao(Class<P> pojoType); @Override @SuppressWarnings("unchecked") PojoDao<P> createPojoDao(Class<P> pojoType, String tableName); }
DefaultPojoDaoFactory implements PojoDaoFactory { @Override public <P> PojoDao<P> createPojoDao(Class<P> pojoType) { return createPojoDao(pojoType, namingStrategy.getTableName(pojoType)); } DefaultPojoDaoFactory(Session session, PojoBindingFactory bindingFactory, PojoStatementFactory statementFactory, PojoQueryContextFactory contextFactory, NamingStrategy namingStrategy, Executor executor); @Override DefaultPojoDaoFactory addListener(PojoDaoFactoryListener listener); @Override PojoDao<P> createPojoDao(Class<P> pojoType); @Override @SuppressWarnings("unchecked") PojoDao<P> createPojoDao(Class<P> pojoType, String tableName); static final int DEFAULT_THREAD_POOL_SIZE; }