[JBoss Seam] - Re: Seam Projects in Red Hat Developer Studio
by max.andersen@jboss.com
Currently the generated projects are using the seam-gen templates/dependencies and they are currently only targetting JBoss AS.
We haven't enabled seam project support for other appservers yet since there will be missing dependencies etc. for these servers.
We could remove the limitation in GA, so you would be allowed to create the projects against any server runtime - the downside would though be that you would have to fiddle the right dependencies or hope that the Glassfish WTP adapters will return the right dependencies.
If you would like to help on adding this kinda support then find the plugins/org.jboss.tools.seam.core.*/plugin.xml and edit this segment:
-
<runtime-component id="org.jboss.ide.eclipse.as.runtime.component" version="4.0" />
<runtime-component id="org.jboss.ide.eclipse.as.runtime.component" version="4.2" />
and add in the runtime id for the glassfish server adapter.
An hacky alternative is to just setup a JBoss4.2 and point the deployed result to somewhere in the glassfish server ;)
btw. http://jira.jboss.com/jira/browse/JBIDE-1320 is the jira issue for handling this thng.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104914#4104914
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104914
18 years, 8 months
[EJB 3.0] - Proxy-Class
by MistaMoasn
Hello!
I got a problem which is similar to the following posts (no solution yet provided):
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88515
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=121044
I have entities which are organized in an inheritance hierarchy (please have a look a the code below). When i execute a query (please look at the stateful session bean below) it returns a proxy-object. But it should be an instance of the concrete entity bean. I am facing this problem only when querying in an inheritance hierarchy. For "normal" entity beans it works fine.
How can i tell the entity beans in the inheritance hierarchy that the whole hierarchy should be fetched eager without eager fetching.
I found a (not suitable) workaround when i use the annotation @Proxy(lazy =false) at base class level. With this annotation i get the concrete instance of the entity bean (RfAuthProject-instance with id 483 like in the example below) but all associations of each entity in the hierarchy are eager fetched too. That's a problem because, it gets really slow.
How can i achieve that only the inheritance hierarchy is fetched and none of the associations?
Thanks in advance for your help.
kind regards
Patrik
ps.:
Environment: JDK1.5, JBoss 4.2.1 (with EJB3.0 embedded)
pps.:
Example code below:
| @Stateful
| public class MainProjectDTO implements MainProjectLocal, MainProjectRemote
| {
| public Project getProject()
| {
| // trivial example for my problem
| Query query1 = em.createQuery("FROM Project p WHERE p.id = 483");
| Project project = query1.getSingleResult();
|
| // the returned project is a proxy like Project_$$_javassist_16 but
| // should be an instance of RfAuthProject because it really is one.
|
|
| // here lies my problem
| // project with id=483 is definitly a RfAuthProject
| if (project instanceof Project) --> true
| if (project instanceof RfProject) --> false
| if (project instanceof RfAuthProject) --> false
|
| // following class cast fails
| RfAuthProject rfAuthProject = (RfAuthProject) project;
|
|
| return project;
| }
| }
|
Three entity beans in an inheritance hierarchy.
| @Entity
| @Inheritance(strategy = InheritanceType.JOINED)
| @Table(name = "project")
| public class Project
| {
| }
|
| @Entity
| @Table(name = "rf_project")
| @Inheritance(strategy = InheritanceType.JOINED)
| @PrimaryKeyJoinColumn(name = "id")
| public class RfProject extends Project
| {
| }
|
| @Entity
| @Table(name = "rf_auth_project")
| @Inheritance(strategy = InheritanceType.JOINED)
| @PrimaryKeyJoinColumn(name = "id")
| public class RfAuthProject extends RfProject
| {
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104908#4104908
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104908
18 years, 8 months