Skip to content

Instantly share code, notes, and snippets.

@debop
Created July 6, 2013 14:41
Show Gist options
  • Select an option

  • Save debop/5940112 to your computer and use it in GitHub Desktop.

Select an option

Save debop/5940112 to your computer and use it in GitHub Desktop.
@Slf4j
@Service
@SuppressWarnings("unchecked")
public class SimpleEntityServiceImpl implements SimpleEntityService {
@Autowired SessionFactory sessionFactory;
@Transactional( readOnly = true )
@ReadOnlyConnection
@Override
public List<SimpleEntity> findAll() {
Session session = sessionFactory.getCurrentSession();
return (List<SimpleEntity>)session.createCriteria(SimpleEntity.class).list();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment