Creating Entities for this data model

Hi guys,
I have these 3 tables:
create table employee_a
( employee_id int not null primary key ,
  first_name varchar(50) not null ,
  last_name varchar(50) not null )
create table manager_b
( id int not null primary key ,
  manager_employee_id int not null foreign key references employee_a(employee_id) ,
  subordinate_employee_id int not null foreign key references employee_a(employee_id) )
create table user_c
( user_id varchar(20) not null primary key ,
  user_password varchar(100) not null ,
  employee_id int null foreign key references employee_a(employee_id) )* All the employees are defined in employee_a table.
* If an employee is also a manager then its defined in manager_b table. That employee's id is defined in manager_employee_id column while his/her's subordinates employee ids are defined in subordinate_employee_id column.
* All the users of the system are defined in user_c table. If user of the system is also an employee then its defined in employee_id column of user_c table. If user of the system is not an employee then employee_id column is blank of user_c table.
The data may be like this:
insert into employee_a values (1, 'Mark', 'Benson')
insert into employee_a values (2, 'Joe', 'Young')
insert into employee_a values (3, 'Robert', 'Carbone')
insert into employee_a values (4, 'Wendy', 'Swistenenko')
insert into employee_a values (5, 'Tony', 'Lapolla')
-- Joe Young is manager of "Robert Carbone" and "Tony Lapolla"
insert into manager_b values (100, 2, 3)
insert into manager_b values (101, 2, 5)
-- Wendy Swistenenko is manager of "Mark Benson"
insert into manager_b values (102, 4, 1)
-- Users of the system who are also employees
insert into user_c values ('bensonM', 'password', 1)
insert into user_c values ('youngJ', 'test', 2)
-- A user of the system who is not an employee
insert into user_c values ('guest', 'pretty', null)My question is how to define Entities for these 3 tables for JPA. I am concerned about Inheritence Strategy to use.
Thanks

sorry, i couldnt understand your query..
thanks,
baskar.l

Similar Messages

  • Identify Entities for Logical Data Model

    Hi,
    I donno exactly this is the correct forum for this question. I believe there are database experts here to help me on this.
    I am in confusion that, phsically the data can be saved in a set of tables (4-5 tables). But different views (User Interfaces) and reports can be created from these tables.
    Assume that,
    View1 - Uses all tables
    View2 - uses only 3 tables
    View3 - uses only 1 table
    Report 1 - uses only 2 tables
    Report 2 - uses only 4 tables
    Should my Logical Data Model reflect all these view1, view2, view3, Reprt1 and Report2?
    How exactly do we need to identify the entities for Logical Data Model?
    Could you please any one help me on this?
    Thanks & Regards
    M Thiyagu

    sorry, i couldnt understand your query..
    thanks,
    baskar.l

  • What kind of view object should I create for this data model?

    I have an entity that has several dates. The dates are stored in a table separate from the entity, each entity date has a date type (open, close, interview, etc) associated with it. The DBAs idea (who else of course!) was to have the flexibility to add new types of dates for entities when needed.
    So you have tables like this -
    Table: EntityTable
    Columns: EntityId, EntityName
    Table: DatesTable
    Columns: EntityId, Date, DateTypeCd
    I need to display an editable ADF form where I can update the entity and the entity dates
    The ADF form would contain something like this -------
    Entity Name: []
    Opening Date: []
    Closing Date: []
    Interview Date: []
    What kind of view object would I need to create to achieve this?

    That would be a master-detail relation 1-* between 'entity' and 'entity dates'. If your dba has set up the foreign key association in the db and you use the wizard to create the business objects, jdev pick up the relation and create the correct master detail relation in the vo layer for you.
    By the way naming a table 'entity' is not a good idea when working with ADFbc. We all talk about entities when we relate to a business object (in this case a row of a table or entity object or EO). So it's hard to distinguish the two, your specific table 'entiyt' and the common term entity or EO which can be a row of any table.
    Timo

  • Reuse Dimdate across different database for different data models

    Hi,
    I am designing a new data model for a data mart. I need to add dimdate dimension in this data model. I noticed that dimdate already exists in another database and being used by another
    data model. Is it possible to re-use the existing dimdate table for my new data model? If so, what about the foreign key constraints? Normally we link the date columns from fact table to the dimdate keys. How would we achieve that in case we are using the
    same table across different databases?
    Any opinion on this will be highly appreciated.
    Thanks in Advance.
    Cheers!!

    You can create a copy of dimdate table to your new data warehouse.
    If both data marts were in a single data warehouse, then you don't required to copy. but as these are in two different databases then you just copy that.
    regarding FK relationship. you can connect any fact table to you date dimension. even if you want to use more than one instance of your date dimension, it would be simply adding multiple FK columns in your fact table (role playing dimension).
    For date dimension be sure that your date dimension covers most of the attributes required. here is an example of date dimension:
    http://www.rad.pasfu.com/index.php?/archives/156-Script-to-Generate-and-Populate-Date-Dimension-Version-2-Adding-Multiple-Financial-Years.html
    Regards,
    Reza
    SQL Server MVP
    Blog:  
    http://rad.pasfu.com  Twitter:
      LinkedIn:
    SQL Server Integration Services 2012 Tutorial Videos:
    http://www.radacad.com/CoursePlan.aspx?course=1

  • ServletException: Cannot create iterator for this collection

    hi,
    i am using struts action class with struts tags to display
    data in jsp page.
    in struts class i am return arraylist ,
    same list i am displaing in jsp.
    if Arraylist have data ,i am not getting error.
    but if arraylist empty ,i am getting ServletException: Cannot create iterator for this collection
    <logic:iterate id="result" name="fileList" >
    <td><bean:write name="result" property="fileName"/></td>
    </logic:iterate
    can any one help how to avoid this exception?
    thanks
    siav

    You could use <bean:size> to get the size of the list
    and conditionally execute the logic:iterate,
    something like this :
    That will work, but not necessary. If the collection is empty, the iterate tag just skips - it doesnt throw an exception (tested)
    The problem I guess is that the bean with the specified name is not a Collection. It may be a property of the bean that is a collection in which case the tag should have a property attribute.
    ram.

  • There is no source data for this data record, Message FZ205

    Hi Experts,
    I am facing a problem with the DME File download. This problem happened all of sudden in our production system since last month and it was never before. Our system landscape has also not been changed but as per our basis consultant he has added two-three more new application server to the Production client. Even we do not have this problem in our testing clients.
    Please note that we have been using the output medium '1' from the day one and thus the system has been generating the DME in 'File System' which we download on the desktop and upload the same to the bank online. After running the payment run when we trying to download the DME File, the system gives the error "There is no source data for this data record, Message FZ205".
    I tried to fix this issue through many ways but not able to. So can you please let me know the reason of this error and solution to fix this.
    With best regards,
    BABA

    Hi Shailesh,
    Please share how you solved this problem.
    Many Thanks,
    Lakshmi

  • Data source for this data connection isn't registered for Power BI

    Hi, I am getting this error when I set Schedule Data Refresh to refresh data from db.  How do I register my connection to the data source?  Is this a fix on SQL server or Power BI?
    FAILURE INFORMATION
    Failure
    Correlation ID: c5132b7a-3c54-4f12-a048-3ddcf0b95f26
    Data connection Status
    SqlServer twcperfsql1 OfficePerf OnPremise error: Sorry, the data source for this data connection isn't registered for Power BI. Tell your Power BI admin the admin needs to register this connection to this on-premises data source.
    Thanks for your help.

    I'm running into the same issue, I did configure the Gateway and then the data source in Power Bi.
    When I go to the Power BI Admin Center and click on "Test Connection" it seems to be working. But when I refresh the data from Power BI it doesn't work. Now if I edit the spreadsheet in excel and refresh the data in PowerPivot then it works. So
    not sure why the solution doesn't refresh from the automated service in Power BI without this useless error.
    Thanks
    Fabian
    In case it helps this is the actual error:
    Failure Correlation ID: ecc73a16-7264-45b2-9baf-e3448f007211                                                     
    Power Query - dbo_TableAOnPremise error: Sorry, the data source for this data connection isn't registered for Power BI. Ask your Power BI admin to register the data source in the Power BI admin center.
    Also further information I have found so far is that the Gateway is receiving the requests for the refresh and it shows the message below, so the data source is found and communication seems to be happening from server to client and back, not sure why server
    doesn't seem to like the data the Gateway is sending back to server.
    The feed 'dbo_TableA' was successfully accessed at 7/15/2014 4:23:26 PM.
    The request took 00:00:00.0000105 seconds.
    Activity ID: e8464e5d-3f0a-49c2-b10b-450fec3e5940

  • I have an existing ipod that I use with my mac. I am trying to connect an additional ipod to it but when I try and register, it just brings up the existing info. I don't want to lose the original info or library - just create new for this device. Pls help

    I have an existing ipod that I use with my mac. I am trying to connect an additional ipod to it but when I try and register, it just brings up the existing info. I don't want to lose the original info or library - just create new for this device. Pls help...

    We are starting from the beginning like its a new ipod starts out asking language, country,location services,choose a network,and when we get to "setup ipod touch  " there are 3 options 1..setup as new ipod, 2.restore from ipod backup 3 restore from itunes backup and when we hit setup as new ipod and click next it comes up with sign in with apple id or create a free apple id  we clicked create a free apple id....then comes up with bday,1st name last name, use your current email address, get a free icloud email address or change email address and THIS is where we have problems....if we hit change email address it means that sis's stuff goes under his name and moves all her stuff to this older ipod which the brother does not want. sorry this is so long but its the only way I knew to do it.

  • Is there any system variable for this date format 01/21/2004 18:00:32

    Hello,
    Is there any system variable for this date format 01/21/2004 18:00:32
    This is my Internal date format and my External date format is sy-datum.
    How can I validate....any suggestions will be apprecaited!
    Regards,
    Kittu

    Hello,
    Thank you very much for your response!
    My internal date format is 01/21/2004 18:00:32
    and external date format on selection-screen is sy-datum.
    My external format is stored in S_crtsp
    and internal format is stored in L_crtsp. (01/21/2004 18:00:32)
    I want to remove the time from the internal format and validate it aginst the external format.
    Any suggestions or brief explonation is appreciated...I apprecaite the help soo far...
    Regards,
    Kittu

  • Does camera raw support the Nikon D5300, if not when there will be an update for this camera model?

    Does camera raw support the Nikon D5300, if not when there will be an update for this camera model?

    The asterisk next the model number on the download page linked above means there is preliminary support, which usually means the camera is supported by pretending it is an earlier model with similar sensor.  This can lead to color issues, so while you can convert your NEFs to DNGs with the DNG Converter, and open them with PSE12, now, save your NEFs and be prepared to revisit those pictures once the final release of ACR 8.3 occurs probably in the next few weeks, with finalized support.

  • APP-PO-14258 no rate has been defined for this date

    Hi,
    When we are trying to receipt an error is appearing
    APP-PO-14258 no rate has been defined for this date
    Cause The rate type that you have entered uses pre-defined rates. No rate has been defined for the currnet rate type and rate date combination.
    Action: Enter a rate date for which a rate has been defined
    Please assist me.

    Are you using foriegn currency?
    If yes, You have to define exchange rate for that date.

  • Help with Jsp: logic:iterate  Cannot create iterator for this collection

    Hello,
    I am developing a jsp with struts. This is the snap of the code:
            <logic:iterate id="prod" collection="productList" >
              <tr align="center">
                   <td><html:text property="prodDesc" size="50" indexed="true"/></td>
                   <td>
                        <html:select property="prodUnit" indexed="true">
                             <option selected>-</option>
                            <OPTION VALUE='NMB'>NMB
                             <OPTION VALUE='TEN'>TEN
                             <OPTION VALUE='TPR'>TPR
                             <OPTION VALUE='GWH'>GWH
                        </html:select>
                   </td>
                   <td><html:text property="prodQty" size="20" indexed="true"/></td>
                   <td><html:text property="prodVal" size="20" indexed="true"/></td>               
              </tr>
            </logic:iterate>"productList" is defined as an array of Product[], "prod" is defined as a single Product object in the form. But when i run the page, it gives me this errors:
    "javax.servlet.jsp.JspException: Cannot create iterator for this collection".
    I also tried to make "productList" an ArrayList type, but it game me this same error.
    We are using Websphere 4.0 with Struts 1.1.
    Anyone can help?
    Thanks a lot.
    All the best,
    warren

    Hi , I have similar problem. wonder anyone can help me. I have a datastructure. ArrayList contains list of Hashtable; each Hashtable has two key-value sets ; for each key-value set , value is a ValueObject.
    My jsp works ok. but when I click on the radio butten for one radio group, it sets not only the porperty on that row, but the rows belows ,which suppose to be another radio group , because I am using indexed="true". each row should be a individual group seperated by the name poDisplayVO[i] , as show in the html generated .
    <!-- JSP -->
    <logic:iterate id="poDisplayVO"
    name="testForm"
    property="poDisplayVOList"
    type="java.util.Hashtable">
    <tr>
    <td>
    <bean:write name="poDisplayVO" property="name"/>
    </td>
    <td>          
    <% String val = ((java.util.Hashtable)poDisplayVO).get("subjAreaName").toString();%>
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="<%=val %>" />
    <bean:write name="poDisplayVO" property="subjAreaName"/>
    </td>
    <td>           
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="no" /> NO
    </td>
    <td>           
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="yes" /> YES
    </td>
    </tr>
    </logic:iterate>
    <! ------------------------ html genterated ------------------------------------------------>
    the HTML generated as folllows:
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="Accounting">
              Accounting
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="no"> NO
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="Bookkeeping">
              Bookkeeping
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="no"> NO
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[2].fosVO.select" value="Computerized Accounting(Duplicate)">
              Computerized Accounting(Duplicate)
    </td>
    <td>           
    <input type="radio" name="poDisplayVO[2].fosVO.select" value="no"> NO
    </td>
    <td>           
    <input type="radio" name="poDisplayVO[2].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <! ------------------------ action form-----------------------------------------------
    public ArrayList getPoDisplayVOList() {
         return poDisplayVOList;
    public void setPoDisplayVOList(ArrayList list) {
         poDisplayVOList = list;
    public Hashtable getPoDisplayVO(int i) {
         Object obj = poDisplayVOList.get(i);
         if (obj == null)
              obj = new Hashtable();
              poDisplayVOList.add(obj);
         return (Hashtable)poDisplayVOList.get(i);
    public void setPoDisplayVO(Hashtable programDisplayVO, int i) {
              poDisplayVOList.add(i, programDisplayVO);
         }

  • How to attach jkm for a data model?

    please suggest me.....
    i want to use journalizing for a data model so i need to give jkm for that how can i give jkm in the journalizing tab of that particular model

    Hi,
    You need to import the JKM into your project .
    Then goto your model --->journalizing tab and select your JKM imported in the project .
    Thanks,
    Sutirtha

  • How to create process chain for this data flow

    Hi experts,
    My data flow is:
    ======================================
    2lis_11_vahdr->Transfer rules->2lis_11_vahdr->Update rules->DSO1->Transformation->DTP->Cube1.
    2lis_11_vaitm->Transfer rules->2lis_11_vaitm->Update rules->DSO1->Transformation->DTP->Cube1.
    ======================================
    2lis_12_vchdr->Transfer rules->2lis_12_vchdr->Update rules->DSO2->Transformation->DTP->Cube1.
    2lis_12_vcitm->Transfer rules->2lis_12_vcitm->Update rules->DSO2->Transformation->DTP->Cube1.
    ======================================
    2lis_13_vdhdr->Transfer rules->2lis_13_vdhdr->Update rules->DSO3->Transformation->DTP->Cube1.
    2lis_13_vditm->Transfer rules->2lis_13_vditm->Update rules->DSO3->Transformation->DTP->Cube1.
    ======================================
    Here for each datasource info package brings data upto dso and then from dso dtp fetches the data.
    For deltas i want to keep this data flow in process chain.
    Anyone please guide me how to keep this in a process chain.
    Full points will be assigned.
    Regards,
    Bhadri m.
    Edited by: Bhadri M on Sep 2, 2008 7:20 PM
    Edited by: Bhadri M on Sep 2, 2008 7:21 PM

    Hello,
    Sure it is possible to maintain that dataflow.
    Start here:
    This is a very good document about process chains:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    Let me know if you have any doubts.
    Regards,
    Jorge Diogo

  • Auto created FK columns in data modeler

    Newbie to sql data modeler and have this question.
    When created a relational model, it automatically generated many extra columns for Foreign Keys with notion of (1,2,..) Is there a setting to disable it. I like to have the generated DDL not to include these extra columns . Thanks.

    Hi,
    you can create foreign keys in two ways:
    1) using table dialog - no new FK columns are generated
    2) using "New FK Relation" tool - new FK columns are created automatically; However you can tune the process to your preferences:
    - "General Options>General" page - select "Show properties dialog on new object" - as result FK dialog will appear when new FK is created;
    - "General Options>Model>Relational" - select "Delete generated FK columns" - auto generated FK columns are here to help - you always have to define FK columns as part of FK definition (no functional FKs in current release) - you can replace these columns with existing columns and auto generated FK columns will be removed automatically (this cause only auto generated columns).
    At the end you can find that auto generated columns are not that bad.
    Philip

Maybe you are looking for

  • Problem with htmldb 2 (Sorry APEX)!

    I installed htmldb 2 on a windows XP, Oracle 10gR1 (which has enhanced by companion CD downloaded form Oracle's site). Everything went OK but when I want to connect to it by this url: http://localhost:7777/pls/htmldb it takes my username,pass but say

  • My iPad is being used at home on wifi but some how running up 8gb in a month of mobile data charges??? It's a pad 2

    As above since getting my iPad replaced I used almost 6gb last month but was using it on 3G for a week. In July only used it on home wifi network but orange say I have used 8gb of mobile data and slapp me with a 250 quid bill. Help! I am not thick i

  • How do I select a backup on icloud

    My Iphone 5 was stolen on Sunday. I went to AT&T today and got a new Iphone 5. My problem is this. I want to restore the phone with my backup from the old phone. How do I do that.

  • XML JAXB Binding issue

    Hi All Im using Webservices in which i need to Bind my XML to Java objects and reverse. Im trying to use JAXB (1.0) Ref Imp from SUN as binding framework. The problem which im facing is that for elements like: <xs:element name="inputRequests"> <xs:co

  • PHP logical operators

    I have the following line of code that works fine in a page: if(($_POST['Alsubmit']) && (isset($unique) == FALSE)) the code checks that the Alsubmit form has been submitted, AND that the text input is unique, $unique is a statement that says "you alr