This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!

antonio each

Greenhorn
+ Follow
since Apr 05, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by antonio each

Suppose you have this situation:


TABLE A:
id_a (pk)
column_a

TABLE B:
id_b (pk)
column_b

TABLE C:
id_c (pk)
column_c



COMPOSITE_TABLE: (Where id_X is foreign key to TABLE_X and the triple composed by id_a,id_b,id_c is primary key of COMPOSITE TABLE)
id_a
id_b
id_c


How to map using JPA2 with hibernate implementation?
Thank you!
Hi all

My JAX-WS ws need to return an xml String:



The question is:
I need to wrap XML String into CDATA tag or JAX do it for me when CustomObject is serialized to XML response ? Is there collateral effect in this approach ?
Thank you!
9 years ago
Hi all

I have this scenario:

EJB1 have a method handler(List<UserDTO> users) annotated with : @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED). In this method I call other EJB2 method annoted with @TransactionAttribute(TransactionAttributeType.REQUIRED).

The goal is to have transaction only on single saveUser operation and not on complete users list.
If I have understod cmt transacation behavior the NOT SUPPORTED doesn't start a new transaction on handler() method,but create one when saveUser is called. is this right?



Thank you for suggests!
Hi all

this is my scenario:



So i have a NamedQuery on top of Car entity:




In my database I have only one car which have CAR_DESC = 'MONOVOLUME',but query return the same replicated result sixteen times!

I can't see any error in my code,can someone help me?

Thank you!
Antonio
The Client in it self is not the problem. In fact if I try to put all my jars into WEB-INF/lib of web-app all work very well.

This problem appair when i try to put all jars into Tomcat/lib,so i think at class loader problem.

P.s.: HOwever Thank you for your quick answer!
9 years ago
Hi all

I have a web application (a portlet developed with IceFaces 1.8.2) deplyed through liferay 5.2.3 into tomcat 6.0,which deal with several web services.
To decouple presentation logic from the webservices domain objects I have created four different projects in eclipse:

1. ExampleWEB: is the Dynamic web projectm
2. ExampleFacade: is the 'middle tier' which interfaces with the web services client
3. ExampleDTO: data transfer object
4. ExampleWSClient: web services client

Ok,let's go to the problem .....

For business internal rules I have to externalize all libs from .war (so,I can't create ExampleFacade.jar,ExampleDTO.jar,ExampleWSClient.jar and put them into WEB-INF/lib):

If I put these jar into Tomcat lib directory,app deploy and start with success,but when i try to click on button to call a web service method nothing seems to happens. No Exceptions,No Errors,No output....nothing....

P.s.: Client uses axis lib (axis.jar etc etc)

Any idea?
9 years ago

Jaikiran Pai wrote:

Pedro Kowalski wrote:Antonio, could you tell me how did you access the EntityManager from your non-EJB superclass (AbstractBaseService)? Or maybe you didn't use the EntityManager for these CRUD operations?

Cheers!



1) If the base class is abstract he won't be able to create an instance of that. So accessing from the base class in that case is ruled out. i.e. you'll need to lookup the bean which extends that class and then let that bean instance access the injected entitymanager.

2) If the base class is not abstract and itself is a bean and also has a subclass which is a bean, then there are 2 bean implementation classes. The user can lookup either of them separately and use the injected entity manager.



Hi Pedro, The point 1 of jakiran post is the way:
the BASE bean is abstract,so it never can be instantiated! Each bean which extends base class retrieve an instance of entity manager to perform operations with db.

Bye
Thank you for clear explanation!

I confirm all what you have posted here and I'm very happy for the architecture of my application!

Antonio
Hi all

I'm developing a web application with: JSF,EJB3 and JPA (without DAO Layer).

So the idea is to create a FATHER ABSTRACT SESSION BEAN which expose all principal CRUD commons operation such as INSERT,REFRESH,DELETE ENTITY etc:



So each SPECIALIZED SESSION EJB needs to extends this AbstractBaseService.



Ok...This is what we have tryed ,but WEBLOGIC application server fails to run:
Reading ejb3 specification on sun site i have understood why:

Specification says:
"A Session Bean class annotated with @Stateless can't be ABSTRACT and can't INHERIT from another @Stateless session bean"

My answer is:

Is there a way to accomplish my goal?

I thought:

and if i don't declare my AbstractBaseService as @Stateless session bean....???
What happen to @Stateless session bean which extends it?

Any help is appreciate!

Antonio