Id column values for null objects

If I have something like the following, where B.id is mapped to an INTEGER
column in A's table, Kodo wants to store a NULL value into the column. This
doesn't work if the column is specified as NOT NULL. Is there a way to
configure Kodo to use some predefined integer value instead, such as 0
or -1?
class A {
int id;
B b;
class B {
int id;
A a = new A();
a.id = 123;
a.b = null;
pm.makePersistent(a);
pm.currentTransaction().commit();

I'm not sure what you mean by "value mapping." In my case, I am mapping a
null reference to another object. I am using application identity. Here's a
more complete example (still very abbreviated, but hopefully complete
enough):
class A {
static class Id { int id; }
int id;
B b;
class B {
static class Id { int id; }
int id;
int value;
create table A (ID integer not null, BID integer not null)
create table B (ID integer not null, VALUE integer)
<jdo>
<package name="test">
<class name="A" objectid-class="A$Id">
<extension vendor-name="kodo" key="table" value="A"/>
<field name="id" primary-key="true">
<extension vendor-name="kodo" key="data-column" value="ID"/>
</field>
<field name="b">
<extension vendor-name="kodo" key="id-data-column" value="BID"/>
</field>
</class>
<class name="B" objectid-class="B$Id">
<extension vendor-name="kodo" key="table" value="B"/>
<field name="id" primary-key="true">
<extension vendor-name="kodo" key="data-column" value="ID"/>
</field>
<field name="value">
<extension vendor-name="kodo" key="data-column" value="VALUE"/>
</field>
</class>
</package>
</jdo>
A a1 = new A();
a1.id = 123;
a1.b = new B();
a1.b.id = 456;
a1.b.value = 999;
pm.makePersistent(a1);
A a2 = new A();
a2.id = 789;
a1.b = null;
pm.makePersistent(a2);
pm.currentTransaction().commit();
The inserts for table A look something like this:
insert into A (ID, BID) values (123, 456)
insert into B (ID, VALUE) values (456, 999)
insert into A (ID, BID) values (789, NULL)
The NULL value fails because the column is specified as NOT NULL
(pre-existing schema scenario).
What I need to be able to do is specify what value gets inserted for null
object references. Kodo is inserting NULL. I need to insert -1.

Similar Messages

  • ORA-01405: fetched column value is NULL

    Hi All,
    I am using OWB 10gR2 and DB 10gR2. I am getting the following error while executing the mapping,
    ORA-01405: fetched column value is NULL.
    I have used NVL function for the measure columns, but the problem is not solved.
    Can anybody please tell me solution,
    Thanks in advance,
    Siva

    Hi Siva
    It may be that you've taken care of null value in just one place and now, the error is coming
    from somewhere further down the line.
    Regards
    Arif

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • Assigning External content type field column value using Client Object Model

    I have a problem assinging External column value to ListItem object with client object model-based application I'm developing. To be precise, I am able to retrieve data related to external content type by reading external list created from this content type
    but I don't know how to properly use it to assign value to this field. By doing some research on my own I concluded that BDC ID column from external list is the way to go since it uniquely defines selected row from external list but that doesn't
    tell me much since I don't know what to do with it. Currently I ended up with partial solution - to assign plain string value of picker column but that makes this value visible only in "View Properties" option on Sharepoint and not in "Edit Properties"
    which pritty much makes sence since it isn't properly related to rest of the data in specific row. Does someone have a better solution for this?
    Igor S.

    I think I understand your problem.
    In my example I have an external data column "Beneficiary Name", using a Beneficiary external content type (accessing a table of beneficiaries in a SQL table).
    I want to set the "Beneficiary Name" property using the client object model. I know the name of the beneficiary but not the ID value.
    It is a fairly simple solution. You just need to identify the name of the property SharePoint assigns to the ID field, in my case it is called "Beneficiary_ID". Then set the two properties as follows:
    thisItem["Beneficiary_Name"] = "Charitable Trust";
    thisItem["Beneficiary_ID"] = -1;
    thisItem.Update();
    Setting the ID property to -1 causes the server to do an automatic lookup for the ID from the value assigned to the item.

  • Programatically setting column values for table

    hi...
    I am programatically setting column values for table.
    But these values are not getting reflected on table after commit.
    I mean to say,new values are not persisted after commit.
    The code is as follows,It is in Application Module class
    public void createRecord()
    OAViewObject vo = (OAViewObject)this.getOpptyLoeVO1();
    if (!vo.isPreparedForExecution())
    vo.executeQuery();
    Row row = vo.createRow();
    row.setAttribute("Id",new Number(850));
    row.setAttribute("Model","Honda");
    row.setAttribute("Role","Team Lead");
    row.setAttribute("Hours",new Number(35));
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    getTransaction().commit();
    Here "Id,Model,Role,Hours" are columns in table .

    Hi,
    is your VO based on an Entity Object?
    If not, you can't update values in the DB using only a View Object!
    If yes, you should control that, in your VO, you have not selected the flag "Read Only" for the EO you want to update.
    Hope this helps you.
    Bye
    Raffy

  • How to avoid to check if a column value is NULL?

    Hi, I'm a newbee in Oracle.
    I have a procedure like this:
    create or replace
    PROCEDURE get_employee
         v_first_name IN VARCHAR2 DEFAULT NULL ,
         v_middle_name IN VARCHAR2 DEFAULT NULL ,
         v_last_name IN VARCHAR2 DEFAULT NULL ,
    To select rows with matching multiple column values, I can simply do this:
    SELECT *
    FROM employee
    WHERE first_name = v_first_name
    AND middle_name = v_middle_name
    AND last_name = v_last_name
    The problem is v_middle_name can be NULL. This means,
    I need check if v_middle_name is NULL, and if it is, I need use "IS NULL" instead, like this:
    SELECT *
    FROM employee
    WHERE first_name = v_first_name
    AND middle_name IS NULL
    AND last_name = v_last_name
    It seems very cumbersome to do a check for each column that can be null.
    Is there a way that I do not need to do a check for every column?
    or is it better to avoid having NULL values in those columns (and replace them with, say a space) ?
    Thanks in advance.
    Simon

    Normally, you would do something like
    SELECT *
      FROM employee
    WHERE first_name = NVL( v_first_name, first_name )
       AND middle_name = NVL(v_middle_name, middle_name )
       AND last_name = NVL(v_last_name, last_name )Of course, if you can ensure that NULL data is not allowed (without creating phony non-NULL data), that is a good thing. In most systems, for example, it is probably reasonable to require a non-NULL first and last name. But you almost certainly cannot require a middle name.
    Justin

  • Column chart dataprovider null object refrerence #1009

    hi
    i have one column chart whose data provider initially is set to httpservice's lastresult . i have created one function to load chart with new data on one button click. when i click that button the chart should be loaded with new data so i have written in click function of button.... chart.dataprovider=gettdata.lastresult.people.person;..... but when i run the code and click the button i gives the error
    TypeError: Error #1009: Cannot access a property or method of a null object reference...... but when i again click dismiss button of error and click the button to get new data the chart gets loaded with new data........
    i am using flexlib's mdIWINDOW as parent of column chart... please help

    Thanks Arthur.
    Your first suggestion is effectively what I'm doing as a
    workaround. But it is a bit of a pain to have to account for this
    each time when displaying a chart. It's a particular problem when
    you don't know in advance what "categories" might be returned by
    the data and that have to be charted.
    My biggest concern is that this looks like a bug, and the
    fact that it seems to occur intermittently is a bit worrying. (I
    also know that eight out of ten reported "bugs" are user error,
    which is why I was wondering if anyone else had experienced this.)
    About your second suggestion, I think the interpolateValues
    property only applies to lineSeries.

  • Single query for displaying all but 1 column values for all tables

    Hi,
    All the tables have SYS_CREATION_DATE column.
    But I dont want to display this column value
    Can someone suggest some way in which i could achive this?
    Oracle version:11gR1
    OS:SunOS
    Cheers,
    Kunwar
    Edited by: user9131570 on Jul 6, 2010 7:57 PM

    user9131570 wrote:
    @Tubby
    I *want to display table-wise the values of all but 1(SYS_CREATION_DATE) columns in my database.*
    I need this in order to compare it to another database for all these values .Let me make a wild guess at what you are getting at.
    Given these two tables
    create table emp
       (empid number,
        empname varchar2(15),
        empaddr   varchar2(15),
        sys_creation_date date);
    create table dept
       (deptid number,
        deptmgr varchar2(10),
        sys_creation_date date);you want to somehow combine
    select empid,
             empname,
             empaddr
    from emp;with
    select deptid,
             deptmgr
    from dept;into a single sql statement?

  • 1009 error for null object reference-how to fix/workaround?

    Hi,
    A while ago, with help on the forum, worked out a script (AS3) for a tween animation to demonstrate breathing in and out for an eLearning lesson exercise. There are buttons to pause and unpause/resume the animation.
    These pause and unpause/resume functions throw a 1009 error if the pause button is clicked at the moment that the tween is changing from expanding to contracting. So, most of the time, no error. But every so often, if clicked at the turning point, the 1009 error displays in debugging.
    The error points to the line:  _paused == null ? pauseAnimation():unpauseAnimation(); which is part of one of the pause functions. And the error also points to a conditional in a second pause function which is probably the beginning attemp to execute the script in it: if (_tX.isPlaying) {
    I have tried different ways of changing the script but cannot prevent the error. Any help would be appreciated.
    I've included the full pause function script below:
    // pause/unpause
    function pauseButtonClick2(e:MouseEvent):void {
        _paused == null ? pauseAnimation():unpauseAnimation(); error 1009
    // pause
    function pauseAnimation():void {
        // if Tween _tX is running
        if (_inhale) { //error 1009
            // stop the Tween       
            _tX.stop();
            _soundChannel.stop(); //soundChannel playing inhale sound mp3
             _exitButton.visible = false
            indexBtn2.visible = false;
            // record what is paused
            _paused = "tween";
        } if (!_inhale) {       
            _tX.stop();
            _soundChannel.stop(); //soundChannel playing exhale sound mp3
            _exitButton.visible = false
            indexBtn2.visible = false;
            // record what is paused
            _paused = "tween2";       
            else{
            // timer is running
            // stop the timer
            _timer.stop();
            exitButton.visible = false
            indexBtn2.visible = false;
            // record what is stopped
            _paused = "timer";
        _pauseButton2.visible = false
        _exitButton.visible = true;
        _exitButton.alpha = .5;
        indexBtn2.visible = true;
        //indexBtn2.alpha = .5;
        _resumeButton2.visible = true;
        //_resumeButton2.alpha = .5;
    // unpause
    function unpauseAnimation():void {
        // unpause accordingly
        switch (_paused) {
            case "tween" :
                _tX.resume();
                _soundChannel = _inhaleSound.play()
                break;
            case "tween2" :
                _tX.resume();
                _soundChannel = _exhaleSound.play()
                break;
            case "timer" :
                _timer.start();
                break;
        // reset what was paused
        _paused = null;
        _pauseButton2.visible = true;
        //_pauseButton2.alpha = .5;
        _exitButton.visible = false;
        indexBtn2.visible = false;
        _resumeButton2.visible = false;
    Error 1009:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at FLNav9exp_fla::MainTimeline/pauseAnimation()[FLNav9exp_fla.MainTimeline::frame6:305]
        at FLNav9exp_fla::MainTimeline/pauseButtonClick2()[FLNav9exp_fla.MainTimeline::frame6:300]

    I've been trying to fix, still unsuccessfully, so hopefully I've restored script to above (simply cut and pasted it from above) before adding your script.
    Got the following, which differs from original error locations:
    Attempting to launch and connect to Player using URL C:/Users/Stephen/Desktop/bejeweled(1)/flashinglights/latestfiles/exp/FLNav9exp-app.xml
    [SWF] FLNav9exp.swf - 1687237 bytes after decompression
    10 10
    BPM input: 10
    Minute: 1, BPM: 10
    Inhale/exhale cycle: 1
    a
    false
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at FLNav9exp_fla::MainTimeline/pauseAnimation()[FLNav9exp_fla.MainTimeline::frame6:317]
        at FLNav9exp_fla::MainTimeline/pauseButtonClick2()[FLNav9exp_fla.MainTimeline::frame6:300]
    However, each time I run and get an error, there is a different error line. But, one error line remains consistent:
    function pauseButtonClick2(e:MouseEvent):void {
        _paused == null ? pauseAnimation():unpauseAnimation(); error 1009: this line

  • Issue in IP - Entering value for Characteristic object

    Hi Expert,
    I have a requirement where the input has to be unabled for characteristic objects through IP template.
    I did the development as per the blog:
    http://scn.sap.com/blogs/Christopher.sapbw/2012/12/25/master-data-planning-with-sap-integrated-planning-sap-ip
    The issue is the development should have been done by using Super class CL_RSMD_RS_BW_SPEC. But could not use it as super class as i could not modify the methods in this case. Instead i made a copy of this class and did some modifications to the class. The class is not working for me. Its throwing the following error.
    Please let me know if you have come across similar issue, and how to resolve it.
    Thanks,
    Anupama

    Hi Anass,
    I was able to solve the issue partially. Not getting the error now, but i am still not able to save the entered data back to the real time cube. I am using the analysis office for my development and using the standard save button on Analysis office.
    Please help.
    Thanks,
    Anupama

  • Update Upper row column value in null column in sql 2008

    Hi All,
    I want to update Upper row value into lower null value column dynamically . i have 10000 record .
    any one have  sql query or any idea.Please help 
    Akhilesh Sahu Sr.Software Developer

    Hi akhilesh,
    Based on your description, you want to Sorting by a specified order that NULL value should be located in the bottom of some columns. If in this scenario, we can try to add a calculated field to convert the values of the field to A, B depend on the specified
    order. Then Sorting the field by A to Z to achieve your requirement. For more details, please refer to the following steps:
    Right-click the dataset to add a calculated field named Order with the expression like below:
    =iiF(Fields!CircleId.Value="","B","A")
    Right-click the report item to open the properties dialog box.
    Click Sorting in the left pane, then add a sorting as below:
    Sort by: [Order]                                                           
    Order: A to Z
    If you have any other questions, please feel free to let me know.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Possible to set the Created_by column value for File Browse?

    I'm using database account authentication and then a user gets to upload a file. Then my stored procedure reads the file. I was investigating a problem, happened to search the apex_workspace_files view and noticed the created_by column is always set to APEX_PUBLIC_USER for the files my users upload. Is there some way I can set that value when they log in, so I can track who actually did the upload?
    Thanks,
    Stew

    Dimitri,
    I was just using the standard File Browse item, so getting the blob from the workspace view. Though I've seen notes here about loading to your own table, what I had seemed to work (and was done) fairly well. There were just these little features I wanted to use...
    Thanks for the suggestion.
    Dave, I'm not sure which stored procedure you're suggesting I add the apex_custom_auth.get_username value to? I hoped that the internal File Browse routine would pick up the get_username value automatically instead of the application definition Public User value.
    Thanks,
    Stew

  • Get column value for specific columns

    I want to change the default behavior of a IKM. In a specific step, I need to call a PLSQL procedure inside the loop below, and that procedure will substitute the insert clause. The procedure uses only some attributes, and I need to check the name of each one when I use the getColList method.
         for aRecord in myCursor loop
              insert into      <%=snpRef.getTable("L","TARG_NAME","A")%>
                   <%=snpRef.getColList("", "[COL_NAME]", ",\n\t\t\t", "", "((INS AND (NOT TRG)) AND REW)")%>
                   <%=snpRef.getColList(",", "[COL_NAME]", ",\n\t\t\t", "", "((INS AND TRG) AND REW)")%>
              values
                   <%=snpRef.getColList("", "aRecord.[COL_NAME]", ", \n\t\t\t", "", "((INS AND (NOT TRG)) AND REW)")%>
                   <%=snpRef.getColList(",", "aRecord.[COL_NAME]", ", \n\t\t\t", "", "((INS AND TRG) AND REW)")%>
         end loop;
    For example, to call the procedure I do that: schema.proc_1(col1, col2, col3). However, I have more than 3 columns, and I need to restrict them when I use the getColList method. I would like to know if there is a way to get only specific columns, giving these names. I pass the name of the column, and the method should return its value. Can I use the getColList to do that? Is there any other way to do that?

    Hi Luciene,
    You can use the UD flags to do this. If you click on one of your mappings in the Diagram tab of your interface you will notice several UD flags (UD1 to UD5) you can use those to flag the columns you want to use in proc_1.
    To summarize:
    - at the interface level flag the columns you want to use in your PL/SQL code -> check UD1 for all of them
    - modify your IKM code:
    <%=odiRef.getColList(",", "COL_NAME", ",\n\t\t\t", "", "((INS AND TRG) AND REW AND UD1)")%> <- retrieve columns flagged with insert, not read only, mapped on target and with UD1 flagged. The "AND UD1" part can be used in other getColList.
    Hope this helps.
    Thanks,
    Julien

  • Where do you get the values for the object and ID paramters in authority-c

    Hoping this is simple - could not find anything already posted on this.
    My code works (copied from another program):
    AUTHORITY-CHECK OBJECT 'S_TCODE'
                             ID 'TCD'
                             FIELD 'SE38'.
      IF sy-subrc NE 0.
         MESSAGE Z1000
        'You are not authorized to execute this program'.
      ENDIF.
    This is checking to be sure the user can run SE38.
    I want to know where I can find a table, etc. that has the S_TCODE. and the ID 'TCD'.
    I want to see what other values i could use for checking items like this.
    Thanks.

    Hi Scott,
    Check the table TOBJ.
    Happy coding...

  • Invalid character value for info object

    Hi Experts,
    Iam getting this error,when loading master data
    Value 'H4-LAMPE 'for characteristic 0Material is in External Format.
    0Material : Data Record 1 ('000000000009') : Version 'H4-LAMPE ' is not valid.
    i have checked in transfer rule, the column Conversion is not checked. but this is disabled to check.
    RSKC also does not helpfull.
    in R/3 also length set to 18.
    pls suggest me any solution.
    Thanks
    Sanjay

    The issue with the data is the trailing space. SAP BW doesn't like leading or trailing spaces in the data and the routine that uses RSKC doesn't account for that. Try adding the following into your Transfer Rules:
    CONDENSE field NO-GAPS.
    If you're on BW 7, create a Formula in the Characteristic Rules of the Transformation for this and use the R_TRIM function.
    Edited by: Dennis Scoville on Aug 27, 2009 11:30 AM

Maybe you are looking for

  • The process to change apple ID's on iPhone 4s without effecting apps

    To give a bit of background on my situation, I bought my first iPhone (4s) a few months ago, and when I bought it the cell phone sales representive asked if I had an Apple ID. At the time I told him no, because I did not know exactly what it was so f

  • Idoc issue in AFS-Retail.

    one of our customers require the following criteria for VAT & Surcharge Calculation: AS PER SAP Customer's requirement TAXABLE AMOUNT 1695.83 TAXABLE AMOUNT 1696.37 VAT-5.50% 93.79 VAT-5.50% 93.30 S/C-10% ON VAT-5.5.% 9.38 S/C-10% ON VAT-5.5.% 9.33 B

  • DW CS3 Problem...

    Hi, i am created HTML Page ,in that i need to Call the XML Data using SpryXML Data Set.When I click the SpryXMLDataSet it showing Error.Like Below... "when i press the spry xml dataset ,it show error while executing on load in spryXMLDataset_Basic.ht

  • My Ipad3 is very slow after installing 8.02 and needs a hard reset every 2 minutes.

    Hello Community, I had a wonderful running Ipad3 32gb running on IOS7, now after installing IOS8.02 this device is slow (e.g. Safari) and needs a restart (hard reset) every to minutes because it freezed up. I´m quite unhappy. I tried to stop processe

  • Opening of form is very slow

    Hello, I've installed SAP 2005A on a Vista computer. My problem is the opening of the forms is very slow. Does anyone knows the reason of that. Thanks.