Questions tagged [entity-bean]
46 questions
5
votes
2 answers
Is it a good practice to embed behavior into Entity Beans?
While my Java apps were small and did simple things, I was quite happy using plain SQL, all the more that application servers like Glassfish make connection management really easy. After I learned about JPA and EJB, I decided to refactor my projects…

Alex Salauyou
- 14,185
- 5
- 45
- 67
3
votes
3 answers
Terminology: "Entity Bean" vs. "Data Model"
We are in a conversation where one developer uses the term "Entity Bean" and one describes something relatively similar as a "Data Model".
Are these terms synonymous? Are there subtle differences the terms imply that should be considered?
The…

David Parks
- 30,789
- 47
- 185
- 328
2
votes
3 answers
Migrate from EJB 2 Entity Bean to EJB3
I am having some entity beans created in EJB 2.0 and now I need to migrate to EJB 3.x, but I've studied that use of entity beans are changed in EJB 3.x and they are using JPA instead.
Where can I find solution to actuate my beans to be comfortable…

lourdh
- 449
- 2
- 12
- 30
2
votes
1 answer
Multiple field with identical name in Spring
I've got the following:
public class ClaimFacadeImpl implements ClaimFacade {
@Autowired
private DebtRepository debtRepository;
@Autowired
private DebtRepository fineRepository;
//other stuff
}
public interface…

GregD
- 1,884
- 2
- 28
- 55
2
votes
1 answer
Relationship between deprecated Entity Beans in Java EE and the @Entity annotation?
There's a whole lot of beans and vegetables in Java, and it's beginning to confuse me some. I've read a couple of newly published books on Java EE 6, and they all say that "entity beans" has been pruned ("deprecated" would be the correct term for…

Martin Andersson
- 18,072
- 9
- 87
- 115
2
votes
1 answer
Create entity bean from existing Database through glassfish resource (connection pool)
I want to create an entity class from database. My database would be HSQL and i use file to store the data.
I have no problem to config the connection pool to connect to this database @ glassfish The name of the resource which uses the connection…

czupe
- 4,740
- 7
- 34
- 52
2
votes
2 answers
possible to return only one column using JPA
I have an Open JPA entity and it successfully connects a many-to-many relationship. Right now I successfully get the entire table, but I really only want the ID's from that tables. I plan on calling the database later to reconstruct the entities…

SoftwareSavant
- 9,467
- 27
- 121
- 195
1
vote
0 answers
Bean-Managed EB3 with jdbc persistency
I was trying to write a bean-managed persistent entity bean in EJB3, without using JPA, but with using jdbc connection to postgres. My question is, because it is BMP, the jdbc methods are written in it, should I create a session bean and write the…

LoveCode
- 13
- 3
1
vote
1 answer
how to connect data base with EJB entity bean
how to configure EJB with mysql. where will put username,password , driver class etc...
i want access one table using EJB entity bean , it is installed in my local computer. how it is possble..
thanks and regards.....

jaleel
- 1,169
- 8
- 22
- 46
1
vote
0 answers
How to call an entity class inside servlet in JEE. Beginner JEE programer
Im trying to use an entity class on my code but im getting "exception
java.lang.NoClassDefFoundError:" exception.
My student entity class:
package entity;
import java.io.Serializable;
import javax.persistence.Entity;
import…

Rodolfo Pedro Junior
- 11
- 1
1
vote
1 answer
Can you run EJB 2.1 beans in OSGi?
I have a J2EE 1.3 app that uses EJB 2.1 session and entity beans. Currently this app runs as an EAR file on JBoss. I'd like to switch to the SpringSource dm Application Server because of all the benefits that OSGi provides.
Does anyone know if…

Andrew Swan
- 13,427
- 22
- 69
- 98
1
vote
1 answer
when is an EJB CMP entity bean actually created
I have a session bean that provides a business method, in which it creates several CMP entity beans, something like this
public void businessMethod(int number) {
try {
MyBeanHome home = lookupMyBean();
DataSource dataSource =…

phunehehe
- 8,618
- 7
- 49
- 79
1
vote
0 answers
Error accessing Entity Bean from client side on local environment
I have created an SampleEntityBean, homeInterface, componentInterface and client side class.
All I wanted to do is to access a method defined in SampleEntityBean (doCalculation).
The EntityBean code is.
public class SampleEntityBean implements…
1
vote
1 answer
Transaction between two session beans in ejb3
I have three tables server_detail, server_group, server_group_mappping and the entity classes as below. (have not given the full code details)
@Entity
@Table(name = "server_detail")
public class ServerBean implements Serializable {
private static…

Bhimaraju Pukkalla
- 21
- 6
1
vote
0 answers
How to refresh EJB 2.1 entity bean after changes made by JDBC in the same transaction?
I am working with following code, with mixed EJB 2.1 entity beans and JDBC operations done in a single container-managed transactions in Weblogic WLS 11g:
Entity e = entityHome.findByPrimaryKey(entityId);
e.setFieldX(initalValueX);
// this performs…

tporeba
- 867
- 10
- 23