Cannot filter data with the extended class

Hello

I have a small question on the PortableObject format. I created a class that extends PortableObject interface and implementation of methods of serializer as well. I've updated in the file config.xml - pof as well. If I insert the objects of that type of object in the cache, they get inserted correctly and I can filter the values based on the getters defined in the class. Everything works fine here.

Now I'm expanding the existing class I. We have our custom API we have built for our domain objects. I need to store these objects in the cache. So, naturally, I need to implement the PortableObject interface for this. So, instead of creating a new class with the new series of getters and setters and local fields, I extend our domain class to create a new class that implements the PortableObject interface. Instead of setting the local fields and getters and setters, I'm reusing those provided by my existing class. Now, I can insert the new class objects in the cache. But I can't filter values for objects of this new class.

Let me show you what exactly I am trying to achieve by giving a small example:

Domain class:

Class person
*{*
private String person_name;

* public String getPerson_name() {return person_name ;} *}
* public String setPerson_name (person_name) {this.person_name ;} person_name = *}
*}*

The new class that implements PortableObject interface:

class ExtPerson extends implements person PortableObject
*{*
public static final PERSON_NAME = 0;

* public Sub readExternal (PofReader reader) throws IOException {*}
setPerson_name (reader.readString (PERSON_NAME));
*}*

* public methods void writeExternal (writer PofWriter) throws IOException {*}
writer.writeString (PERSON_NAME, getPerson_name());
*}*

* / / And HashCode, Equals and ToString methods, all implemented using the Get accessor of the person class *.
*}*

So, if I create a new class ExtPerson extend the Person class and write all methods, store objects in the cache and run the following query, I get the size printed

System.out.println ((cache.entrySet (EqualsFilter ("getPerson_name", "ABC"))) .size ());

But if I use the extended class and insert the values into the cache and if I use the same query to filter, I get 0 displayed on the console.

System.out.println ((cache.entrySet (EqualsFilter ("getPerson_name", "ABC"))) .size ());

So, can anyone say exactly what is the cause?


Thank you!

ContainAnyFilter doesn't work the way you expect.

Here's the java doc.

"Filter that tests a value of Collection or array object returned by a method of containment of any value as a whole."

The return of the object by the get method must be an array of Collection or an object, it will return false if the object of the return of Extractor is not a type of Collection or array.

or in your case, it only works if the getPerson_name() returns an array of strings.

You probably want to use talk.

Tags: Fusion Middleware

Similar Questions

  • Cannot insert data with the PDO function [from: insert and update of the server in the same shape behaviors]

    I feel as if I'm fighting my way around a paper bag trying to insert a record.  I have recently converted from MySQL for PDP, which cannot be applied.  I'm not trying to write routines to update data and started with insert.  I tried the example in your PHP Solutions edition two, pp. 361-363, but I can't get a written account.

    It is a database, which I supported since the host server using phpMyAdmin.  I'm very well display the data on the site, so I guess that my login script is ok.  However, nothing I've tried has got a registered insert.  I tried to get back to the basics, and it still does not work.  This is my current code.  Something is wrong with my statement = $sql and I can't identify the problem.  Help, please!

    If (isset($_POST['insert'])) {}

    try {}

    create the SQL

    $sql = "INSERT INTO Homepage_text (enriched, h_date, h_seq, h_col, p_heading, p_text, h_hide) VALUES ($_POST ['enriched'], $_POST ['h_date'], $_POST ['h_seq'], $_POST ['h_col'], $_POST ['p_heading'], $_POST ['p_text'], $_POST ['h_hide']);"

    $sainttim-> execute ($sql);

    echo "new record successfully created ';

    }

    catch (PDOException ($e) exception

    {

    echo $sql. "< br / > '. $e-> getMessage();

    }

    }

    There are several things wrong with your code:

    • You use elements of an associative array within a double quoted string. Which will cause a parse error.
    • The values you are trying to insert in the database are for most (if not all) of the text fields. If you use a literal SQL query, text fields must be wrapped in quotes.
    • You try to use the method execute() with a literal SQL query. In AOP, execute() only works with a prepared statement. To run a literal SQL query, you must use the exec() method.
    • Passing the values in the array $_POST directly in the database without any sort of validation and without escaping quotes or other characters just asking for trouble.

    Follow the examples in the book, and use a prepared statement. To address all these issues quickly and easily.

  • Cannot filter data through the data portal

    When I bring in a large data file to the portal, clear this check box, then load another data file, the channel filter function doesn't work anymore.  Any ideas what's happening?

    Somehow, all channels pinned, and I does not recognize the PIN icon.  My mistake, thanks for reading.

  • AOP "Query was empty" [from: cannot insert data with the PDO function]

    Now try to DELETE a record.  I select a list and go to the routine to delete.  The record appears, but when I delete, I get an error saying

    Fatal error : Eception exception 'Exception PDOException' with message ' SQLSTATE [42000]: syntax error or access violation: 1065-query was empty ' in /home1/sainttim/public_html/DeleteRec.php:53 stack trace: home1/sainttim/public_html/DeleteRec.php(53) #0: PDOStatement-> execute (Array) #1 {main} thrown in /home1/sainttim/public_html/DeleteRec.php online 53

    I do not understand why the query is empty because the data are displayed on the screen, but assume that I see on the screen is not what is in the table ($_POST ['delete']).  I'm stuck!

    My code:

    $OK = false;

    $deleted = false;

    If (isset($_GET['varpage'])) {}

    $varpageSend = $_GET ['varpage'];

    $NextPage = ' DisplayText.php? varpage = ". $varpageSend;"»

    }

    If ((isset($_GET['recid'])) & & ($_GET ['recid']! = "")) {}

    $delrec = $_GET ['recid'];

    }

    on the other

    {

    $error = "record does not exist!"

    }

    If (isset($_GET['recid']) & &! $_POST)

    {

    prepare the SQL query to view folder

    $sql = "SELECT home_key, enriched, h_date, h_seq, h_col, p_heading, p_text, h_hide FROM Homepage_text WHERE home_key =?";

    RS1 $= $sainttim-> prepare ($sql);

    $OK = $rs1-> execute (array($_GET['recid']));

    $row = $rs1-> fetch();

    $home_key = $row ["home_key"];

    $textpage is "enriched" $row;.

    $h_date = $row ["h_date"];

    $h_seq = $row ["h_seq"];

    $h_col = $row ["h_col"];

    $p_heading = $row ["p_heading"];

    $p_text = $row ["p_text"];

    $h_hide = $row ["h_hide"];

    If ($h_hide == 0) {}

    $h_hide = 'n';

    }

    else {}

    $h_hide = 'y ';

    }

    If (isset ($rs1) & &! $OK) {}

    $error = $rs1-> errorInfo();

    If (isset($error[2])) {}

    store the error message if the request fails

    $error = $error [2];

    }

    }

    }


    If (isset($_POST['delete']))

    {

    NEW code

    $deletesql = "DELETE FROM Homepage_text WHERE home_key =?';"

    $stmt = $sainttim-> prepare ($deleteSQL);

    $deleted = $stmt-> execute ($row);

    If (! $deleted)

    {

    $error = "There is a problem to remove the record.";

    }

    else {}

    Header ('Location: '. $deleteGoTo);

    "exit";

    }

    }


    Form:

    Entry < h1 > delete of <? PHP echo $varpageSend;? > Page < / h1 >

    <? PHP if (isset ($error)) {}

    echo "class < p > 'errormsg' = > error:". " $error. "< /p > ';

    } ? >

    < are method = "POST" name = "form1" id = "form1" >

    < table class = "DisplayTable" align = "center" >

    < b >

    < td align = "right" > Page: < table >

    < td > <? PHP echo $textpage? > < table >

    < /tr >

    < tr valign = 'of basic">

    < td align = "right" > Date: < table >

    < td > <? PHP echo $h_date? > < table >

    < /tr >

    < b >

    < td align = "right" > sequence: < table >

    < td > <? PHP echo $h_seq? > < table >

    < /tr >

    < b >

    < td align = "right" > Col: < table >

    < td > <? PHP echo $h_col? > < table >

    < /tr >

    < b >

    < td align = "right" > title: < table >

    < td > <? PHP echo $p_heading? > < table >

    < /tr >

    < b >

    < td align = "right" > text content: < table >

    < td > <? PHP echo $p_text? > < table >

    < /tr >

    < b >

    < td align = "right" > content hide? : < table >

    < td > <? PHP echo $h_hide? > < table >

    < /tr >

    < b >

    < display td = "hidden" > < input value = <? PHP echo $delrec? > name = 'deletekey"id ="deletekey"/ > < table >

    < display td = "hidden" > < table >

    < /tr >

    < b >

    < td align = "right" > < a href = "DisplayText.php? varpage = <?" PHP echo $Thistextpage;? > "> < span class ="Red"> CANCEL </span > < /a > < table >.

    < td align = "left" > < input name = "remove" id = 'delete' type = 'submit' class = 'GreenButton"value ="Confirm deletion"/ > < table >

    < /tr >

    < /table >

    < / make >

    The reason why the query is empty lies in the lack of uniformity in the spelling of your variable to the prepared statement:

    $deletesql = "DELETE FROM Homepage_text WHERE home_key =?";

    $stmt = $sainttim-> prepare ($deleteSQL);

    The query is stored in the form of $deletesql, but the value you pass to the prepare() method is $deleteSQL. PHP variables are case-sensitive. Use is $deletesql in both cases, or store the query as $deleteSQL.

  • the camera shutter sound cannot be silent with the mute button on my phone i 6 s

    the camera shutter sound cannot be silent with the mute button on my phone i 6 s

    Depending on where you purchased your phone, this is not possible, because of legislation in these countries that regulate this feature.

    In all other cases, try to force reboot the phone by holding down the button sleep and home for 10 seconds, until the Apple logo comes back again. You won't lose data, but it can cure some problems after installing new software or applications.

    In the case where this does not work, restore the phone:

    Use iTunes to restore your device iOS to factory settings

  • all my data is all save on the local disk c, how to share the data with the other drive, local drive d.

    all my data records on the local disk c, how to share the data with the other drive, local drive d.

    Hi Jasonbichard,

    1. what type of drive is D? Is - this another partition on the same disk?

    2 Windows operating system you are using?

    You can change the location of the disk to save the data in the d: instead of C: and check if it helps.

    a. navigate to the location (username) C:\Users\.
    b. right click on the folder that you want to change the location, and then select Properties.
    c. click on the location tab and change the location to D: drive.

    d. click on apply and Ok.

  • Code 646, cannot install dates. The question of liciense agreement is not required.

    Code 646, cannot install dates. The question of liciense agreement is not required.

    Try this FixIt:
    Code error '0 x 80070646', '646', or '1606' when you try to install the Office updates

    http://support.Microsoft.com/kb/2258121 "a programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

  • Error 907: This connection cannot be used with the VZAccess Manager

    original title: error message appear on my screen

    I get this error message appear on my screen every two seconds:
    "This connection cannot be used with the VZAccess Manager.

    Error 907 "

    Hello

    Disable/remove your Verizon Wireless software or contact Verizon for help with this error. Posts like this occur generally when third-party utilities are used to manage connections and issues must be resolved by the Distributor, because they are often specific to that software.

    Verizon support suggest that you go in the Options Internet/Control Panel and on the Connections tab, check the option "never establish a connection" is selected.

    Good luck, Rick Rogers, aka "Crazy" - Microsoft MVP http://mvp.support.microsoft.com Windows help - www.rickrogers.org

  • Email with attached video will not leave the Outbox... Cannot delete Email with the attached video.

    Email with attached video will not leave the Outbox... Cannot delete Email with the attached video.

    Check to work offline , and then it should delete.

  • Foreign key constraint, not recognized during the synchronization of data with the model dictionary

    Hello

    Data Modeler is a foreign key constraints do not recognize when synchronizing data with the model dictionary, although the foreign key is there (in the database that a data dictionary is read). I can't find any criterion when a foreign key is not recognized by the Data Modeler. Are there limits to the length of the attribute, or the number of columns in a foreign key, or other limitations which may lead to this behavior not to recognize a fk by Data Modeler? I have columns more than 32 characters. I compared with the fk is recognized by DM, but I can't find anything that indicates why it is not recognized.

    I wonder if someone also has constraints of foreign keys that are not recognized in the comparison of data bases and model?

    Thank you

    Robert

    Hi Robert,.

    Thanks for the comments, I logged a bug.

    Philippe

  • Dynamic action for validation of date with the notification message plugin

    Hi all

    Someone help me please with dynamic action for validation of date with the message notification plugin. I have a form with two elements of the date picker control and message notification plugin.

    The requirement first user selects the exam is finished and then selects the date. So, if the date is greater than the date of the examination is over + 2 years then doesn't trigger the message notification plugin. I tried to create that dynamic action on the date picker date that triggers the scheduled issue notification message but I want to make conditional, I mean displays the message only if date of the selected is greater than the date of the exam is finished more than 2 years.

    In terms simple, notification is displayed only if provided is superior to (date of the exam is completed + 2 years).

    I use oracle apex 4.0 version and oracle 10g r2 database. I tried to reproduce the same requirement in my personal workspace. Here are the details. Please take a look.

    Workspace: raghu_workspace

    username: orton607

    password: orton607

    APP # 72193

    PG # 1

    Any help is appreciated.

    Thanks in advance.

    Orton.

    You can get the value of the date of entry:

    $(ele) .datePicker ('getDate');

    So what to add functions such as:

    function validateNotification (d1, d2) {}

    Date1 var = $(d1) .datepicker ('getDate');

    date2 var = $(d2) .datepicker ('getDate');

    if(date1 && date2) {}

    return ((date2.getTime()-date1.getTime())/(1000*24*60*60))>(365*2);

    } else {}

    Returns false;

    }

    }

    The logic based on setting (I have two years from years of 365 days preceding)

    Then in the D.A. specify a JavaScript expression as:

    validateNotification ('P2_REVIEW_COMPLETED', this.triggeringElement.id)

    Refer to page 2 for example.

  • What is always "stay up to date with the latest innovations in the field of photography from Adobe"?

    Hello

    I am considering buying stand-alone version 6 of Lightroom, but I wonder what does that "Always stay up to date with the latest innovations in photography from Adobe" is not available?

    Will be the updated standalone for free with the new camera support?

    Will be free updated standalone version with correction of defects?

    If there are new features (minor version of lightroom), will not be available for the stand-alone version before the next major release?

    Thanks for your help

    My understanding is that LR6 will continue to receive bug fixes and new camera support updates, but not feature/news which receives from the CRD. See question 2 below on this post: CC Lightroom / Camera Raw FAQ

  • Hi I godt 2 Questions: 1) my Adobe PhotoShop elements 10.0 for MAC cannot read taken with the new Canon 7 d Mark II camera RAW files. (2) my Photoshop Elements changed from Danish language of German language, how do I put this back?

    Hi I godt 2 Questions: 1) my Adobe PhotoShop elements 10.0 for MAC cannot read taken with the new Canon 7 d Mark II camera RAW files. (2) my Photoshop Elements changed from Danish language of German language, how do I put this back?

    1. you have cr 8.7 or better: use the dng converter or upgrade your pse in v. 13.

    2 mac App Store version is German. Photoshop Elements

  • urlLoader - replace it with the File class to access external resources

    Hello.

    Just read up on the File class more than anything because I want to develop on mobile devices. Can I replace all my classes urlLoader with the File class for my games on the web.

    var prefsFile:File = File.applicationDirectory;

    prefsFile = prefsFile.resolvePath ("preferences.xml");

    I feel that it is perhaps a silly question, but I have to ask.

    See you soon

    Yes, but you probably don't want to use applicationDirectory because of security concerns.

    and is there a reason you can't use your urlloaders?

  • FRM-13008: cannot find javaBean with the name 'oracle.forms.fd.AddItem '.

    Hello

    I have 10 g forms in my pc (windows xp) location. I have jar jar files with me and associated examples.

    1. inside the My E:\DevSuiteHome_2\forms\java copy the additem.jar

    2 inside of the E:\DevSuiteHome_2\forms\server, I found the formweb.cfg file in the place where the first pot.

    serverApp = default
    # Forms applet archive for JInitiator
    archive_jini = frmall_jinit.jar, AddItem.jar

    and save the file.

    Now when I open the form in forms 10g, I get the following error. Please help me.

    FRM-13008: cannot find javaBean with the name 'oracle.forms.fd.AddItem '.

    Please help me how to solve my problem.

    Iqbal

    If it's only a 'Design' error, you can ignore it.

    Yes, but if you want to get rid of this error, include the full path to the jar file in the registry in the FORMS_BUILDER_CLASSPATH parameter

Maybe you are looking for