EJB 3.0 style and annotations

Hi all,

1 / is there any possibility how to generate EJ 3.0 interfaces for SessionBeans, without clicking 'Apply EJB 3.0 style'? Any configuration to make EJB 3.0 style the default one?

2/ When I generate a remote interface for SessionBean IDEA annotates the bean the bean this way:

@Remote(Converter.class)
public class ConverterBean implements Converter {
}

Is it possible to force IDEA to annotate the interface not the class?:

@Remote
public interface Converter {
}
Or is it a best practice or pattern or something why Jetbrains developers decided to generate annotations in different way from what JEE tutorial says (they annotate the interface)?

Thank you

4 comments
Comment actions Permalink

You annotate both. The annotation in the interface indicates it's a remote interface, the one in the EJB which interface is its remote interface.
They're not mutually exclusive.

0
Comment actions Permalink

I am not an J2EE expert, but from my understanding that's incorrect.
At least it is sufficient to annotate only one.

Myself I'd like to have the annotation on the class. My interfaces are in a separate Idea module that has no dependencies to J2EE jars at all. For clients it looks a a plain java module.

0
Comment actions Permalink

RMH in his EJB book annotates both, while stating as a sidenote in one paragraph that there are people who don't like the annotation on the class.

0
Comment actions Permalink

So why Idea annotates only the class?
I didn't find out how to change it...

0

Please sign in to leave a comment.