Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java SE client depends on javax.ejb?  RSS feed

 
R. Heydenreich
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm a little confused about the new entity bean paradigm in EJB3. If I use an entity bean in my good old Java SE client, it depends on javax.ejb, because the entity beans are annotated with @Entity. Thus, I have to place the EJB jars into the client project to use my entity beans as data containers. Or have I misunderstand this completely?

Greets,
Ralf.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"luckybird"

Please check your private message for a message from JavaRanch.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Starting EJB3, there are no entity "beans". All you have is the entities (POJOs).


Thus, I have to place the EJB jars into the client project to use my entity beans as data containers.


You mean the jar(s) containing the entity POJOs?
 
R. Heydenreich
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, otherwise I can't compile the client, because it depends on that. And
the jars which contains e.g. the javax.persistence.ManyToOne annotation, too.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not much into EJB, but intuitively it makes sense to me that if you want to persist objects using EJB, that they would depend on the EJB API (annotations in this case).

Does shipping the EJB/Persistence API jars with the client present a problem?
 
R. Heydenreich
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found that it is no clean separation between client and server. I think, a client application shouldn't know which server technology is used.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!