[jboss-user] [JBoss AOP] - Re: Does any one know how to intercept the injection in JBos
kabir.khan@jboss.com
do-not-reply at jboss.com
Wed May 30 16:05:46 EDT 2007
"waynebaylor" wrote : You can use a String variable as long as it's labeled final.
|
| For Example:
|
| | public class MyClass
| | {
| | private final String persistence_unit_name = MyNameFinder.getName();
| |
| | @PersistenceContext(unitName=persistence_unit_name)
| | EntityManager em;
| |
| | ...
| | }
| |
|
| Where MyNameFinder.getName() is a static method that retreives the name from a file (or however you want to do it).
Actually, that is not possible since the value of the unitName annotation gets put into the bytecode. Out of curiosity I tried what you suggested, but it does not compile
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049889#4049889
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049889
More information about the jboss-user
mailing list