java-ee-5

EJB3 and manual hierarchy persistence

眉间皱痕 提交于 2019-12-03 09:11:12
I have a legacy database, which I am using EJB3 to model. The database is in quite a poor shape, and we have certain unusual restrictions on how we insert into the DB. Now I want to model the database in a hierarchy that fits in with the DB strucuture, but I want to be able to manually insert each entity individually without the persistence manager trying to persist the entities children. I am trying something like the following (boilerplate left out): @Entity @Table(name = "PARENT_TABLE") public class Parent { @Id @Column(name = "ID") int id; @OneToMany List<Child> children; } @Entity @Table

How do you unit test Java EE code?

给你一囗甜甜゛ 提交于 2019-12-03 04:14:58
问题 I want to ask for your prefered way to test Java EE code? I found only three project, that are trying to help to code unit tests in Java EE environment: http://jakarta.apache.org/cactus/ : Last Published: 2009-01-18 http://www.junitee.org/ : Last Release: 2004-12-11 http://ejb3unit.sourceforge.net/ : Last Release: 2008-05-17 So I wonder, is there any framework helping to write (j) unit test for Java EE code? do you use embedded Java EE servers like jboss or glassfish v3? do you mockup and

How do you unit test Java EE code?

白昼怎懂夜的黑 提交于 2019-12-02 17:33:39
I want to ask for your prefered way to test Java EE code? I found only three project, that are trying to help to code unit tests in Java EE environment: http://jakarta.apache.org/cactus/ : Last Published: 2009-01-18 http://www.junitee.org/ : Last Release: 2004-12-11 http://ejb3unit.sourceforge.net/ : Last Release: 2008-05-17 So I wonder, is there any framework helping to write (j) unit test for Java EE code? do you use embedded Java EE servers like jboss or glassfish v3? do you mockup and inject by yourself? Thanks a lot... Pascal Thivent If by Unit Testing you mean... unit testing (testing a

JPA Entiy on synonym instead of table

眉间皱痕 提交于 2019-11-30 19:35:12
I have a Seam 2.2 based Java EE 5 web application with a bunch of tables mapped to JPA 1.0 Entities via Hibernate 3.3.3. During development it's running on a Tomcat 6, Oracle 10 XE and Windows 7. Now, we had the request by operations department to split the data model into one schema being the owner of all database objects ( myschema ) and one schema acting as the application's database user ( myschema_app ). So I did the following: create schema myschema_app grant object rights on all necessary tables from myschema (both regular ones and n:m intermediate tables) and sequences depending on the

Which are the differences/similarities between hibernate and other frameworks or specifications?

限于喜欢 提交于 2019-11-30 16:42:37
I want to know the differences/similarities between Hibernate and simple persistence in Java EE 5? I'm not clear if Hibernate implements Java EE 5 persistence implementation or if it is a totally different approach to data representation over back-end systems. I'm confused about Hibernate and its relation with the concepts about java persistence given in the Java EE 5 tutorial... could you clarify the role of Hibernate in the context of Entities and EJBs? Also, I want to know other approaches (frameworks) like JPA or Spring... Pascal Thivent I want to know the differences/similarities between

EJB3 & How JAAS subject/principal is propagated to EJB Tier from servlet container?

北城以北 提交于 2019-11-30 15:55:16
I'm trying to understand how the JAAS principal propagates to the Business/EJB tier from web tier. I've read that the if the roles/realm is configured in login-config & security-context of web.xml then the servlet container will also transparently pass the authenticated principal to the EJB Tier. Two questions 1.) First & more importantly is that true ? Without any intervention from the developer ! 2.) And secondly any idea how that works under the hood. yes it's true. that's generally the point of ejb, to take the "hard" stuff out of the hands of the developer (e.g. security, transactions,

PrimeFaces fileDownload does not work

那年仲夏 提交于 2019-11-30 15:13:46
问题 I can't get the primeFaces <p:filedownload work. While I succeed in downloading the file using a custom download bean. Seems like the issu is related to the primefaces file download ActionListener but I don't see how. Does anyone have a clue? Thanks. Here is my bean: @ManagedBean(name="fileDownloadBean") @SessionScoped public class FileDownloadBean implements Serializable { private StreamedContent file; public StreamedContent getFile() { return file; } public void setFile(StreamedContent file

PrimeFaces fileDownload does not work

会有一股神秘感。 提交于 2019-11-30 13:58:49
I can't get the primeFaces <p:filedownload work. While I succeed in downloading the file using a custom download bean. Seems like the issu is related to the primefaces file download ActionListener but I don't see how. Does anyone have a clue? Thanks. Here is my bean: @ManagedBean(name="fileDownloadBean") @SessionScoped public class FileDownloadBean implements Serializable { private StreamedContent file; public StreamedContent getFile() { return file; } public void setFile(StreamedContent file) { this.file = file; } /** Creates a new instance of FileDownloadBean */ public FileDownloadBean() {

jspx script element on GlassFish v3

浪尽此生 提交于 2019-11-30 09:42:54
问题 The .war is served from GlassFish v3. I am trying to include a javascript file from my jspx. <script type="text/javascript" src="/base/interface/Service.js"></script> I get the following in my http response <script src="/base/interface/Service.js" type="text/javascript" /> The problem is that it should include the </script> tag. I believe this is why it works on Chrome, but not on Firefox or IE. Any idea how to force <script></script> Update: Not sure if any of this is pertinent, but here is

JPA Entiy on synonym instead of table

白昼怎懂夜的黑 提交于 2019-11-30 03:49:11
问题 I have a Seam 2.2 based Java EE 5 web application with a bunch of tables mapped to JPA 1.0 Entities via Hibernate 3.3.3. During development it's running on a Tomcat 6, Oracle 10 XE and Windows 7. Now, we had the request by operations department to split the data model into one schema being the owner of all database objects ( myschema ) and one schema acting as the application's database user ( myschema_app ). So I did the following: create schema myschema_app grant object rights on all