4 specific entity beans or 1 general entity bean?

Hi All,
My question is for example for design a history concept,
I have 4 tables with same size PK and I'm going to design history table, now my question is which way is better to do:
1. create 4 history tables with having FK to original tables , create 4 entity beans
2. create 1 history table without any FK, create just 1 entity bean.
please let me know what's your suggestion?
Thanks so much
Mina

Good question minag ! ...
I suggest this model:
If your like flexibility on your system I recommend use Entity EJB 3 inheritance strategy with discriminator value. It implies 5 entity beans mapped on 5 tables.
A. Abstract Entity Bean: History
B. Implementations of History: HistoryTypeA, HistoryTypeB, HistoryTypeC, HistoryTypeD.
Your can get more info on EJB 3 Persistence Specification item 2.1.9. (ejb-3_0-fr-spec-persistence.pdf).

Similar Messages

  • Refering to entity instances from a more specific entity context

    I have the global entity and two non-singleton entities; the obligation and the invoice. There are multiple obligations, and each obligation has multiple invoices, so it is a classic hierarchical entity structure.
    When I write a rule in the context of 'the invoice', I can't seem to be able to refer to the parent 'obligation' that owns the invoice, but I understand that I should be able to because there is no ambiguity as to which obligation I am referring to.
    Is this different now in version 10 of OPA? Does it require For()? Does anyone have an example of such a reference?

    Hi Michael,
    Had another look at this after we chatted. You need to use the 'For' function and the reverse text of the relationship between obligations and invoices.
    I have an example with the following entities:
    Global -- one-to-many --> the cat (Relationship text: the cats)
    the cat -- one-to-many --> the cat's toys (Relationship text: the cat's toys; Reverse relationship text: the toy of the cat)
    Here's an example rule which infers something about the cat's toy from something about the cat:
    the cat's toy is happy if
    …..For(the toy of the cat, the cat is happy)This compiles and runs fine in the debugger. Looks like we can't add attachments to posts on the external forum, but I can email the example to you separately.
    Cheers,
    Jasmine

  • Problem buying a specific track, not tracks in general

    Over in the regular Music Store they're suggesting that I
    post this here even though it's not my setup that's the problem.
    I am having a problem downloading a specific track, other
    purchases work OK. The problem is obviously in the Store,
    but iTunes Support waits 3 days to reply with a canned
    e-mail blaming my "firewall" or my "web accelerator"
    software. I don't need Technical Support; my software is
    working fine. I need someone to fix the item in the store.
    I am trying to purchase the track:
    Artist: Oregon
    Title: The Glide - Single
    The track is listed in the Store and is available
    to Preview, but when I try to buy it I get:
    Could not purchase "Unknown". An unknown error
    occurred (5002).
    There was an error in the Music Store. Please try again later.
    This has been happening for 9 days now and I've tried
    to buy it from 4 different computers. I do not
    have trouble buying other tracks. It looks like
    there is a problem with the store, not my computer.
    Thanks-
    TrackID: 1046351

    Well, no doubt that "the issue has been passed to the people in charge". However, I have the feeling that if such a problem was happening to a track in the bestselling iTunes store list, the people would be far more in charge, and it would be fixed in a couple of hours instead of a couple of months, if ever.

  • Oracle Application Server 10.1.3, error when deploying entity bean

    I am using 9.0.4.2 and am planning to upgrade to 10.1.3. When trying to deploy the application to 10.1.3 I get the following error for an Entity Bean with Container Managed Persistence
    006-03-20 10:05:51.436 NOTIFICATION Error while compiling EJB component: file:/C:/oc4j/j2ee/home/ap
    plications/ipower/InstitutionMgrSer-EJB.jar
    06/03/20 10:05:51 WARNING: EJBContainer.postInit Error generating wrappers for file:/C:/oc4j/j2ee/ho
    me/applications/ipower/InstitutionMgrSer-EJB.jarcom.evermind.compiler.CompilationException: Method p
    ublic abstract int com.eplinc.gv.bus.instmgr.AccessibleTrailerBean.getInstitution() can not be decla
    red abstract for entity 'AccessibleTrailerBean'
    at com.evermind.server.ejb.compilation.CMPObjectCompilation.verifyMethods(CMPObjectCompilati
    on.java:782)
    at com.evermind.server.ejb.compilation.CMPObjectCompilation.<init>(CMPObjectCompilation.java
    :56)
    at com.evermind.server.ejb.compilation.PersistenceManagerCompilation.<init>(PersistenceManag
    erCompilation.java:30)
    at com.evermind.server.ejb.compilation.EntityBeanCompilation.<init>(EntityBeanCompilation.ja
    va:121)
    at com.evermind.server.ejb.compilation.Compilation.generateAnyOldStyle(Compilation.java:1590
    at com.evermind.server.ejb.compilation.Compilation.compile(Compilation.java:182)
    at com.evermind.server.ejb.compilation.Compilation.doGenerateCode(Compilation.java:250)
    at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:891)
    at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning
    .java:210)
    at com.evermind.server.Application.setConfig(Application.java:391)
    at com.evermind.server.Application.setConfig(Application.java:308)
    at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
    at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:50
    7)
    What am I missing? Note that on 9.0.4.2 and its previous versions the deployment was successful.

    We use EJB2.0 and as per the specifications entity class and getters/setters should be abstract. This is what we have. I have verified the dtd used in ejb-jars and it has references to the correct version. Here is an example <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">. Also the tag <cmp-version>2.x</cmp-version> is included for all the entity beans.
    Now I am just curious to know if anyone has tried deploying Entity Beans 2.0 on a 10.1.3? and if so was the deployment successful?

  • Different maps for every month in FDQM for a single location/Entity

    Hi,
    Is it possible to have different account maps for each and every month in FDQM for a single entity/location.
    The requirement is,client needs to change accounts map each and every month,for eg; if in Jan ,account 1 is mapped to X, in feb same account 1 is mapped to y.
    Could any one tell me if this is possible in FDQM,if yes..how can we maintain different account maps for each period for one specific entity.
    Regards

    This is possible with the appropriate business process. FDM will apply the current map that exists to the current dataset. It will not retroactively change prior periods unless you specifically reprocess the maps (wither by reimporting data or by selecting Process Logic/Maps) for historical data.
    So as a map is updated monthly, the historical data is maintained and the current data uses the "new" map. If for some reason the prior period does need to be reprocessed with the "old" map, you can use the restore function to bring the map back to what it was during that period.

  • Display of contribution to an entity in a data form

    Hi guys
    I'm stuck with a data form which should show base entities contribution to another entity. And they have intermediate entities between like here:
    A
    __B
    ____1
    ____2
    __C
    ____3
    ____4
    So users select elements like A in the Selectable POV and they suppose to see nodes like B.1, B.2, C.3, C.4 in columns. I've written it in a such way in columns:
    C1=E{{{@Cur.[Base]}.[Parent]}.[Base]}. But the table generator says syntax is wrong. Is there a way to show all contributing entitities by choosing their parent for the level hier than a node parent?

    Hi Mary,
    Contribution values work on Nodes which are defined as parent.entity pairs. Therefore, there is no way to directly access the contribution of an entity to an ancestor other than the direct parent.
    However, in some special cases you can achieve this in a very limited way, for a clearly set of non-intercompany accounts. What you can do for these special accounts, is to define them as intercompany, without setting up a plug account (you don't want to do elimination on them) and setting up NoInput rules at base level so that only [ICP None] is allowed for input. Then, for these accounts you write in the consolidation rules:
    If vICP = "[ICP None]" Then
    HS.Con("I#" & HS.Entity.Member , vPCon, "")Else
    HS.Con("" , vPCon, "")End Ifso that during proportionalization your numbers will be redirected from [ICP None] (the input) to the ICP member that represents your contributing entity. The "if" statement prevents this code to do the same during consolidating parent entities.
    Then at the top Entity level you may select the ICP member of the accounts you have applied the technique to see what the specific entity has contributed to the top. This guarantees correct numbers especially if the percentage used in HS.Con is not always 100%, which means that the value at entity B with ICP = 1will not be the same as the value at entity A with ICP = 1.
    Regards,
    --Kostas                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • View all rows in Entity object

    please I have a problem can I one help me
    I want to get all rows from specific Entity object
    example
    I am now in validate method in XXX Entity Object and i want to get all the rows in XXX table from validate method(all rows)
    can any one help me to do that
    thanks in advance

    ya sire
    I want from validate method in EO XXX to validate all the rows in the table XXX
    so I want to get all the rows from validate methods in the EO XXX
    thanks in advance

  • Entity-level screen text substitution

    I am trying to create an entity-level attribute that will allow me to substitute text on an entity-level screen.
    My data model is: Global --> the employer --> the date of the absence from work. When asking about each absence, I want to display the name of the employer on the screen. Because you can only substitute (using public names) attributes at the same entity level as the screen, I need to make an attribute at the level of the absence that is equivalent to the name of the employer.
    How do I do this?
    (I suspect that I need to use ForScope(), but it's not clear to me how to use this to assign a value to a text attribute.)
    Thanks for any guidance you can provide.

    I'm assuming you know how to set up regular substitution where everything is at the same entity level, so I won't go into that.
    To substitute the name of the employer into labels on screens at the entity level below (the 'absence' level), you need to create an attribute at the 'absence' entity level, then infer its value based on the name of the employer. You'll need to use the 'For' function, and the reverse text of the relationship from Employer --> Absence
    There was a related question asked yesterday on the forum (Refering to entity instances from a more specific entity context I'll use the example from that to explain:
    We have the following entities:
    Global -- one-to-many --> the cat (Relationship text: the cats)
    the cat -- one-to-many --> the cat's toys (Relationship text: the cat's toys; Reverse relationship text: the toy of the cat)
    To substitute in the name of the cat into a label on a question screen about the cat's toy, I need to create an attribute at the entity level of the cat's toy ("the cat's toy name substitution variable" in this example). Then set it to be equal to the variable which collects the cat's name ("the cat" in this example), using the 'For' function and the reverse relationship text:
    the cat's toy name substitution variable = For(the toy of the cat, the cat)Then create a public name for "the cat's toy name substitution variable" (e.g. "CatNameSubstitution"), then plug that into the screen label in the usual way, i.e. %CatNameSubstitution%. Since the substitution variable is at the entity level of the cat's toy, it will work.

  • How to create a service with deep insert input but output a single entity?

    Hi Experts,
         I have created a service which has 2 entities.
         DeliveryHeader
         DeliveryItems
         StatusOutput
         Association has been defined for DeliveryHeader and  DeliveryItems.
        My input request message is:
           "DN_No" : "123",
           "ShipTo" : "CNZ",
            "DeliveryItems" : [{
            "DN_No": "123",
            "Item_No": "1",
            "Quantity": "10'
    I want my output to be different entity structure that is of StatusOutput.
        "StatusOutput" : {
             "Code": "100",
             "Text" : "Successfully created DN"
    But I am getting output same as input.
    What I have to do to get the desired output? Please help!
    In my create_deep_entity I have coded like this:
    TYPES:  BEGIN OF t_output.
               TYPES: StatusOutput TYPE ycl_prj_create_dn_mpc_ext=>TS_STATUSOUTPUT,
              END OF t_output.
    x_output-StatusOutput-code = "100".
    x_output-StatusOutput-text = "Successfully created DN".
        copy_data_to_ref(
           EXPORTING
             is_data = x_output
           CHANGING
             cr_data = er_deep_entity ).
    Thanks
    Gopal

    Hello Gopal,
    Have you created association to the StatusOutput entity as well ?
    You would have already Created association with some cardinality ( 1 to N ) between DeliveryHeader & DeliveryItems entities right !?
    Now create association between DeliveryHeader & StatusOutput ( say 1 to N OR 1 to 1 .. based on your requirement ). But here if as per my understanding since u need  only success message and corresponding success message type, u need to create association with 1 to 1 cardinlity between
    DeliveryHeader & StatusOutput entities.
    Now after successful creation send back the message and its code in the deep structure ( structure which can hold DeliveryHeader , DeliveryItems , StatusOutput details )  which you would be already defined to hold all the DeliveryHeader and DeliveryItems details and StatusOutput details.
    This way you can return your message and code as separate entity in the response ( But remember you will be having data in other entities of your DeliveryItems & DeliveryHeader )
    This is what you are expecting if i understand your problem well.
    If at all you want only that specific entity in the response alone,
    As per my knowledge u cant restrict your response like how you are expecting ( only single entity alone with success message ) . Since we are sending back the same input deep structure as part of response you cannot restrict that way.
    At the most you can empty your response forcefully excluding your data structure/table having the success message. However this will not make any sense.
    Regards,
    Ashwin

  • Count entity fields

    Helo I need same help. A have Model created with  OData server and i have same entitys. Now I need to count specific entity informatio. For example I have entity /Users with  Id, Name, Lastname and IsVacation with parameter 1 and 0. How can I go trought the /Users entity and save all users Id where Vacation equal 1. Pls i really need this help

    Using OData you can try to achieve it. Consider the below URI
    http://<serveraddress>:<port>/namespace/SERVICENAME/UsersENTITYSET?$filter=Vacation eq 1&$select=Id
    $filter= Vacation eq 1  --> will get you all the entries where Vacation is equal to 1,this will work as a where condition. However if you are using SAP Netweaver Gateway, make sure that you are handling the $filter in the OData service in the Data provider class.
    $select=Id  -->will get you only the Id property of the entities selected.
    There is an option to count the number of entities using $count.
    Example : <serveraddress>:<port>/namespace/SERVICENAME/UsersENTITYSET/$count
    This will return the number of Users, so instead of the list of Users you get the count of user.
    Unfortunately $count is not a query parameter, so you can not call $count in combination with 'http://<serveraddress>:<port>/namespace/SERVICENAME/UsersENTITYSET?$filter=Vacation eq 1&$select=Id'
    So to achieve your use case you have two options..
    Option 1 : Fire query http://<serveraddress>:<port>/namespace/SERVICENAME/UsersENTITYSET?$filter=Vacation eq 1&$select=Id, receive all the results and count the number using some Javascript.
    However this might give you erroneous result as by default OData model in UI5 fires OData calls with $top and $skip options, which limits yours resultset. You should be careful here..
    Option 2: You can define a function import. Refer to section 3.3 of http://www.odata.org/documentation/odata-version-2-0/uri-conventions/ for details.
    You can define a function import such as CountUsers in the OData service using SEGW(if you are using Netweaver Gateway) which takes parameter vacation as input and returns the users.
    So your URL will be '<serveraddress>:<port>/namespace/SERVICENAME/CountUsers?vacation=0'
    Here CountUsers is the function function import name & vacation is the input parameter. 
    This will be a clean approach.

  • Need help with Entity Calcualtion

    Can anyone help me with a rule. If I want data to be posted to a specific entity after calculation, how can i do this. I tried putting
    E#XXXXX.A#XXXX = formula but the system does not accept this. Can someone please help

    You would need to use an if statement for this rule as you can't have entity on the left of the equation.
    Try
    If HS.Entity.Member = entity123 Then
    hs.exp A#XXXXX = Formula
    End if
    Regards
    JTF

  • Specific Internal Orders for general ledger code (expense)

    Hi
    at the time of data entry,  users enters ill logical internal orders , can we restrict them or provide them any list or object so that they can select specific internal orders for that general ledger.
    it will force them to use that internal orders only.
    is there any standard provision to control this situation ???
    regds
    sanju

    When we got the same requirement, it was implemented via checking a specific internal table in a CO validation rule. (OKC7)
    Regards,
    Raymond

  • Bean Managed Persistence and Object Fields

    I'm having trouble persisting data in the fields in my EJB. I have posted the code for my EJB below:
    package com.kns.account.ejb;
    import java.sql.*;
    import javax.ejb.EntityBean;
    import javax.ejb.EntityContext;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    * @stereotype EntityBean
    public class AccountBeanEJB implements EntityBean
    public int id;
    public String username;
    public String password;
         * The container assigned reference to the entity
         private EntityContext context;
         * @return
         public AccountBeanEJB() {
         * Sets the context of the bean
         * @param ec
         public void setEntityContext(EntityContext ec) {
              context = ec;
              // to do: code goes here.
         * Clears the context of the bean
         public void unsetEntityContext() {
              this.context = null;
              // to do: code goes here.
         * This method is called when the container picks this entity object
         * and assigns it to a specific entity object. Insert code here to
         * acquire any additional resources that it needs when it is in the
         * ready state.
         public void ejbActivate() {
         * This method is called when the container diassociates the bean
         * from the entity object identity and puts the instance back into
         * the pool of available instances. Insert code to release any
         * resources that should not be held while the instance is in the
         * pool.
         public void ejbPassivate() {
         * @return
         public Integer ejbCreate(int theId, String theUsername, String thePassword)
              throws CreateException
    System.out.println("Creating new account");
         String sqlstr = "Insert into Account (ACCOUNTID, USERNAME, PASSWORD)";
         sqlstr = sqlstr + " VALUES(" + theId + ", '" + theUsername + "', '" + thePassword + "')";
         Connection conn = null;
         try
         conn = getConnection();
         Statement stmt = conn.createStatement();
         stmt.executeUpdate(sqlstr);
         System.out.println(sqlstr);
         this.id = theId;
         this.password = thePassword;
         this.username = theUsername;
         System.out.println("Done creating new account");
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
              return new Integer(this.id);
         public void ejbPostCreate(int id, String username, String password) {
         * @return
         public Integer ejbFindByPrimaryKey(Integer key)
              throws FinderException {
              // to do: code goes here.
              this.id = key.intValue();
              return (key);
         public void changePassword(String newPassword)
         this.password = newPassword;     
         * @return
         public int createAccount(String username, String password) {
              // to do: code goes here.
              return (0);
         public void ejbRemove()
         String sqlstr = "Delete * from Account Where ACCOUNTID = " + this.id;
         Connection conn = null;
         try
         conn = getConnection();
         Statement stmt = conn.createStatement();
         stmt.executeUpdate(sqlstr);
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
         public void ejbLoad()
         System.out.println("In ejbLoad");
         String sqlstr = "Select * from Account Where ACCOUNTID = " + this.id;
         System.out.println(sqlstr);
         Connection conn = null;
         try
         conn = getConnection();     
         Statement stmt = conn.createStatement();
         ResultSet rs = stmt.executeQuery(sqlstr);
         if(rs.next())
         this.password = rs.getString("Password");
         System.out.println("password = " + this.password);
         this.username = rs.getString("Username");
         System.out.println("username = " + this.username);
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
         public void ejbStore()
         System.out.println("In ejbStore");
         String sqlstr = "Update Account Set Username = '" + this.username + "', Password = '" + this.password + "' Where ACCOUNTID = " + this.id;
         System.out.println(sqlstr);
         Connection conn = null;
         try
         conn = getConnection();
         Statement stmt = conn.createStatement();
         stmt.executeUpdate(sqlstr);
         catch(Exception e)
         e.printStackTrace();
         finally
         try
         conn.close();
         catch(Exception e)
         public String getPassword()
         //ejbLoad();
         return this.password;
         public String getUsername()
         //ejbLoad();
         return this.username;
         private Connection getConnection() throws ClassNotFoundException, SQLException
         Class.forName("weblogic.jdbc20.pool.Driver");
         return DriverManager.getConnection("jdbc20:weblogic:pool:pwxPool");
         public void removeAccount() {
    It seems like id, username, and password fields are not stored between calls. Here is some sample output from my weblogic server:
    Account found for id = 99
    in ejbStore
    Update Account set Username= 'null', Password ='null' Where accountId = 0
    Does anyone know how to fix this? I'm banging my head on the desk over here. Thank you.

    These functions always return null! Please help me!
    public String getPassword()
    //ejbLoad();
    return this.password;
    public String getUsername()
    //ejbLoad();
    return this.username;

  • Standard BAPI/RFC for customer specific pricing

    Hi all,
    We have a requirement for getting the customer specific pricing for a product. .We have few customers who are privelaged of procuring materials at a lesser price than others.We need a procedure or functionality that will pick this discounted price on the product that is raised by the privelaged customer.
    Please let me know if there is any Standard BAPI or RFC for this requirement
    Keerthi

    Hi,
    There is nothing called customer specific pricing in SAP and there is no BAPI to handle pricing for any specific entity.
    These things need to be configured in access sequence, condition tables, condition types etc and you have to configure  pricing in such a way that the pricing elements are common for everybody but depending on the situation, some customer will get materials for lesser price than others by creating condition records as applicable for each customer.
    You have to first configure the pricing procedure.
    Then while maintaining condition records, you have to maintain prices for specific customers where youcan maintain lesser prices. For all others you can maintain normal prices. For example for c.type PR00, you can have two tables in the access sequence. One table may be Sales org/D.C/Div/Customer/Material and the second table can be S.Org/D.C./Div/Material
    Now maintain a condition record like
    5001/00/00/CUSTOMER A/MATERIAL A  Value is 80
    5001/00/00/Material A  Value is 100
    If condition records are maintained like this, the customer A alone will get the material for Rs.80 while all others will get it for Rs.100
    Hope this helps you. If you have specific doubts, pls lemme know.

  • How do I get specific font to ALWAYS appear in text field whether user has font on computer or not?

    I am designing a simple form to be used as template for OTHER people to type up room signs. We would like the signs to be in a specific font that is not generally loaded on the average computer, and we do not want to have to distribute fonts to a gazillion people. My thought was to create a LiveCycle from, whereby the room user could type their name and title in the text fields on the form, and in theory, it would appear in the font I chose for the text field. I have tried various things, but it always gets substituted by the user's computer.
    Tried: Choosing "rich text" for field format in Object palette; choosing "Embed fonts" in "Save Options"; tried static form, tried dynamic form.  It could be that my test user has such an old version of Reader that it just CANNOT work.
    Thanks!

    The restrictions are listed as "normal." And it does appear as embedded when I go to the document properties, though it didn't until I used it for the text on the form (as apposed to just using in the text fields.) And when another user opens the form, the text appears in the specified font, but once they type in the text field, it defaults to different font.
    BTW, it is an Open Type Font, if that makes any difference.

Maybe you are looking for