Complex JDOQL expression does not work. Or maybe I'm doing something stupid?

Hi!
I have several related objects: Customer, Contract and AccessKey.
Each Customer has 1-to-many relationship with Contracts (so it can have
several contracts) and each Contract has 1-to-many relationship with
AccessKeys (so that contract can have several access keys).
I'm trying to obtain customer by property of access key using the
following code:
Query q = pm.newQuery(Customer.class, "contracts.contains(c) && " +
"c.accessKeys.contains(a) && " +
"a.pinCode == pin";
q.declareParameters("String pin");
q.declareVariables("Contract c");
q.declareVariables("AccessKey a");
Collection result = (Collection) q.execute("123");
All these objects (Customer, Contract and AccessKey) are
PersistenceCapable and located in the same package.
In result I get the following exception:
javax.jdo.JDOUserException: The field "c" of type "class
net.xtrim.crm.customer.object.Customer" does not exist or is not persistent.
     at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.getExpression(JDBCQuery.java:181)
     at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:787)
     at
com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
     at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:609)
What's wrong with such query? Maybe the problem is that I'm trying to
navigate through the field of the object obtained from the collection of
source object?
Thank you in advance.
Best regards,
Alexey Maslov

Variable and Parameter declarations are a one-time deal:
// note the ; seperator
q.declareVariables ("Contract c; AccessKey a");
// note the , separator
q.declareParameters ("String pin, String forExample");
So when you declare the access key variable, the query "forgets" about
c, and expects it to be a field, and no longer a variable.
Hope that solves your problem!
Alexey Maslov wrote:
Hi!
I have several related objects: Customer, Contract and AccessKey. Each
Customer has 1-to-many relationship with Contracts (so it can have
several contracts) and each Contract has 1-to-many relationship with
AccessKeys (so that contract can have several access keys).
I'm trying to obtain customer by property of access key using the
following code:
Query q = pm.newQuery(Customer.class, "contracts.contains(c) && " +
"c.accessKeys.contains(a) && " +
"a.pinCode == pin";
q.declareParameters("String pin");
q.declareVariables("Contract c");
q.declareVariables("AccessKey a");
Collection result = (Collection) q.execute("123");
All these objects (Customer, Contract and AccessKey) are
PersistenceCapable and located in the same package.
In result I get the following exception:
javax.jdo.JDOUserException: The field "c" of type "class
net.xtrim.crm.customer.object.Customer" does not exist or is not
persistent.
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.getExpression(JDBCQuery.java:181)
at
com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:787)
at
com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:668)
at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:609)
What's wrong with such query? Maybe the problem is that I'm trying to
navigate through the field of the object obtained from the collection of
source object?
Thank you in advance.
Best regards,
Alexey Maslov
Stephen Kim
[email protected]
SolarMetric, Inc.
http://www.solarmetric.com

Similar Messages

  • My back button does not work because the prior screen does not appear in the history.  I therefore must go back to the blue screen and reload safari.  Apple tech support could not help.  Can anyone else help?

    After I installed mountain lion my back button frequently does not work because the prior screen does not appear iunder History.  Apple tech support was not able to fix the problem.  Does anyone have any suggestions?

    lbryan1987 wrote:
    I dont want the button problem solved i need to know how to restore the phone without using that button or going into settings
    You don't in the condition it's in. You will either have to get the phone replaced by Apple or pay a 3rd party to repair it.
    there seriously should be more than two ways to solve this other wise apple is useless and we will never buy another apple product.
    Seriously? It's physically broken!

  • [svn:fx-trunk] 5019: ASDoc updates to indicate that some Halo containers do not work with the Spark equiv (ControlBar does not work with Spark Panel/ AppControlBar does not work with Spark Application), and indicate that Canvas, Box, Tile, Panel have Spa

    Revision: 5019
    Author: [email protected]
    Date: 2009-02-19 13:17:21 -0800 (Thu, 19 Feb 2009)
    Log Message:
    ASDoc updates to indicate that some Halo containers do not work with the Spark equiv (ControlBar does not work with Spark Panel/AppControlBar does not work with Spark Application), and indicate that Canvas, Box, Tile, Panel have Spark equivs
    QE Notes: None
    Doc Notes: None
    Bugs: -
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ApplicationControlBar.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Box.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Canvas.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ControlBar.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/HBox.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Tile.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/VBox.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/ViewStack.as

    Hi DST
    This is a great effort and gesture. thank you on behalf of all the newbies.
    PJ

  • Hello! I have installed Photoshop on PC WIN 7 64bit. When I store first time a Photoshop docuument, it works fine - after re-opening and doing changes I trying again to store it - it does not work anymore! First it does not accept the name (message "It ca

    Hello! I have installed Photoshop on PC WIN 7 64bit. When I store first time a Photoshop docuument, it works fine - after re-opening and doing changes I trying again to store it - it does not work anymore! First it does not accept the name (message "It can not be stored because the nam is invalid" With 2. trial it tells me that the data is blocked and I don't have the rights - and I should chenge them. But I am working as the Admin on my PC - and each trial to change the rights of the data is as well not possible because of missing rights - even I am Admin! I must always store the data with a new name, then it works, but I also cannot remove the old datas or shift them into the waste paper - because of no rights! -- sorry for not perfect english, I am German native speaker! Tahnks a lot for help!

    Hi,
    I am using a Nvidia 4200M adapter in my Laptop, Driver 266.96, Direct X 11
    In my desktop I am using an ATI XFX 6950, latest revision drivers (I am not at home right now so I cant get that info).
    The issue I did describe above, but it was a long explanation.
    In some flash games the game files load initially and get as far as the "click to start" button. Then the flash area usually goes either all white or all black (usually depending on the falsh game default background color) and then it stays that color. Cant see anything after hitting start (usually most games have an intro video or animation before the game starts, but I cant see any of it.
    For the very few games that do start, the flash game or application does not seem to work correctly in that when the rare game starts, it wont save any game files or save files to the pc and so if I exit the game (navigate away to another page or close browser) and then later come back, even though I click the option to save games (and ensure that the flash application slider shows it can save files and lots of space) it does not save and I have to start from the beginning all the time.
    More explanation I gave above.

  • Am having major issues! this does not work i dont understand..does the ipod have to be off while pressing the buttons if so how is it possible if it is connected to the computer either way it turns on..and when i tried these steps while the ipod was on it

    i am having major issues! this does not work i dont understand..does the ipod have to be off while pressing the buttons if so how is it possible if it is connected to the computer either way it turns on..and when i tried these steps while the ipod was on it still doesnt  work it just asks me “slide to power off” please someone help me i just cant seem to put my ipod in DFU mode

    To get the iPod in recovery mode and DFU mode you first have to turn the iPod off.
    Just what is the problem you are tying to resolve?
    Sometimes you have to let the battery fully drain if you can't turn the iPod off. After charging for at least hour try again.

  • MB Air two finger scroll does not work for a user but does for another

    Hi
    MB Air. 10.9.3.
    Defective Trackpad was just replaced. Two finger scroll does not work for the main user. I made a test log in and two finger scroll works. I booted off an external drive and two finger scroll works.
    I pulled all of the user preferences out, logged out and in and still does not work. Zapped PRAM. Checked all trackpad settings. No luck.
    Tried this in Terminal:
    defaults write -g com.apple.trackpad.scrollBehavior 2
    Any ideas?

    This sounds strange but check the settings in Settings>Accessability for the track pad. I belive your problem lies there not in Track Pad set up in Settings.

  • Phone 4 home button does not work, iPhone 4 home button does not work

    Phone 4 home button does not work. I tried to put it off and on, but to no avail. Tried updating, still nothing.

    No magic solutions for a hardware problem.  You'll need to bring your phone to Apple for replacement ($149), or find a 3rd party to fix your phone (which will forfeit all future support on that phone, warranty or otherwise, from Apple)

  • Keyer edge tool does not work. What am I doing wrong?

    When I am trying to soften the edge on my green screened image I try to use what they call the edge tool.
    But it does nothing to the edge of the image, it makes the entire keyed image more transparent or more opaque...  this is totally useless... I thought I remembered this working in a previous version but maybe not...
    what am I doing wrong? Or is it just not working correctly.
    Thanks for any help.
    FCPX 10.0.5  OSX 10.6.8

    Do you see the Multifox item to open a new window in the File of Firefox menu?
    You will see a "New Identity Profile" (Ctrl+Alt+M) in the "Firefox > New Tab" menu and in the File menu (press F 10 if the menu bar is hidden) and in the context menu if you right-click a link.<br />
    Choosing that menu entry will open a new window with a new set of cookies marked multifox-profile-2 in the cookie manager.
    It is possible that there is a problem with the file(s) that store the extensions registry.
    Delete the files extensions.* (e.g. extensions.sqlite, extensions.ini, extensions.cache) and compatibility.ini in the Firefox profile folder to reset the extensions registry.
    *https://support.mozilla.org/kb/Profiles
    New files will be created when required.
    See "Corrupt extension files":
    *http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    *https://support.mozilla.org/kb/Unable+to+install+add-ons
    If you see disabled, not compatible, extensions in "Tools > Add-ons > Extensions" then click the Tools button at the left side of the Search Bar (or click the "Find Updates" button in older Firefox versions) to check if there is a compatibility update available.
    If this hasn't helped then also try to delete the addons.sqlite file.

  • WRT54G does not work or what am I doing wrong?

    My setup: DSL -> 2wire modem router (bridge mode, firewall shutdown) ->WRT54G -> LAN with 1 IPPBX, 1 wired PC and 3 wireless PC.
    VoIP is running fine within our LAN, we have 2 SIP trunks running fine, But we just cant make an external softphone to work properly from WAN (outside the LAN).
    As long as I know, the simplest way to explain what a firewall does is 'everything requested from the inside should be wellcomed, anything unsolicited from the outside should be disallowed UNLESS explicitly told otherwise' this is, why the heck do we have unreachable ports althought we have allow those to receive extern traffic?
    Please check the pdf´s (snapshots) here:
    http://travelexpress.com.mx/download/router/status.pdf
    http://travelexpress.com.mx/download/router/router_firewall.pdf
    http://travelexpress.com.mx/download/router/router_forward.pdf
    http://travelexpress.com.mx/download/router/scanner.pdf
    http://travelexpress.com.mx/download/router/scanner1.pdf
    All those are for showing current setup, firewall, port forwarding and the results of a port scanner wich shows that efectively, we cannot use our extern SIP client because the WRT54G is blocking it...
    Thanks in advance as we are urged to fix this ASAP

    Yes. NAT is a function in the router. Just like the firewall. But still, both are different functions of the router. The firewall filters traffic to the router. NAT is responsible for mapping IP addresses. The reason why unsolicited packets from the internet won't get into the LAN is because NAT cannot deliver those packets and not the firewall rejecting some incoming connection. NAT does not filter. NAT tries to deliver and if it does not know where it drops it. But not because it wants to filter something.
    The settings on the router are correct. But as I have mentioned before, forwarding a port does not mean it's open or accessible. There are still other factors which could cause the port to be closed...
    Regarding the modem: you can check that if you connect a computer directly to the modem, open a port on the computer and then do the internet port scan again.
    I also explained how to check with telnet if TCP port 5060 on the IPPBX is really open or not. Why don't you just do this test? It would be much easier and faster, giving relevant answers. I don't mind whether asterisk usually uses both protocols on 5060 or not. Maybe it does. Maybe not. Maybe it can be configured. Whatever. Enter "telnet 192.168.1.69 5060" into a command prompt window of a computer connected to your LAN and you see if the port is open or not. Then we know something for sure instead of thinking about what should be or should not be...
    Also do the same telnet test with port 23 and 80 and then use the internet port scanner to scan for tcp port 23 and tcp port 80. Then we could see if anything goes through or not instead of discussing theory...
    I did not say you have to set up a lab setup. I only explained that you were mixing NAT functions and firewall functions of the router. The NAT function may look like some firewall in certain respects but it is still a different function with a completely different purpose.
    I also can't say if the IP settings are all correct. Maybe the IP address is correct but the gateway address is not. Or the DNS server.
    The subject of this thread is "... or what am I doing wrong?". It's impossible to comment on something if you don't give the details which would allow to verify that you have set it up indeed correct...

  • On my mini Ipad the video does not work when I want to film something what do i need to do or how can i resolve this issue?

    I would like to know How to fix this problem with my mini Ipad, camera works well when I take photos but if I try to use for video the screen does not respond. it only response to photo, so I can I fix this ?

    All iPads (except the first gen which doesn't have a camera) are capable of taking videos. What version of iOS do you have on your iPad ? With iOS 7 you slide the Video / Photo / Square options up/down so that the one that you want lines up with the yellow dot to their left - is that how you are trying to select Video ?

  • I downloaded Firefox 4.0. Spellchecker is included and I have downloaded English Dictionary as Addon. It does not work on website. Spellchecker does not show up in Context Menu. I have tried every other source. Can you help please?

    I understand that Spellchecker is pre-installed but I cannot verify this is the case with v.4.0 Firefox. I have right-clicked on webpages and it does not say Dictionary is missing, so I assume the problem remains with Spellchecker. I expected to find Spellchecker and Languages under Edit in nav bar but it does not show up, What must I do? Richard

    That should work on a Mac as well.
    You did download and install the French version?
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 4.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

  • Lion email does not work with Verizon FIOS - Eudora does

    Recently I have not been able to send email using my Verizon outgoing server on the Lion email client. I can receive OK, but the server keeps rejecting something and a window pops up asking me to select a different SMTP server.
    Before I called Verizon, I decided to see if there were any free eMail clients I could use as a test and the new Eudora showed up when I did a "Bing" search.
    I just installed Eudora and after a very quick setup, I sent a message using the Verizon server without any problem, the mail coming into both the Eudora and Lion mailboxes.
    So the problem is not with Lion, but with the Lion eMail client. I know Verizon does not officially support Macs, but since Eudora works, I have localized the issue to the standard Lion email client.
    Anyone else have a similar experience with Verizon or some other ISP in not being able to send eMail?
    First, Eudora is an answer. Second - I would like to resolve the problem with the Lion eMail client - it must be some obscure server setting. I know that it used to work, but I am not sure whether it was with Lion or Snow Leopard. Usually when I send an eMail, I use Cloud and was using MobileMe so I did not notice whether or not Verizon's SMTP server was working.
    I noticed it today when I could not reply to an eMail that came in on one of my Verizon accounts.
    Here is the Eudora URL
    https://wiki.mozilla.org/Eudora_Releases
    Click Mac Disk Image and voila! there you go.
    (works for me)

    Thunderbird might work, but as long as Eudora is working I am happy.
    The built in client used to work with Verizon which is what puzzles me.
    I think you are right, the MacMail app is primarily for cloud these days.

  • IPad will not start. Reset DOES NOT work. Connecting to iTunes DOES NOT work

    My iPad went dead and sat for a few days before I plugged it in. Now it will not start. It has been plugged in for 2+ days now with OEM charger. The apple logo will show for a couple seconds and it turns off. Reset DOES NOT do anything. If I unplug it, nothing happens, no apple logo, no reset, nothing. Plugged into iTunes it will not do anything. The only time I get it to show activity is plugged into charger and like I said, as soon as the logo appears it shuts down and repeats this over and over until I unplug.

    See if you can have any success with recovery mode.
    iPad: Unable to update or restore - Support - Apple
    If that doesn't work, then make an appointment at an Apple Store and let a genius have a look.

  • Help! I dropped my external HD and now my Macbook Pro will not recognize the drive. I have tried to repair the disk and that does not work. Please offer help, suggestions, something!

    I dropped my external HD on my hard tile floor and now the drive is not working properly. I have tried a repair in Disc Ultilies with First Aid with no such luck. It started to work then I got a message "Filesystem verify or repair failed" about 3-4 minutes into the first aid repair disk. When I plug in I get the disk you inserted was not readable by this computer message. Please I need help on restoring this drive!
    Its a simple tech pro drive 1TB.

    Unfortunately, a drive that has been mechanically damaged by a drop and can't be repaired using Disk Utility probably can't be fixed any other way either. The best you can hope for is to salvage as much data from the drive as possible using one of the data recovery utilities linked below, and then replace the drive.
    http://www.prosofteng.com/products/data_rescue.php
    http://subrosasoft.com/OSXSoftware/index.php?main_page=product_info&products_id= 1
    http://download.cnet.com/VirtualLab-Data-Recovery/3000-2094_4-10298807.html
    If you can't recover your most important data using one of these utilities, the only remaining hope is a data recovery service, which is very likely to cost $1000 or more for a 1TB drive.

  • Colorful Web Forms does not work in IE like it does in Firefox

    Well, I have this great colorful web form that I got from Paulo Vale. The colors of the textareas, textfields, and select lists all change colors as they should when I mouseover them and when I set focus and type in them .......... if I am in Firefox.
    When I try to run my application in IE, none of this works.
    Does anyone know what I need to do to get this to work in IE like it does in Firefox?
    Thank you,
    Maggie

    Yes, I can provide the code.
    Thank you, Andy
    &lt;style type="text/css"&gt;
    select.slCamp {
    color:
    #000000;
    background-color:
    #FFFFCC;
    cursor:
    pointer;
    select:hover.slCamp {
    color:
    #000000;
    background-color:
    #E6FF97;
    select:focus.slCamp {
    color:
    #FFFFFF;
    background-color:
    #81AD00;
    textarea.taCamp
    background-color:
    #FFFFCC;
    textarea:hover.taCamp {
    background-color:
    #E6FF97;
    color: #000000;
    cursor: pointer
    textarea:focus.taCamp {
    color:
    #FFFFFF;
    background-color:
    #81AD00;
    cursor: text;
    textarea.taOptCamp
    background-color:
    #FFFFFF;
    textarea:hover.taOptCamp {
    background-color:
    #E6FF97;
    color: #000000;
    cursor: pointer
    textarea:focus.taOptCamp {
    color:
    #FFFFFF;
    background-color:
    #81AD00;
    cursor: text;
    select.slOptCamp {
    color:
    #000000;
    background-color:
    #FFFFFF;
    cursor:
    pointer;
    select:hover.slOptCamp {
    color:
    #000000;
    background-color:
    #E6FF97;
    select:focus.slOptCamp {
    color:
    #FFFFFF;
    background-color:
    #81AD00;
    &lt;/style&gt;
    Andy, anything that has an 'Opt' in the name is used with a field or list that is optional. I did this so that there would be a difference in the manddatory and optional fields.
    Edited by: mjhamilton on Jan 5, 2009 12:01 PM

  • Headphone audio does not work.  The external output does NOT appear in system preferences at all

    It does NOT have a red light.  I have had that issue before ad was able to fix it.  My external output does NOT show up in my system preferences at all.

    Pram reset
    http://support.apple.com/kb/ht1379
    (Try a few times as you may not get the correct sequence 1st time)
    also plug headphones in a few times in case switch sticking

Maybe you are looking for

  • Recording from vinyls

    I have a turntable connected to a pre amp connected to the audio line in port of my imac. The signal is good as you say - but likewise no sound. Have you found out how to get sound output? I want to record my vinyls - do you have any tips on digitizi

  • Kindle Fire HDX - Skype video calling, video is de...

    When I use Skype on my Kindle Fire HDX 7" I get really good calls when it comes to audio calls. When it comes to video calling though, the sound is excllent as well as the video quality, but the video is 3-4 seconds delayed in contrast to the sound r

  • Allowing Shockwave Player to run for non-admins

    Hi all, I see the following problem on and off for years now, with Adobe Flash and in particular Adobe Shockwave Player. I have a school that has a Windows 7 lab. Shockwave Player 11.6 is installed as part of the base image. It shows up in "Programs

  • Insert clip at timecode media start?

    Yes, I have looked all over for this question, too. How can I tell premiere to insert a clip onto my timeline at the timecode start?  -MrD

  • SAPGui-Iview with Modzilla Firefox opens default in a new-window

    Hello, i have created a portal role which include SAPGUI-Iviews. With Internet-Explorer apllications are working fine and integrated.With Modzilla Firefox(1.5) the gui iviews are opened outside the portal page and for each GUI-Iview call the modzilla