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), JBoss/Hiberna
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 = sf.getAllCl
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 = ((org.jbos
That works.
Thanks so much, jaikiran! :)
So the problem is that:..
| NamingEnumeration list = ctx.listBindings("persistence-units");
| while (list.hasMore()) {
| Binding nc = (Binding)list.next();
| Object o = nc.getObject();
| ...
|
... does not return the same object
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 JN
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 managed to fix this by adding the following to persistence.xml on the
persistence unit:
| org.debtbase.server.entitybeans.LegacyObject
| true
|
The ID generator does not seem to be created now. The exception has gone, and
the @Entity bean on this Persistence Unit works p
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).
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
meta
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 with
It is possible to do this by inspecting the bean's own annotations with code,
i.e. method @PermitAll, @RolesAllowed, and class defaults. This works.
IMHO It would be nice if there was a JBoss method that would allow such method
access checks though.
View the original post :
http://www.jboss.co
Rather than TEXT I meant I want to set the default to VARCHAR(unlimited length).
Is this possible?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963626#3963626
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963626
___
Your code does work as expected. Thanks for your help.
I was doing annotation.getClass() instead of annotation.annotationType() on the
server-side coupled with a bug on client-side which was not handling the
results properly. I had mislead myself that I could not access annotations
after seeing
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 t
I just hit this as well when I finally connected my entities to the live
database.
Argh! Good job I had a backup.
Can we change the default please?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962866#3962866
Reply to the post :
http://www.jboss.com/in
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
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
>appropri
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
org.jboss
18 matches
Mail list logo