users@glassfish.java.net

RE: question about _at_ejb injection on ACC

From: Eve Pokua <gorgeous65_at_msn.com>
Date: Tue, 2 Feb 2010 10:13:50 +0000

Luca,

 

 

> Take a look at this -
>
>
> [...cut...]
>
> > 3. From anywhere in any of the classes in your app client use
> > Main.getUserRemote() when you need to use the EJB.
>
>
> thanks, I used this method in my code ;)
>


 

For example, in my interface UserRemote, I have a method -

 

void createUser(firstn, surname, address1, address1, potcode, phoneNo);

 

In the implementation class -

 

void createUser(firstn, surname, address1, address1, potcode, phoneNo)

{

 

Userent userent=new Userent();

     userent.setFirstn(firstn);

 

 

..................

 

em.persist(userent);

 

}

 

So because, you have set up the static method in main you call

main in the other JFrame classes -

 

Main.getUserRemote().createUser(fn, sn, add1, add1, pcd, pn);

 

You call the methods you would like to call and pass on the

parameters as usually.

 

I assume you have an entity class with all your set and get methods,

and interface with is your ejb, where you define all your business methods

and an implementation class which is either a @statefull or @stateless, and

 which also implements your interface.

 

Thanks

 

eve

 

 


 
> Date: Mon, 1 Feb 2010 17:34:21 +0100
> From: luca_at_morettoni.net
> To: users_at_glassfish.dev.java.net
> Subject: Re: question about @ejb injection on ACC
>
> On 02/ 1/10 05:20 PM, Eve Pokua wrote:
>
> > Hi Luca,
> > Take a look at this -
>
>
> [...cut...]
>
> > 3. From anywhere in any of the classes in your app client use
> > Main.getUserRemote() when you need to use the EJB.
>
>
> thanks, I used this method in my code ;)
>
> --
>
> Luca Morettoni <luca(AT)morettoni.net> | OpenSolaris SCA #OS0344
> Web/BLOG: http://www.morettoni.net/ | http://twitter.com/morettoni
> jugUmbria founder: https://jugUmbria.dev.java.net/
> ITLOSUG leader: http://hub.opensolaris.org/bin/view/User+Group+itl-osug/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
                                               
_________________________________________________________________
Tell us your greatest, weirdest and funniest Hotmail stories
http://clk.atdmt.com/UKM/go/195013117/direct/01/