Selecting a subclass instances in JDOQL

Hello!
Suppose there are three classes: SubClass1, SubClass2 and their SuperClass.
and there's a query that was created on the SuperClass extent, i.e.
Query q = pm.newQuery( SuperClass.class );
Is it possible to use something like this in Kodo JDOQL:
(SubClass1) this == this
Can I expect this to return only instances of SubClass1 and not those of
SubClass2? If not, is there any other way I can specify the required
class in a JDOQL after a query has already been created over certain
(SuperClass) class?

Viktor Matic wrote:
If not, is there any other way I can specify the requiredTo answer myself, yes, use 'instanceof'.

Similar Messages

  • Maintenance Optimizer - Selection of Main Instances

    Hello.  I have configured a Landscape Component in transaction SMSY.  There is a tab called "Selection of Main Instances".  
    It seems that tab drives what I see when I run the maintenance optimizer.  The checkboxes selected there determine what components that I see when creating a new maintenance transaction.  
    Is there a way to populate those check boxes from the satellite system.  It seems like there is a gap here.  Manually configuring that can lead to errors - the exact thing Sol Man is supposed to prevent.  
    Note the "software components tab" is automatically populated from the satellite, but it does not affect the maintenance optimizer.

    Hello,
    Make sure that following things are OK :
    - Solution Manager should be patched to the latest release
    - The ERP 6.0 system must have the product version SAP ERP 6.0. Make sure that it is not accidentally maintained as SAP ECC 6.0.
    Also have a look at these OSS-notes:
    SAP Note 1122966 Maintenance Optimizer: Notes for Enhancement Packages
    SAP Note 1287216 Maintenance Optimizer: pre-select technical usages
    SAP Note 1139602 Several enhancement package releases on one system
    SAP Note 1134872 Maintenance Optimizer: FAQ for Stack Delta Files
    SAP Note 1233954 Maintenance Optimizer: No XML Generated in EPS Inbox
    SAP Note 1172948 SAP Solution Manager - Basic functions
    Wim

  • Subclass instance not created during runtime

    Hi Experts,
    For an existing standard class a subclass was created and during runtime the me object reference points to the subclass name there by allowing the subclass additional/custom methods to be triggered.
    We have done service pack upgrade in the system and during runtime I find the subclass does not exist in the me object reference due to which the custom code in the subclass is not being called.
    How do I fix the above issue so that and subclass instance is created by the superclass during runtime?

    Hello Srinivas,
    I had put a breakpoint to debug in the subclass which was being invoked.
    In the new system where the service pack has been applied I have put breakpoint in the same method but the subclass method is not being called.
    The superclass method is being called. I'm sure after facing this problem(and solving it, of course) you'll have a better understanding of the 'polymorphic' behaviour of objects
    if the subclass inherits superclass the instance will be created automatically?
    NO!!!
    You must understand none of us has a crystal ball where we can gaze & find out the solution. If you want valuable responses please provide as much info as possible.
    BR,
    Suhas

  • Why assigning a subclass instance to a variable of type of superclass ?

    Hi all,
    What is the significance of assigning an instance of a subclass to a variable whose type is a superclass's type.
    For eg. List list=new ArrayList();
    If I do so is it possible to execute the methods of the subclass ?
    regards
    Anto Paul.

    In addition, this is what polymorphism is all about:
    abstract class Animal {
      String name;
      Animal(String name) {
        this.name = name;
      public abstract void voice();
    class Dog extends Animal {
      Dog(String name) { super(name); }
      public void voice() {
        System.out.println(name+" barks");
    class Cat extends Animal {
      Cat(String name) { super(name); }
      public void voice() {
        System.out.println(name+" miaows");
    public class Polymorphism {
      public static void main(String args[]) {
        Animal[] animals = {
          new Dog("Fido"),
          new Cat("Felix")
        for (int i = 0; i < animals.length; i++) {
          animals.voice();
    Here, we are looping through an array of Animals. In fact, these are concrete subclasses of the abstract Animal class. In this simple example, you can see from the code that the animals array contains a dog and a cat. But we could even extend this to read in an arbitrary Animal object that had been serialized into a file. At compile time, the exact class of the serialized animal would not be known. But polymorphism occurs at runtime to ensure the correct voice() method is called.
    For the List, or Map example, conisder this:
    public SomeClass {
      public HashMap map1 = new HashMap();  // this ties you to hashmap
      public Map map2 = new HashMap();      // this allows you to change Map implementation
      public void process(HashMap map) {}   // this ties you to hashmap
      public void process(Map map) {}       // this allows you to change Map implementation
    }Suppose you use a HashMap for map2 to start with. But at some point in the future you would like to ensure your map is sorted. By specifying map2 to be a Map, you can change the implementation without having to modify each method call by simplying changing the initiliastion to be:
    Map map2 = new TreeMap();Hope some of this helps :) Cheers, Neil

  • Cannot Select Correct SQL Instance to Upgrade During Install

    Hello all,
    A program that we use installed an instance of SQL 2008 R2 SP1 Express on our Windows 2008 R2 SP1 server. We would like to upgrade that instance to SQL 2012 BI. On this same server also runs another instance of SQL 2008 Express. The instance that we want to
    upgrade is named PROFXENGAGEMENT, and the one that we want to leave as is is named SQLEXPRESS.
    When I go through the 2012 install wizard, I get to the screen where you select the instance to upgrade. There's a dropdown box to select the instance, and a box below that lists all of the instances on the computer. While both are listed at the bottom, only
    SQLEXPRESS is listed in the dropdown box for me to select. There are no error messages, it just won't let me select the instance I want to upgrade.
    * I tried things like leaving one instance running and the other stopped, but that did not make a difference.
    * The discovery report I ran listed both instances properly.
    * Following an Internet search result, I also ran the script on this website. All files are located in the Installer cache.
    * I tried running a repair of the PROFX instance through the installer that came on the CD for that program, but that didn't make it appear either.
    I'm not sure how to make the instance appear so that I may select and upgrade it.
    Any help would be greatly appreciated.
    Thanks in advance,
    John

    Go to options page and choose x86
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Method.invoke causes IllegalArgumentException with subclass instance

    Is there a way to use an instance of a subclass when using reflection to invoke a method?
    Given the following code, I want to be able to use reflection to invoke the "doSomething" method within the Foo class. However, I want to use an instance of Bar as the parameter value when using reflection (since an instance of Bar is implicitly an instance of Foo; I have also tried casting the Bar instance, b, to Foo but this does not work). Doing this yields an IllegalArgumentException.
    What am I missing? What am I doing wrong? What do I have to do in order to use an instance of Bar with "invoke"?
    // Foo.java
    package junk;
    public class Foo
        private void doSomething(Foo f)
            System.out.println("Doing something with a " + f.getClass().getName());
        public static void main(String[] args)
            Foo f = new Foo();
            Bar b = new Bar();
            f.doSomething(f);   // Outputs "Doing something with a junk.Foo"
            f.doSomething(b);   // Outputs "Doing something with a junk.Bar"
            Class[] paramTypes = new Class[] { f.getClass() };
            Object[] paramValues = new Object[] { b };
            b.invokePrivateFooMethod("doSomething", paramTypes, paramValues); // Doesn't work
    // Bar.java
    package junk;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    public class Bar extends Foo
        public void invokePrivateFooMethod(String methodName,
                                           Class[] paramTypes,
                                           Object[] paramValues)
            try
                Foo localF = new Foo();
                Class classToUse  = localF.getClass();
                Method methodToUse = classToUse.getDeclaredMethod(methodName, paramTypes);
                methodToUse.setAccessible(true);    // override of private modifier
                methodToUse.invoke(classToUse, paramValues);
            catch (IllegalAccessException e)
                e.printStackTrace();
            catch (NoSuchMethodException e)
                e.printStackTrace();
            catch (InvocationTargetException e)
                e.printStackTrace();
    }

    Sorrry for the confusion. It's always the little things...
    I neglected to use an instance of Foo to invoke the method.
    See corrected code below:
    // Bar.java
    package junk;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    public class Bar extends Foo
        public void invokePrivateFooMethod(String methodName,
                                           Class[] paramTypes,
                                           Object[] paramValues)
            try
                Foo localF = new Foo();
                Class classToUse  = localF.getClass();
                Method methodToUse = classToUse.getDeclaredMethod(methodName, paramTypes);
                methodToUse.setAccessible(true);    // override of private modifier
                // NOTE:  Use localF, NOT classToUse!
                methodToUse.invoke(localF, paramValues);
            catch (IllegalAccessException e)
                e.printStackTrace();
            catch (NoSuchMethodException e)
                e.printStackTrace();
            catch (InvocationTargetException e)
                e.printStackTrace();
    }

  • Cant select a specific instance of an application when running multiple

    I am trying to write a script to launch multiple instances of chess.app, select computer vs. computer, and have it start playing. I am able to get it to either launch multiple versions of the app by via "do shell script", however when it begins to activate the chess app and select the appropriate objects, it always acts on the first instance of the application that was launched. Here is what I have so far:
    set volume 0
    repeat 3 times
    do shell script "open -n /Applications/Chess.app"
    tell (application "Chess") to activate
    tell application "System Events" to tell process "Chess"
    keystroke "n" using {command down}
    keystroke space
    key code 125
    key code 125
    keystroke space
    click button "Start" of sheet 1 of window 1
    end tell
    end repeat
    I have tried identifying the app by the process ID, but its unable to find it on runtime. Any advice would be appreciated. Feel free to ask for any clarification.

    You can use ps and grep from a shell script to find a list of all Chess processes, then extract just the PID with awk. From there, just tell System Events to bring the app to the front using the PID that was found, then start a new game. You can see an example below:
    -- increase the initial delay if you have trouble with key presses being sent before the window is open
    property initialDelay : 0.5
    property delayBetweenKeyPresses : 0.25
    set volume with output muted
    set knownPids to {}
    repeat 3 times
    -- launch Chess
    do shell script "open -n /Applications/Chess.app"
    -- get a list of PIDs for open instances of Chess
    set pidList to (do shell script "ps aux | grep Chess | grep -v grep | grep -v Engine | awk '{ print $2 }'")
    set pidList to words of pidList
    -- find the current instance's PID, then start a new game
    repeat with pid in pidList
    if (pid is not in knownPids) then
    set knownPids to knownPids & pid
    startChessGame(pid)
    exit repeat
    end if
    end repeat
    end repeat
    on startChessGame(pid)
    tell application "System Events"
    set procs to every process whose unix id is pid
    repeat with proc in procs
    set the frontmost of proc to true
    end repeat
    process "Chess"
    delay initialDelay
    keystroke "n" using {command down}
    delay delayBetweenKeyPresses
    keystroke space
    delay delayBetweenKeyPresses
    key code 125
    delay delayBetweenKeyPresses
    key code 125
    delay delayBetweenKeyPresses
    keystroke space
    delay delayBetweenKeyPresses
    keystroke return
    delay delayBetweenKeyPresses
    end tell
    end startChessGame
    Each new instance of Chess will create a new window in exactly the same spot so you'll have to handle window management however you see fit. This should work for just launching the individual instances of the Chess app and starting new games, though. You may also need to fiddle with the two delay properties that are set at the top in order to get it working correctly. The current settings work fine on my MacBook Pro but I haven't tested it on any other models or configurations.

  • GetSelectedIndex() to return position selected, not first instance?

    Hi
    I am having trouble getting the correct index from a JComboBox. My program's JComboBox stores duplicated entries.
    When the getSelectedIndex() method is used, it returns the index of the FIRST instance of the object that was selected!!! instead of returning the index to the actual item selected by the mouse!!
    * I need this labelIndex to be the index of the position selected!! not the
    * first instance of the label in the list.
    labelIndex = frame.labelsComboBox.getSelectedIndex();
    Does anyone know how to remedy this?

    Instead of putting Strings in your combobox, put some other kind of Object which has a toString() method which returns the string you want to show. Then when the JComboBox code calls the equals() method (I think) to see which index matches, it will only find the correct one.import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test2 extends JFrame {
      public Test2() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        MyObject[] stuff = { new MyObject("A"),new MyObject("B"), new MyObject("A")};
        JComboBox jcb = new JComboBox(stuff);
        content.add(jcb, BorderLayout.NORTH);
        jcb.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            System.out.println(((JComboBox)ae.getSource()).getSelectedIndex());
        setSize(200,200);
      public static void main(String[] args) { new Test2().setVisible(true); }
    class MyObject {
      String text;
      public MyObject(String text) { this.text=text; }
      public String toString() { return text; }
    }This example uses the default Object equals() method which is actually ==. You can override equals() if you want.
    I use this a lot to put any kind of object in a combo.

  • URGENT: How to selectively migrate composite instances and task data from one env to another

    Gurus,
    We've come across a situation whereby we need to migrate instance data (including Human Task related) of some specific composites from one environment to another.
    (Environment is equivalent here to a different domain installation on different physical server.)
    Is this possible in some standard way like using Oracle import-export utility or script?
    If not, how can this be achieved?
    Thanks in advance for any help you can provide on this.
    With regards-
    Ashish

    Hi,
    If your SharePoint environment supports InfoPath Forms, then you can customize the form and add rules to make the list items as read only when user A submits the form.
    you can then write a form load event to check the logged in user using username() function. This logic can be implemented in variety of ways, like setting a flag when User A submits the form, or storing user A username in a form variable etc., else comparing
    User A and User B values within form Load event.
    Another way of doing this is using Views or grouping all of the User A fields within a section etc.,
    The above would take care of Form logic, and for the workflow, you can use SharePoint designer to create a custom workflow, where it will run on onItemCreate and onItemChange events.
    The logic for workflow would be if the form Submitted for the first time, the workflow will start and send an email to User B, and when User B submits the Data then onItemChange change event will start the workflow to send an email to approver to approve
    the data.
    here are some links for your reference -
    http://office.microsoft.com/en-us/infopath-help/add-formulas-and-functions-in-infopath-2010-HA101821255.aspx
    http://office.microsoft.com/en-us/videos/video-create-an-approval-workflow-in-sharepoint-designer-2010-VA101897477.aspx
    http://blogs.technet.com/b/meacoex/archive/2010/11/01/get-manager-approval-in-sharepoint-designer-2010-step-by-step.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • A message "Undefined" is popping up each time on selecting an ESB instance

    We have deployed an ESB project which invokes many services. Once the process is completed when i click on the instance that got created I get a message "Undefined" popping up on the right panel where the picture of the esb project has to appear and the picture never loads even on refresh of the page. It happens even if the instance is faulted/completed/error. I find it difficult to trace where exactly the process is failing.
    Kindly let us know if this is a problem as we have many services being processed for a single instance or do we have to check anything to resolve the same.
    Thanks,
    Sravanthi A

    Ok, I finally managed to get rid of it.
    First I did the thing with the about:config but I flitered for imesh instead and managed to reset two thing but when I got to the keyword.URL I got the same thing as lolbabe98 did with the "An attempt to change your search engine or homepage was blocked."
    Then I did a search on my C: drive for iMesh and discovered some things that hadn't been removed even though I had unistalled both the toolbar and the actual program. After that it worked fine and I now have a regular "untitled" tab when I open a new tab.
    One last thing, when I tried to remove some of the files there was one that said it was in use, it was called datamanagerUI or something rather. The only thing I had to do there was to open Task Manager and kill a process called DATAMN~1 and I was able to remove it. Hope this helps.

  • Select using different instances

    I hope this is not off topic here:
    How do I access different tables in different instances? I found anything in documentation.

    Did u create DB link???
    after creating dblinks it should be ok....
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Frank([email protected]):
    I hope this is not off topic here:
    How do I access different tables in different instances? I found anything in documentation.<HR></BLOCKQUOTE>
    null

  • Flex: how to select each element/instance of a repeater

    I'll explain my problem as brief as possible. I have a variable bandName, the value is String that i get through an API.
    public function haalNaam(selectedChart:Object):String
    var bandName:String = selectedChart.name;
    I use this var in a repeater for a label. This repeater repeats 5 times, so it shows the 5 most hyped artists:
    <repeater>
    <label text="{haalNaam(lastfmCollection.currentItem)}"/>
    </repeater>
    Next, i had to transport the var bandName to another component. I managed to do this with this command:
    var theName = "LastFmApi(this.parentApplication).bandName"
    This code works, but I only manage to get the bandName of the last element in the repeater (5th one). I have no idea how i can receive the names of the artists 1,2,3 or 4. How can i get to those values?

    I made some screenshots to elaborate.
    So these 5 thumbnails are in a repeater. If you click on an artist's name or image, you go to a profile component and i want to post the artists name on that page. With the code i have now i can only take the value from the nameLabel from the last artist (in this case Damien Rice) and show it in the other component.
    Now i should know how i can select the names of every artist, not just the last one. Someone i know said that i can do this like this:
    theName=(event.target as Label).text;
    But i'm not sure on how to implement that.

  • 2008 R2 Express Web Upgrade Failed: The selected SQL Server instance does not meet upgrade matrix requirements.

    HI
    I want to upgrade a SQL 2008 R2 Express install to 2008 R2 Web Edition.
    when I click view detailed report I get the below.
    How do I fix this?

    Hello,
    As per below link upgrade of SQL Server 2008 express to SQL server 2008 r2 web is not supported.So i guess this message.I have never tried upgrading unsupported edition so not too much sure about error message.But i am sure not meets requirement is because
    of unsupported upgrade you are doing
    http://technet.microsoft.com/en-us/library/ms143393(v=sql.105).aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • LMS 4.2 sub-interface not available in the instance selection window creating poller

    Hi All,
    I have sub-interfaces created on the switch and are in active(up/up) state,but these sub-interface not available for selection in the instance window while creating the poller, and am not able to monitor the traffic on these sub interface in the performance management.
    LMS will not display the interfaces in the instance selection window if they are not active,but here the sub-interface are in active state but these are
    not available. can anyboody help me out ??
    Thanks,
    Channa

    Any Idea..??

  • Select instance of polymorphi​c vi at compile time

    quick question:
    I have a fairly significant labview project that i'm deploying to several compactRIOs.  However, I have two possible configurations of that code.  The difference between the two configurations is a single VI.  That is, within my project, there's one VI that I replace with another (same connector pane) for the alternate configuration.
    What I want to do is to make that VI into a polymorphic VI, then have the instance of that polymorphic VI be set at compile time.  That is, I would have two build specifications.  Each build specification would build a configuration of the project by having the selection of which instance of the polymorphic VI to use be included as a parameter of the build specification.  If it is possible to do, I can't seem to find the option in the build specification preferences to do so.
    Does this make sense?  Any help is appreciated.
    Cheers.
    Solved!
    Go to Solution.

    Keith_W wrote:
    yamaeda, i'm unclear about what you're suggesting.  are you suggesting that i use the VI scripting VIs to programmatically edit the VI to switch which state is enabled by using a VI that runs before building, but as part of the build process?
    The Conditional disable seems to work like a script at compile time. As you stated your problem it sounds like you wanted 2 builds anyway, and this would enable one of the conditional frames when building the exe.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

Maybe you are looking for