Configuration configuration = new Configuration().configure();
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
.applySettings(configuration.getProperties()).build();
SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
SessionFactory sf = new Configuration().configure().buildSessionFactory();
private View createLayoutParams(View targetView) {
StaggeredGridLayoutManager.LayoutParams params;
params = new StaggeredGridLayoutManager.LayoutParams(StaggeredGridLayoutManager.LayoutParams.MATCH_PARENT, StaggeredGridLayoutManager.LayoutParams.WRAP_CONTENT);
params.setFullSpan(true);
targetView.setLayoutParams(params);
return targetView;
}