In a JBoss EJB3 environment I've never found a way to access the hibernate
Configuration object or the metadata it contains e.g. PersistentClass.
To my knowledge, this is available at startup time only, and JBoss doesn't
provide any access to it.
After initialization (at runtime),
Hi Fiorenzo,
You can get a list of entity classes from an EntityManager. Then add code to
scan the @NamedQuery and @NamedQueries({ ... }) annotations on those classes
and make a list of NamedQuery names.
Like this:
| // Get all entity classes
| org.hibernate.SessionFactory sf =
Hi Ilavenil,
If you only have one Persistence Unit, you can get a list of entity classes
this way:
| // Get all entity classes
| org.hibernate.SessionFactory sf = ((org.jboss.ejb3.entity.HibernateSession)
em).getHibernateSession().getSessionFactory();
| Map?,? allClassMetadata =
That works.
Thanks so much, jaikiran! :)
So the problem is that:..
| NamingEnumerationBinding list = ctx.listBindings(persistence-units);
| while (list.hasMore()) {
| Binding nc = (Binding)list.next();
| Object o = nc.getObject();
| ...
|
... does not return the same
Hi,
When looking up EntityManager, EntityManagerFactory or SessionFactory objects
in JNDI I'm getting back instances of javax.naming.Reference instead of the
correct objects.
According to specifications, forum posts and examples I should be able to
access these container-managed objects via
Hi,
I have an application framework which scans the EAR it is contained in for EJB3
entity bean classes and persistence units, to auto-detect them, in order to
provide access to data through a facade SLSB.
I need to obtain the following programmatically:
1. A list of all Persistence Units
2. A
I have to access a legacy application. I have read-only access to it's database
(Sybase ASE 12.5).
I want to access some of it's tables through Entity Beans in a transparent
fashion from a session bean facade (Hibernate Shards style, where a lower ID
range goes transparently to the legacy DB).
I have managed to fix this by adding the following to persistence.xml on the
persistence unit:
| classorg.debtbase.server.entitybeans.LegacyObject/class
| exclude-unlisted-classestrue/exclude-unlisted-classes
|
The ID generator does not seem to be created now. The exception has
cgriffith,
All my business beans do implement common methods as you describe.
InterfaceDef getIntfDef();
FunctionDef[] getFunctionDefs();
These methods inspect access and different types of functionality offered by
the session bean that only the bean knows about and return the full set of
How do I find out which methods can be called on a session bean by a user from
inside a bean method?
My fat client application enables and disables menu items and functionality on
the client depending on whether the user has access to the methods needed for
those actions.
On the session bean
j2ee_junkie,
Thanks for your input.
I trivialised my use case as enabling/disabling menu items for the sake of
forum post.
My client is not so much a fat client as an automatic user interface which
exposes business methods directly to the user. It generates forms and offers
functionality
How do I find out programmatically which other methods can be called on a
session bean by an authenticated user from in a bean method?
From a client I'm trying to query what methods the user can call on the
session bean, in order to enable and disable menu items and functionality as
How do I set the default mapping of entity bean fields of type String to
VARCHAR or TEXT instead of VARCHAR(255) on PostgreSQL and MySQL databases?
I do not want an arbitrary 255 char limit to the length of a varchar string.
I read a post which suggested using an annotation to set the @Length to
I have this same problem and it's frustrating.
On redeploy of a @Service mbean, I get:
javax.ejb.EJBAccessException: Authentication failure
at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.handleGeneralSecurityException(Ejb3AuthenticationInterceptor.java:68)
at
14 matches
Mail list logo