[JBoss JIRA] Created: (EJBTHREE-652) JPA Is Requiring That Entity Bean Name Matches Table Name for @NamedQuery
by Sascha Goldsmith (JIRA)
JPA Is Requiring That Entity Bean Name Matches Table Name for @NamedQuery
-------------------------------------------------------------------------
Key: EJBTHREE-652
URL: http://jira.jboss.com/jira/browse/EJBTHREE-652
Project: EJB 3.0
Issue Type: Bug
Components: EJB3 Extensions
Affects Versions: EJB 3.0 RC7 - FD
Environment: JBoss-AS 4.0.4-GA.
Reporter: Sascha Goldsmith
Priority: Minor
I created an entity bean with its own unique Java name. This differed from the actual table name. The following named query produces a org.hibernate.hql.ast.QuerySyntaxException when the bean is deployed:
@Entity (name="ErrorAuditRecord")
@Table (name="error_audit")
@NamedQueries ({
@NamedQuery (name="findAllErrors", query="SELECT o FROM ErrorAuditRecord o")
))
In order to get it to work, I am forced to name my Java POJO the same name as the table's name:
@Entity (name="Error_Eudit")
@Table (name="Error_Eudit")
@NamedQueries ({
@NamedQuery (name="findAllErrors", query="SELECT o FROM Error_Audit o")
))
This seems, to me, to be a bug for two reaons:
1) Why even have separate @Entity and @Table annotations (with name attributes) if the names cannot differ?
2) Devlopers are forced to name classes exactly like the table name, which produces 'ugly' Java class names (ok, minor point, but I feel it is valid)
Does a subsequent EJB 3.0 release support having named queries access via entity name rather than table name? (Or more properly, without forcing one to name the entity bean with the table's name)?
Best regards. You guys have done a great job with EJB 3.0 so far!
Saish
PS: Other users are having same issue with Hibernate as the JPA provider: http://forum.springframework.org/showthread.php?t=19737
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 3 months
[JBoss JIRA] Created: (JBAS-3729) Add alternate run-as mappings for container callbacks
by Scott M Stark (JIRA)
Add alternate run-as mappings for container callbacks
-----------------------------------------------------
Key: JBAS-3729
URL: http://jira.jboss.com/jira/browse/JBAS-3729
Project: JBoss Application Server
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: EJB2, EJB3, Security, Web (Tomcat) service
Affects Versions: JBossAS-4.0.4.GA
Reporter: Scott M Stark
Assigned To: Scott M Stark
Fix For: JBossAS-4.0.6.CR1
Other app servers support anlternate run-as semantics from the container init/destroy lifecycle callbacks. Weblogic for example:
http://e-docs.bea.com/wls/docs81/webapp/weblogic_xml.html#1041058
This is an equivalent of <run-as> for init method for servlets. For example:
<init-as>
<servlet-name>FooServlet</servlet-name>
<principal-name>joe</principal-name>
</init-as>
<destroy-as>
<servlet-name>BarServlet</servlet-name>
<principal-name>bob</principal-name>
</destroy-as>
This would allow more control over how these methods interact with secured resources. Similar options could be added for ejb lifecycle methods as well.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 3 months