Can i write business logic methods in entitybean?
Answers were Sorted based on User's Feedback
Answer / madan
Entity beans are used to communicate directly with database, here we have setter and getter, each getter is represented with specific id., for example
@Column(name="id")
public String name()
{
return id;
}
this way..
the business logic is maintained Databasefile.java, which contains logics for the communication
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / supraja
One easy way to achieve this is to separate pure business
logic from the persistence mechanism. Implement the
business logic in your CMP class, which can be deployed
alone if CMP is chosen. Then implement the persistence code
into the BMP class, which inherits from the CMP class. This
preserves all the business logic of the CMP superclass and
adds database access code in the BMP subclass,
This model sounds easy to implement but still leaves the
following flexibility inhibitors:
It is impossible to extend the implementation classes.
Doing so means the subclasses must extend both the CMP and
the BMP superclass directly. In addition, the BMP subclass
will have to extend its direct CMP implementation. This
causes multiple class inheritance. Such multiple
inheritance is not allowed in Java programming
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / arun
yes you can write business in entity bean... and in entity
bean, you can call business method directly from home
interface, that is not possible in case of session bean. in
session bean you need EJBObject to intrect with bean and
bean' business method.
Is This Answer Correct ? | 3 Yes | 6 No |
What is the procedure of ejb container to handle exceptions?
Difference between javaBeans and Enterprise JavaBeans?
1 Answers Indotech, Tech Mahindra,
Match the ejb functions given below with the functionality equivalent in sql?
difference b/w the hybernate and entity bean
What is Enterprise JavaBeans?
What is Enterprise JavaBeans (EJB)?
Why do we need ejb?
Differentiate “find a method” from “select method” in EJB ?
Differentiate Phantom from Un-repeatable?
Is it possible to write two EJBs that have different bean classes, but they share same Remote interface and Home interfaces?
Which is more beneficial: CMP or BMP?
What is ejb ql?