I'm currently writing seam tests, running the Microcontainer. I need to access a
Hibernate MBean, from my test.
If I wasn't running the Microcontainer, I would write something like this:
try {
InitialContext ctx = new InitialContext();
SessionFactory sf = (SessionFactory)
ctx.lookup("java:/hibernate/FooSessionFactory");
Session hsess = sf.getCurrentSession();
Session dynaSess = hsess.getSession(EntityMode.MAP);
Query qry = dynaSess.createQuery("select foo from bar where
fooName=?");
qry.setParameter(0, new String("name"));
List result = qry.list();
return result;
How do I achieve this running the Microcontainer? How do I deploy the Hibernate service
(MBean) and how do I access it from the test?
Best regards, Fredrik
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993069#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...