Problem in creating a Persistent Class

Hi All,
I am working on Persistent Classes for the first time. I have tried to gain some info by going through some related threads and of course Thomas' Blog on Persistent Classes.
My Problem:
I have been trying to create a Persistent Class that takes fields from multiple database tables (KNA1 and KNVV).
I wasn't able to generate mapping successfully.
So, the solution was to create 2 Persistent Classes and create a data model class for these two (It was mentioned in one of the threads)
I have been trying to create a Persistent Class for the fields from table KNA1 (I need only some 11 fields)
When I activate, I again get a warning 'No mapping exists for the fields' as a result of which the main class is not activated.
I read somewhere that all fields from a table needs to be included in the 'Inclusion area', otherwise, the class doesn't activate.
So I tried creating a view, but I get another warning message saying 'Database operations with view are not allowed' and the main class remains unactivated.
Please suggest.
Also, if there are any related materials on how to deal with multiple tables, I would be more than glad.
Thanks for all your time.

If you are creating a persistent class for SAP tables, then effectively you are attempting to update the tables directly.  And that is a really bad idea.
See [here|regarding updation of database table...; and [here |Important points to be cautios of when updating a standard table; for more discussion on that topic.
Only create persistent classes for database operations on your own tables.
I guess your classes are failing because you haven't done the mapping.  Did you click on the button marked "persistence" on the SE24 view of your ZCL class?
matt
One more thing - it's against the forum rules to ask for material and links...

Similar Messages

  • Problems in actvating a persistent class

    Hello All
    I have created a persistent class. When I am trying to activate it I am getting a
    message in status bar that
    'There is no mapping defined for one or more fields'.
    I have defiend 4 attributes in the class - then clicked on the PERSISTENCE tab in
    in the main toolbar, gave the table name and mapped the table fields to the class attributes. Still I am getting the message.
    Could anyone please suggest why this is happening?
    Also could anyone please explain to me why do we always need to define the instantiation as "protected" when creating a persistent class.
    Thanks in advance.
    Regards
    Indrajit

    Hello All,
    The problem is solved.
    I was of the understanding that I can take only few of the table fields and map it to class attributes. So I took only 4 fields of the table SPFLI and mapped it to the corresponding 4 attributes of the persistent class. So I was getting the message that
    'There is no mapping defined for one or more fields'.
    So I tried by defining class attributes corresponding to all fields of the table and mapped accordingly all table fields. This time I could activate the class.
    This I believe is a constarint because one may not be really interested in all fields of the database table.
    Regards
    Indrajit

  • Problem with creating my own class...

    Hi all,
    Purpose with this program:
    I want to create my own class StringThing which take a string parameter and transform the content toUpperCase().
    I have created a simple class StringThing which look like this:
    class StringThing {
    public String upperize (String u) {
    u.toUpperCase();
    return u;
    }And my class where I use the StringThing looks like this:
    import java.io.*;
    class UseStringThing{
    public static void main (String arg[]) throws Exception {
    BufferedReader keyboard = new BufferedReader(
    new InputStreamReader(System.in));
    String s,p;
    System.out.prinln("write a sentence!");
    s=keyboard.readLine();
    StringThing thing = new StringThing();
    p=thing.upperize(s);
    System.out.println(p);
    }Am I not supposed to transform my string parameter in my class by using for instance toUpperCase()? Or is there some fundamental rule or piece of code which I forgot?
    Thanks in advance,
    /Beginner-T-who-ripps-his-hear-over-this-small-problem

    Strings cannot be modified. What this line does:
    u.toUpperCase();
    is to create a new String object. toUpperCase() returns the newly created string and you are ignoring the returned value. What you want to do is:
    return u.toUpperCase();
    or
    u = u.toUpperCase();

  • Change documents with persistent class

    Hi,
    I have created a persistent class and want to use a set-method to change data in the mapped table - nothing special.
    But: Does anybody know if there's a possibility to write change documents for the changed field without calling FMs like CHANGEDOCUMENT_SINGLE_CASE?
    There would be the event if_os_state~changed but unfortunately no information about the changed field itself is available in this event. Is it possible to redefine events?
    Thanks a lot for each answer!
    Best regards
    Jörg

    Hi Narin,
    thanks for your answer!
    The first point is plain to me (although I don't really feel happy about this ) but I have problems understanding your second point because I don't really know what "Business object events" are... I'll try a different phrasing, maybe this is better:
    My persistent class inherits the event if_os_state~changed. Can I redefine this event in my class so that I can add an additional parameter where I can put the information about the changed attribute?
    Jörg

  • On activating persistent class: There is no mapping for one or more fields

    Hi all,
    I'm using an ECC 6.0 system.
    I've just created a persistent class and defined the persistence. When I try to activate the class activating fails and I get the message "There is no mapping for one or more fields."
    I did not, in fact, use all the fields of the database table I defined the persistence on. When I do use all the fields activating the class works without a problem.
    However, as far as I know it should be possible to select only some of the fields when defining the persistence (the only fields I have to select are all the key fields of the table and I've done this).
    Has anybody encountered the same problem or has anybody any idea on this?
    Cheers,
    Kathy

    Hi Kathy,
    this is exactly what I meant.
    If you'd like, then you can also take a look at the documentation: http://help.sap.com/saphelp_nw04/helpdata/en/b0/9d0a3ad259cd58e10000000a11402f/frameset.htm
    There under Mapping, you can find:
    "You must map all columns of a database table to attributes. If you only want to manage some of the columns using Object Services, you must create a database view."
    Making attributes private doesn't change the fact, that you still map all fields. If you have a lot of fields, which you don't want to map, then I will again suggest, that you define a DB-view. This will boost the performance of your implementation.
    In case you need "quality 1st" performance, then I would suggest to use an ABAP implementation with internal tables, instead of the Persistent Service.
    HTH,
    Hristo

  • Error while activating a persistent class

    Hi,
    I have created a persistent class and included fields of the custom table in persistent mapping.
    But when I tried to activate the class I am getting the following error
    Method IF_OS_FACTORY~CREATE_TRANSIENT has already been implemented.
    Pls suggest how this can be resolved.
    Regards,
    Savitha

    Hi Savitha,
    By the error I can deduce that there are multiple implementations done for the method CREATE_TRANSIENT
    of the interface IF_OS_FACTORY which is not recommended..
    So please check the Where used list of that method or interface so that you could come to a conclusion.
    Hope this would help you.
    Good luck
    Narin

  • Updating linked fields in a persistent class

    Hi all,
    If a field of a persistent class is updated, what is the best way to update a related field?
    Scenario:
    A persistent class with public GET/SET access to a table field STUFF, and public GET access to a field CATEGORY.
    Whenever SET_STUFF is called from the outside, the class should also re-evaluate and update CATEGORY.
    The easiest is to modify the SET_STUFF method to determine the new category and update it if necessary. However GET/SET methods are always overwritten whenever the class is regenerated, which happens all too easily. Can this be done a bit more elegantly?
    Most modifications can be done by redefinitions of the agent class and do not get overwritten each time the class it regenerated. e.g. I have done something similar by redefining the DB access methods to update various fields, but for my current requirement the update needs to be immediate, not during save.
    Any input appreciated,
    MIke
    Edited by: Mike Pokraka on Sep 15, 2009 4:12 PM

    Hi Naimesh,
    >
    Naimesh Patel wrote:
    > Updating the field CATEGORY immediatly would lead to some problems while working with Persistent class because of the COMMIT WORK. As soon as COMMIT WORK after the CATEGORY's "save" hits, all pending save request would execute and may update some fields which you don't want to update at that point of time.
    No COMMITs should be performed, that's part of what I'm trying to accomplish. STUFF may change several times during the lifetime of the process and CATEGORY must change with it. When the application finally does a COMMIT WORK then both are written to the DB. (In fact my real scenario involves both transient and persistent instances and multiple callers).
    My objectives are to have a readonly attribute in the persistent class that changes in response to other fields changing. It should behave as though the app is calling a SET_STUFF and a SET_CATEGORY, but the persistent class must retain control of the CATEGORY field as several applications can modify STUFF.
    My current workaround is an UPDATE_CATEGORY method that must be implemented by each caller, so it works. Layering another class above it an option but is a bit of overkill which also makes it a workaround.
    I have found that EXT_HANDLER_WRITE_ACCESS seems to provide something, but the comments in there seem to indicate I shouldn't modify the object info. Unfortunately I have run out of time to experiment this week so the workaround will have to stay for now, but I'd still be interested in a more elegant solution.
    Thanks for the input,
    MIke

  • Regarding persistent classes  & objects

    Hi all,
    I am new to abap objects, please  give me some simple links of persistent classes & object.
    Let me know the difference between persistent classes & other simple classes..
    I ensure you for points!
    cheers.

    Hi,
    Transient and persistent data
    In principle, ABAP programs work with local program data, which resides in the program’s internal session. This data lives only as long as its context – that is, as long as its associated procedure (for local procedure data); its object (for attributes of classes); or its program (for global program data). This data is known as transient. Data that can be preserved beyond the runtime of the program is known as persistent. In SAP Systems, persistent data usually occurs as the content of database tables, but also as the content of files on application and presentation servers.
    To work with persistent data, the system has to load it into transient data objects belonging to the ABAP program while that program is being executed. Then, after processing has been completed, it stores the data in a persistent form again. During this time, the content of the data exists twice: once in the ABAP program (transiently), and once in the appropriate storage medium (persistently). A typical process would be reading data from a database table using the SELECT statement into a transient work area; modifying the work area; and then updating the database table (using UPDATE). In such cases, the contents of transient and persistent data are different in the interim during this process.
    Data in object-oriented programming
    In an ideal object-oriented application, data occurs only as the attributes of objects (if we ignore the local data in methods for the time being). Objects are an aggregation of functions (in methods) and data (in attributes). The description of an object – that is, the class – occurs persistently as a piece of source code, but its attributes exist only as long as the object. However, an object in ABAP Objects is transient in principle. It exists in the internal program session only from the time it is generated (using CREATE OBJECT) until it is deleted by the Garbage Collector. Therefore, to work with persistent data in objects, you must program access to where those objects are stored within the methods of the class.
    However, in completely object-oriented business application programming, then it is pointless simply to transfer the classical separation of data and functions to the methods – that is, to work with objects, but use procedural programming within the objects themselves. Ideally you could save the encapsulation of data and functions persistently within the object instead. A program could then leave an object in a certain state and a second program could continue working on the object in that state. Classes of objects are already persistent anyway, but you need some way of saving the attributes of an object persistently and then make reference to the appropriate class. The Persistence Service allows you to do exactly that.
    Persistent Classes
    To use the Persistence Service for objects, the classes of these objects must be created as persistent classes in the Class Builder. The term persistent class does not imply that a class is persistent. (As a template for objects, every class is persistent). Rather, it means that the objects of that class and their state are managed by the Persistence Service. For example, the objects of these classes are instantiated in the ABAP program with a method of the Persistence Service, which ensures that the initialization is correct (not with the usual CREATE OBJECT statement). When the Class Builder creates a persistent class, it automatically generates an associated class, known as the class actor or class agent, whose methods manage the objects of persistent classes. As well as their identity, persistent classes can contain key attributes, which allow the Persistence Service to ensure that the content of each persistent object is unique.
    Managed Objects
    The objects of persistent classes are managed by the Persistence Service. This means, among other things, that these objects are instantiated with a method of the class actor, not with the CREATE OBJECT statement. These objects are known as managed objects. Objects managed by the Persistence Service can be either persistent or transient.
    Persistent objects must be managed by the Persistence Service. The Persistence Service connects the object and the database.
    Transient objects of persistent classes are also managed by the Persistence Service. For example, the Persistence Service ensures that the object is unique within a program (by checking its key attributes), but not for a connection to the database.
    Plz refer to this link:
    http://help.sap.com/saphelp_nw70/helpdata/en/f5/a3682ebc6911d4b2e80050dadfb92b/content.htm
    Thanks,
    Samantak.
    Rewards points for useful answers.

  • What are exception class and persistant class?

    hi,
    what are exception class and persistant class?
    how are they different from the normal class?
    Regards,
    Anil

    Hii!
      Persistent Classes
    To use the Persistence Service for objects, the classes of these objects must be created as persistent classes in the Class Builder. The term persistent class does not imply that a class is persistent. (As a template for objects, every class is persistent). Rather, it means that the objects of that class and their state are managed by the Persistence Service. For example, the objects of these classes are instantiated in the ABAP program with a method of the Persistence Service, which ensures that the initialization is correct (not with the usual CREATE OBJECT statement). When the Class Builder creates a persistent class, it automatically generates an associated class, known as the class actor or class agent, whose methods manage the objects of persistent classes. As well as their identity, persistent classes can contain key attributes, which allow the Persistence Service to ensure that the content of each persistent object is unique.
      Check out this link
    http://www.sapnet.ru/abap_docu/ABENABAP_EXCEPTION_CLASSES.htm
    Regards
    Abhijeet

  • What  is  Persistancy  Class ?

    What is  Persistancy  Class ?..with  Example  .

    Hi Girish,
       There is a way to avoid building a fully object-oriented program while still working with non-object-oriented relational database. The object services layer now provides a <b>persistence framework</b> that closes the object-relational gap.
    You no longer need to write <b>SQL code</b> as objects are transparently loaded from the database when needed. You must create a <b>persistent class</b>. Choose transaction SE24 and create a persistent class; this class must be protected.
    steps :
    Go to se 24 - choose persistence class
    it will be always protected class.
    next screen will give u the persistence button when u click on that it will ask u to
    add the table or struture.
    now u can see two division of the screen where bottom portion of the screen will list uall the fields available and u need to double click and map to the top portion.
    Save the persistence class and hit back button..
    Whenever u create persistence class zcl_example_persist - it will create two classes - zca_example_persist
    and zcb_example_persist automatically
    Where zca_example_persist is the agent class and zcb_example_persist is base agent class..
    Save and activate.
    Activate the whole class. Now that we have a persistent object to access the database table SFLIGHT, we must access it in a program. Here is a small example to read/write data into SFLIGHT using persistent objects.
    REPORT  ZPERSISTENCECLASS.
    data : l_flight type ref to zcl_persist.
    data : l_flight_agent type ref to zca_persist.
    data : l_seatsfree type i.
    data : l_seatsocc type i.
    l_flight_agent = zca_persist=>agent.
    * CATCH CX_OS_OBJECT_NOT_FOUND .
    *ENDTRY.
    *TRY.
    CALL METHOD L_FLIGHT_AGENT->GET_PERSISTENT
      EXPORTING
        I_CARRID = 'LH'
        I_CONNID = '0400'
        I_FLDATE = '20060701'
      RECEIVING
        RESULT   = l_flight
    * CATCH CX_OS_OBJECT_NOT_FOUND .
    *ENDTRY.
    l_seatsfree = L_FLIGHT->GET_SEATSMAX( ) - L_FLIGHT->GET_SEATSOCC( ).
    if l_seatsfree > 0.
    l_seatsfree = L_FLIGHT->GET_SEATSOCC( ) + 1.
    l_flight->set_seatsocc( l_seatsfree ).
    endif.
    There are lots of other methods and techniques that you can use in persistent classes.
    A demonstration of this can be found in program <b>DEMO_CREATE_PERSISTENT</b>.
    <b>DEMO_QUERY_PERSISTENT</b>
    kindly look into below link for screen shot to create persistence class
    http://erpgenie.com/abaptips/content/view/417/38/
    Regards
    Sathish

  • Problem creating non-persistent Child Objects

    I have the need to create a non persistable child object in the
    jdoPreStore of a parent object. I then perform some tests on the parent
    to determine if the child object needs to be persisted or not. If I leave
    the child non persistent it still writes to the database.
    I was performing the follwoing piece of code
    Class Parent {
    // The relationship is a 0 to many
    public Child createChild() {
    Child child = .....//create non persistent object
    child.setParent(this);
    getChild().add(child);
    It appears that if I remove the getChild().add(child). It does not
    persist (as desired).
    Is this correct behaviour?? I dont think that it should be, but if it is
    then I have a further problem.
    If that child object inherits from another object and you remove the
    getChild().add(child) kodo outputs an invalid object to the database. It
    doesnt insert a row to the child table. But it inserts a row to the
    childs inherited object table. This is now an invalid object and will
    fail upon loading.
    Any help on this would be appreciated.
    Thanks
    Luke.

    JDO has something called persistence by reachability. This means that
    objects do not have to explicitly be marked as to be persistent as JDO
    will traverse the object graph to ensure that all nodes are persistent.
    I think you are seeing this behavior combined with another side
    behavior: Kodo requires that both sides of a relation be set.
    Basically, keep your objects in synch (set both sides of the relation).
    And if you want to hold onto a reference to non-persistent object
    before you decide what to do with it, add a transient field or a field
    marked "persistence-modifier="none"" in your metadata and then process
    those transient fields in jdoPreStore ().
    i.e.
    if (//businessLogic is true)
    persistentField = transientField;
    Luke wrote:
    I have the need to create a non persistable child object in the
    jdoPreStore of a parent object. I then perform some tests on the parent
    to determine if the child object needs to be persisted or not. If I leave
    the child non persistent it still writes to the database.
    I was performing the follwoing piece of code
    Class Parent {
    // The relationship is a 0 to many
    public Child createChild() {
    Child child = .....//create non persistent object
    child.setParent(this);
    getChild().add(child);
    It appears that if I remove the getChild().add(child). It does not
    persist (as desired).
    Is this correct behaviour?? I dont think that it should be, but if it is
    then I have a further problem.
    If that child object inherits from another object and you remove the
    getChild().add(child) kodo outputs an invalid object to the database. It
    doesnt insert a row to the child table. But it inserts a row to the
    childs inherited object table. This is now an invalid object and will
    fail upon loading.
    Any help on this would be appreciated.
    Thanks
    Luke.
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Problems with generating persistent classes

    I've been following the tutorial for generating persistent classes from a
    DB. I'm not having much luck:
    First, with rd-schemagen, how do you tell it to only work on a specific
    schema? I run "rd-schemagen -file schema.xml NBS_ODS_101", but it still
    generates the schema file for all schemas in the DB. Is there a usage
    option for the tool (I haven't been able to find it yet)?
    Second, I have the following tables in my DB: ACT, ACT_ID, ENTITY,
    ENTITY_ID. When rd-reversemappingtool runs on these tables, it creates an
    ID class for ACT (ActId) which conflicts with the class generated for
    ACT_ID (ActId). Since renaming the tables is not an option and I really
    don't want to have to rename classes and change the mapping file every
    time I regenerate, what is a solution for this problem?
    Third, if I do the latter above so I can run the importtool and then I
    run "rd-importtool test\test.mapping", it runs successfully for a bit
    while spitting out information until I get this:
    Exception in thread "main" java.lang.NullPointerException
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.mapForeignKe
    y(ImportTool.java:336)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.mapField(Imp
    ortTool.java:207)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappin
    gs(ImportTool.java:78)
    at com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run
    (ImportTo
    ol.java:408)
    at com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main
    (ImportT
    ool.java:385)

    Abe White <[email protected]> wrote in
    news:[email protected]:
    First, with rd-schemagen, how do you tell it to only work on a specific
    schema? I run "rd-schemagen -file schema.xml NBS_ODS_101", but it still
    generates the schema file for all schemas in the DB. Is there a usage
    option for the tool (I haven't been able to find it yet)?Try using -schemas <comma-separated list of schema names>
    I apologize for the documentation in this area. We're going to upgrade
    the tool and the documentation to a more recent version from our internal
    R&D codebase when our 2.5 release comes out in the next couple of weeks.
    This release will also include a system for customizing the tool's output
    in many more ways.This works:
    rd-schemagen -file schema.xml -indexes false -schemas NBS_ODS_101
    but this does not:
    rd-schemagen -file schema.xml -indexes false -schemas NBS_ODS_101,NBS_SRT_
    101
    Exception in thread "main" java.lang.IllegalArgumentException:
    com.solarmetric.r
    [email protected] = NBS_ODS_
    101,NBS_SRT_10
    1: java.lang.ArrayIndexOutOfBoundsException: 1
    at serp.util.Options.setInto(Options.java:206)
    at serp.util.Options.setInto(Options.java:168)
    at com.solarmetric.rd.conf.Configurations.populateConfiguration
    (Configur
    ations.java:144)
    at com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGenerator.main
    (SchemaG
    enerator.java:690)
    Second, I have the following tables in my DB: ACT, ACT_ID, ENTITY,
    ENTITY_ID. When rd-reversemappingtool runs on these tables, it creates
    an ID class for ACT (ActId) which conflicts with the class generated for
    ACT_ID (ActId)This is a bug, and will also be fixed with 2.5. I can't even think of a
    good way to tell you to work around it for now, unfortunately.I renamed the ID classes to ActOid and EntityOid and changed the .jdo file
    to reflect that. Do you see any problems with this strategy?
    Third, if I do the latter above so I can run the importtool and then I
    run "rd-importtool test\test.mapping", it runs successfully for a bit
    while spitting out information until I get this:
    Exception in thread "main" java.lang.NullPointerExceptionCan you please send the generated .mapping, .jdo, and .java files?
    Unless you want to wait until the 2.5 improvements to debug.I will send you all the files in a zip file by email.

  • Problem in creating Rule Class

    I am trying to build a Rules Application..I am totally a novice in this..Following the examples given in documentation i am trying to do it..
    These are the steps i have donr till now..
    CREATE or REPLACE TYPE Account_History AS OBJECT (
    Account_Id VARCHAR2(20),
    Transaction_Month DATE,
    AvgCash_NonCashTxnRatio FLOAT);
    CREATE or REPLACE TYPE Account_Current AS OBJECT (
    Account_Id VARCHAR2(20),
    Transaction_Month DATE,
    Cash_oNonCashTxnRatioCur_Mnth FLOAT);
    BEGIN
    DBMS_RLMGR.CREATE_EVENT_STRUCT (EVENT_STRUCT => 'AccntCompEvent');
    DBMS_RLMGR.ADD_ELEMENTARY_ATTRIBUTE (
                           EVENT_STRUCT => 'AccntCompEvent',
                           ATTR_NAME => 'Acnt_Hist',
                           TAB_ALIAS => RLM$TABLE_ALIAS('STATISTICS_MV'));
    DBMS_RLMGR.ADD_ELEMENTARY_ATTRIBUTE (
                           EVENT_STRUCT => 'AccntCompEvent',
                           ATTR_NAME => 'Acnt_Curr',
                           TAB_ALIAS => RLM$TABLE_ALIAS('CURRENT_RATIO'));
    END;
    BEGIN
       dbms_rlmgr.create_rule_class (
                   rule_class    => 'Account_Rules',
                   event_struct  => 'AccntCompEvent',
                   action_cbk    => 'RuleExecute',
                   rslt_viewnm   => 'RuleExecuteView',
                   actprf_spec   => 'Action1  VARCHAR2(20),
                                     Action2  VARCHAR2(20)',
                   rlcls_prop    => '<composite equal="Acnt_Hist.Account_Id, Acnt_Curr.Account_Id"/>');
    END;But when i am trying to create the Rule Class, i get error saying that
    Error report:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "EXFSYS.DBMS_RLMGR", line 686
    ORA-06512: at line 2
    06502. 00000 -  "PL/SQL: numeric or value error%s"
    *Cause:   
    *Action:What is the problem in the code..Can anyone help me fix it..Please..
    I want to form a rule which checks if the Cash_oNonCashTxnRatioCur_Mnth is greater than 5 times the value in AvgCash_NonCashTxnRatio..how do i form a rule for this...Please give me some suggestions..
    Can anyone suggest me some good links where i can get more about Oracle Rules Manager..

    Please tell me, if i am creating the rules correctly ot not.. As u suggested to use &lt; instead of '<'.. When i execute the following, it asks me to enter a value for LT.. When i enter <, it throws me a XML Parser error..as follows:
    INSERT INTO ACCOUNT_RULES (rlm$ruleid, RLM$RULEDESC, rlm$rulecond)
    VALUES ('Rule1', 'DepositFollowedbyATMWithdrawalatODDTime',
    '<condition>
         <and join="Acnt_Stats_Hist.AvgCash_NonCashTxnRatio * 5 &lt; Acnt_Stats_Curr.CASH_TO_NONCASH_RATIO_CURR">
            <object name="Acnt_Stats_Hist"/>
            <object name="Acnt_Stats_Curr"/>
         </and>
      </condition>
    ');Error is
    Error starting at line 1 in command:
    INSERT INTO ACCOUNT_RULES (rlm$ruleid, RLM$RULEDESC, rlm$rulecond)
    VALUES ('Rule1', 'DepositFollowedbyATMWithdrawalatODDTime',
    '<condition>
         <and join="Acnt_Stats_Hist.AvgCash_NonCashTxnRatio * 5 &lt; Acnt_Stats_Curr.CASH_TO_NONCASH_RATIO_CURR">
            <object name="Acnt_Stats_Hist"/>
            <object name="Acnt_Stats_Curr"/>
         </and>
      </condition>
    Error report:
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00244: invalid use of less-than ('<') character (use &lt;)
    Error at line 2
    ORA-06512: at "RULES_MANAGER.RLM$VALIDATE_RULE_107363", line 92
    ORA-04088: error during execution of trigger 'RULES_MANAGER.RLM$VALIDATE_RULE_107363'
    31011. 00000 -  "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.This is the code that i am using to create the rules application:
    --STEP 1
    create or replace
    TYPE Account_Details_Curr AS OBJECT (
    ACCOUNT_ID VARCHAR2(20),
    CURRENT_TRANSACTION_DATE DATE,
    TransactionType_CURR VARCHAR2(10),
    TRANSACTION_CHANNEL_CURR VARCHAR2(10),
    TRANSACTION_MODE_CURR VARCHAR2(10),
    ABNORMALITY_REASON VARCHAR2(15),
    SUSPICIOUS_FUND_FLOW_SCORE FLOAT,
    ACCOUNT_AGE FLOAT,
    INACTIVITY_WEIGHT FLOAT,
    CREDIT_AMT_BURST_SCORE FLOAT,
    DEBIT_AMT_BURST_SCORE FLOAT,
    TRANSACTION_AMOUNT_CURR FLOAT,
    Cumm_CshAmnt_RltdAccnt_Day FLOAT,
    ACCOUNT_TURNOVER FLOAT);
    create or replace
    TYPE Account_Stats_Curr AS OBJECT (
    ACCOUNT_ID VARCHAR2(20),
    CUMM_DEPOSITTXN_CNT_CURR FLOAT,
    CUMM_DEPOSITTXN_AMNT_CURR FLOAT,
    CUMM_WITHDRAWALTXN_CNT_CURR FLOAT,
    CUMM_WITHDRAWALTXN_AMNT_CURR FLOAT,
    CUMM_ATM_DEPOSITTXN_CNT_CURR FLOAT,
    CUMM_ATM_DEPOSITTXN_AMNT_CURR FLOAT,
    CUMM_ATM_WITH_TXN_CNT_CURR FLOAT,
    CUMM_ATM_WITH_TXN_AMNT_CURR FLOAT,
    CUMM_CASH_DEPOSITTXN_CNT_CURR FLOAT,
    CUMM_CASH_DEPOSITTXN_AMNT_CURR FLOAT,
    CUMM_CASH_WITH_TXN_CNT_CURR FLOAT,
    CUMM_CASH_WITH_TXN_AMNT_CURR FLOAT,
    CUMM_CLR_DEPOSITTXN_CNT_CURR FLOAT,
    CUMM_CLR_DEPOSITTXN_AMNT_CURR FLOAT,
    CUMM_CLR_WITH_TXN_CNT_CURR FLOAT,
    CUMM_CLR_WITH_TXN_AMNT_CURR FLOAT,
    CUMM_TRS_DEPOSITTXN_CNT_CURR FLOAT,
    CUMM_TRS_DEPOSITTXN_AMNT_CURR FLOAT,
    CUMM_TRS_WITH_TXN_CNT_CURR FLOAT,
    CUMM_TRS_WITH_TXN_AMNT_CURR FLOAT,
    CUMM_TXN_CNT_CURR FLOAT,
    CUMM_TXN_AMNT_CURR FLOAT,
    CUMM_TRANSFER_TXN_CNT_CURR FLOAT,
    CUMM_TRANSFER_TXN_AMNT_CURR FLOAT,
    CUMM_CLEARING_TXN_CNT_CURR FLOAT,
    CUMM_CLEARING_TXN_AMNT_CURR FLOAT,
    CUMM_ATM_TXN_CNT_CURR FLOAT,
    CUMM_ATM_TXN_AMNT_CURR FLOAT,
    CUMM_ATMCASH_DEP_TXN_CNT_CURR FLOAT,
    CUMM_ATMCASH_DEP_TXN_AMNT_CURR FLOAT,
    CUMM_ATMCASH_WITH_TXN_CNT_CURR FLOAT,
    CUMM_ATMCSH_WITH_TXN_AMNT_CURR FLOAT,
    CUMM_ATM_CSH_TOT_TXN_CNT_CURR FLOAT,
    CUMM_ATM_CSH_TOT_TXN_AMNT_CURR FLOAT,
    CUMM_CASH_TXN_CNT_CURR FLOAT,
    CUMM_CASH_TXN_AMNT_CURR FLOAT,
    CREDIT_TO_DEBIT_RATIO_CURR FLOAT,
    DEBIT_TO_CREDIT_RATIO_CURR FLOAT,
    CASHCR_TO_NONCASHCR_RATIO_CURR FLOAT,
    CASH_TO_NONCASH_RATIO_CURR FLOAT);
    create or replace
    TYPE Account_Stats_Hist AS OBJECT (
    ACCOUNT_ID VARCHAR2(20),
    AVG_DEPOSITTXN_COUNT FLOAT,
    AVG_DEPOSITTXN_AMOUNT FLOAT,
    AVG_WITHDRAWALTXN_COUNT FLOAT,
    AVG_WITHDRAWALTXN_AMOUNT FLOAT,
    AVG_ATM_DEPOSITTXN_COUNT FLOAT,
    AVG_ATM_DEPOSITTXN_AMOUNT FLOAT,
    AVG_ATM_WITHDRAWALTXN_COUNT FLOAT,
    AVG_ATM_WITHDRAWALTXN_AMOUNT FLOAT,
    AVG_CASH_DEPOSITTXN_COUNT FLOAT,
    AVG_CASH_DEPOSITTXN_AMOUNT FLOAT,
    AVG_CASH_WITHDRAWALTXN_COUNT FLOAT,
    AVG_CASH_WITHDRAWALTXN_AMOUNT FLOAT,
    AVG_CLR_DEPOSITTXN_COUNT FLOAT,
    AVG_CLR_DEPOSITTXN_AMOUNT FLOAT,
    AVG_CLR_WITHDRAWALTXN_COUNT FLOAT,
    AVG_CLR_WITHDRAWALTXN_AMOUNT FLOAT,
    AVG_TRS_DEPOSITTXN_COUNT FLOAT,
    AVG_TRS_DEPOSITTXN_AMOUNT FLOAT,
    AVG_TRS_WITHDRAWALTXN_COUNT FLOAT,
    AVG_TRS_WITHDRAWALTXN_AMOUNT FLOAT,
    AVG_TXN_COUNT FLOAT,
    AVG_TXN_AMOUNT FLOAT,
    AVG_TRANSFER_TXN_COUNT FLOAT,
    AVG_TRANSFER_TXN_AMOUNT FLOAT,
    AVG_CLEARING_TXN_COUNT FLOAT,
    AVG_CLEARING_TXN_AMOUNT FLOAT,
    AVG_ATM_TXN_COUNT FLOAT,
    AVG_ATM_TXN_AMOUNT FLOAT,
    AVG_ATMCASH_DEP_TXN_COUNT FLOAT,
    AVG_ATMCASH_DEP_TXN_AMOUNT FLOAT,
    AVG_ATMCASH_WITH_TXN_COUNT FLOAT,
    AVG_ATMCASH_WITH_TXN_AMOUNT FLOAT,
    AVG_ATM_CSH_TOT_TXN_COUNT FLOAT,
    AVG_ATM_CSH_TOT_TXN_AMOUNT FLOAT,
    AVG_CASH_TXN_COUNT FLOAT,
    AVG_CASH_TXN_AMOUNT FLOAT,
    AVG_CREDIT_TO_DEBIT_RATIO FLOAT,
    AVG_DEBIT_TO_CREDIT_RATIO FLOAT,
    AVG_CASHCR_TO_NONCASHCR_RATIO FLOAT,
    AVG_CASH_TO_NONCASH_RATIO FLOAT);
    CREATE or REPLACE TYPE AccntsCompEvent AS OBJECT (Acnt_Details Account_Details_Curr,
                                                      Acnt_Stats_Curr Account_Stats_Curr,
                                                      Acnt_Stats_Hist Account_Stats_Hist);
    BEGIN
    dbms_rlmgr.create_rule_class (
    rule_class => 'Account_Rules',
    event_struct => 'AccntsCompEvent',
    action_cbk => 'Rules_Execution',
    rlcls_prop => '<composite equal="Acnt_Details.ACCOUNT_ID, Acnt_Stats_Curr.ACCOUNT_ID,Acnt_Stats_Hist.ACCOUNT_ID"/>');
    END;
    --STEP 3
    INSERT INTO ACCOUNT_RULES (rlm$ruleid, RLM$RULEDESC, rlm$rulecond)
    VALUES ('Rule1', 'DepositFollowedbyATMWithdrawalatODDTime',
    '<condition>
         <and join="Acnt_Stats_Hist.AvgCash_NonCashTxnRatio * 5 &lt; Acnt_Stats_Curr.CASH_TO_NONCASH_RATIO_CURR">
            <object name="Acnt_Stats_Hist"/>
            <object name="Acnt_Stats_Curr"/>
         </and>
      </condition>
    ');I am getting this error and i am not able to proceed further.. Please help me...

  • Problem creating executing entity class program

    i am getting the following error if i try the tutorial which creates an entity class, servlet
    http://www.netbeans.org/kb/60/javaee/ejb30.html
    i have followed each and every step given in the same sequence also. kindly help me out.
    HTTP Status 500 -
    type Exception report
    message
    descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: PWC1391: Servlet.init() for servlet ListNews threw exception
    root cause
    java.lang.RuntimeException: WEB5002: Exception in handleBeforeEvent.
    root cause
    com.sun.enterprise.InjectionException: Exception attempting to inject Resolved Ejb-Ref web.ListNews/newsEntityFacade@jndi: - > NewsEntityFacade into class web.ListNews
    root cause
    javax.naming.NameNotFoundException: No object bound to name java:comp/env/web.ListNews/newsEntityFacade
    note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1_02 logs.
    Sun Java System Application Server 9.1_02

    If you're wondering why you've had no response, it's because your question has precisely nothing to do with the topic of this forum.
    Locking this thread.

  • Improving persistent class performance with on-demand DB reads?

    Hi,
    Something that has been troubling me for some time is the data access design of persistent classes. A persistent class loads the ENTIRE data set when it is instantiated.
    To me this defeats one of the advantages of get/set methods. What I would like is to be able to read data when it is first accessed.
    For example: A purchase order header can be loaded in a few ms. However with items it can take 10 times as long - even more if the items are implemented as persistent classes themselves. If items are only needed half the time, a significant performance gain is realized by only reading items the first time the GET_ITEMS method is called. In my own persistence implementations using BI_PERSISTENT (Nothing to do with ABAP Persistent Classes), I implement this using private attributes to buffer data, along the lines of:
    method get_items.
      if m_items[] is initial.
        m_items = <read and/or instantiate items>.
      endif.
      re_items = m_items.
    endif.
    Using ABAP Persistent Objects this does not appear to be possible since they insist on loading everything up front in the DB mapping or IF_OS_STATE~INIT methods. Is some kind of on-demand reading possible using ABAP Persistent Classes?
    Any input appreciated
    Cheers,
    Mike

    Hi Mike,
    yes, I am also very interested in this topic. While developing my first (and only a mid-complex) persistence application, I am expecting slightly different behaviour of linked persistent objects than you described above. According to the book 'Object Services in ABAP' and lazy loading paradigm mentioned there, the referenced persistent objects should be instantiated as representative objects only, containing no data, and the data should be physically loaded from database only once it's really needed (ie. accessed or explicitly instantiated). This should be the approach preventing the situation of mass chained instantiation of many linked persistent objects where most of them will not be needed, probably.
    This is what they say about instantiation of persistent objects that are linked by persistent references.
    However, since the persistent objects do not allow creating of 1:N relationships (classics: HEADER->ITEMS) via persistent references automatically, then this kind of relationship has to be maintained manually and therefore I expect you having full control of when it is accessed and instantiated for the first time...? What I want to ask here is then: is there any suitable approach which allows to maintain 1:N relationship fully or semi-automatically and which (as a disadvantage) makes the problem for you with 'full' instantiation? Am I missing something? There are also some threads Table attributes and persistent classes  regarding persistent mapping of table-like attributes, but no relevant answers (this should solve my problem as the table of persistent references could be saved then).
    Until now, I have found almost nothing about how the 1:N relationship should be correctly built (only 1:1 or M:1 is supported via persistent references), so I am applying the following approach in my app. Any comments are welcome (excuse some typos, as this is written in Notepad, not on the running system):
    ref_header = zca_header=>agent->create_persistent( ).
    guid_of_header_class = ref_header->get_cl_guid( )."cl_guid is set in IF_OS_STATE~INIT
    guid_of_header_instance =
      zca_header=>agent->if_os_ca_service~get_oid_by_ref( ref_header ).
    ref_header->set_inst_guid(                   "keep header inst. ref. for future lookups
    i_inst_guid = guid_of_header_instance
    lt_r_items = ref_header->create_items(       "lt_r_items = table of items references
      i_cl_guid = guid_of_header_class
      i_inst_guid = guid_of_header_instance
      it_items = lt_items )
    and the method zcl_header->create_items then looks somewhat like this:
    loop at it_items assigning <it_items>.
      ref_item = zca_item=>agent->create_persistent( ).
      ref_item->set_cl_guid( i_header_cl_guid = i_cl_guid ).
      ref_item->set_inst_guid( i_header_inst_guid = i_inst_guid ).
      ref_item->set_some_other_attrib(
        i_some_other_attrib = <it_items>-some_other_attrib
      append ref_item to rt_r_items.             "rt_r_items = table of items references
    endloop.
    I have created a secondary index on items for header_cl_guid and header_inst_guid. This is used during the re-load of already saved items for particular header entry. Query service is used with header_cl_guid and header_inst_guid of actual header entry as filter criteria for item pesistent objects and table of item references is returned. Thus the instance attribute lt_r_items of ref_header is filled with references to relevant items again.
    Thank you
    Michal

Maybe you are looking for