in Technology by

Explain annotation in EJB to do the database entity relationships/mappings.

1 Answer

0 votes
by

EJB 3.0 provides option to define database entity relationships/mappings like one to one, one to many, many to one and many to many relationships. Following are the relevant annotations:

  • OneToOne - Objects are having one to one relationship. For example, a passenger can travel using a single ticket at time.

  • OneToMany - Objects are having one to many relationship. For example, a father can have multiple kids.

  • ManyToOne - Objects are having many to one relationship. For examples, multiple kids having a single mother.

  • ManyToMany - Objects are having many to many relationship. For examples, a book can have mutiple authors and a author can write multiple books.

Related questions

0 votes
    Explain @javax.ejb.PostActivate annotation....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Explain @javax.ejb.ActivationConfigProperty annotation....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Explain @javax.ejb.Remote annotation....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Explain @javax.ejb.Local annotation...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Explain @javax.ejb.EJB annotation....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Explain @javax.ejb.MessageDrivenBean annotation....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Explain @javax.ejb.Stateful annotation....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    Explain @javax.ejb.Stateless annotation....
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
0 votes
    new to play and just trying to follow the video on: http://www.playframework.org/ I'm coming so ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    What do Master-Detail relationships will involve? 1. Cascading deletes and sharing rules which are controlled by ... retail sectors 4. Relationship between master and slave drives...
asked Jun 27, 2021 in Technology by JackTerrance
0 votes
    How many relationships do we have in Salesforce?...
asked Nov 12, 2020 in Technology by JackTerrance
0 votes
    I try to create database from entity framework code first follow with this tutorial http://www.asp.net/mvc ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    What is Database First Approach in MVC using Entity Framework?...
asked Apr 5, 2021 in Education by JackTerrance
0 votes
    How might you approve all mappings in the archive all the while?...
asked Jun 7, 2021 in Technology by JackTerrance
...