Almost there - Java 1-1 mapping - but no binding

Hi
I am trying to create a 1-1 mapping for the latest event for a service, and am able to create a new OneToOneMapping in an amendment event for the service descriptor. This generates almost the correct SQL.
OneToOneMapping latestEventMapping = new OneToOneMapping();
latestEventMapping.setAttributeName("latestEvent");
latestEventMapping.setReferenceClass(ServiceHistory.class);
latestEventMapping.dontUseIndirection();
descriptor.addMapping(latestEventMapping);
ExpressionBuilder builder = new ExpressionBuilder(ServiceHistory.class);
Expression latestEventExp = builder.get("serviceId").equal(builder.get("service").get("serviceId"));
ReportQuery subQuery = new ReportQuery(ServiceHistory.class, new ExpressionBuilder());
Expression subQueryExp = subQuery.getExpressionBuilder().get("serviceId").equal(builder.get("serviceId"));
subQueryExp = subQueryExp.and(subQuery.getExpressionBuilder().get("eventDate").greaterThan(builder.get("eventDate")));
subQuery.setSelectionCriteria(subQueryExp);
subQuery.addAttribute("serviceId");
latestEventExp = latestEventExp.and(builder.notExists(subQuery));
latestEventMapping.setSelectionCriteria(latestEventExp);
This creates
SELECT t0.EVENTDATE, t0.EVENTCONT
ENT, t0.EVENTCOMMENTS, t0.EVENTSOURCEID, t0.EVENTTYPEID,
t0.SERVICEID
FROM
     SERVICEHISTORIES t0,
     SERVICES t1
WHERE (((t0.SERVICEID = t1.SERVICEID)
AND NOT EXISTS (
     SELECT t2.SERVICEID FROM SERVICEHISTORIES t2
     WHERE ((t2.SERVICEID = t0.SERVICEID)
     AND (t2.EVENTDATE > t0.EVENTDATE)))
AND (t1.SERVICEID = t0.SERVICEID))
I would expect to see this query generated once for each service object, with a binding for [serviceId = ?] As it is, the query is only called once and all services have the same latest event object reference.
What am I doing wrong? It feels like I am almost there...
James

James
Thanks for the hint - but in your example, where does SERVICE_ID come from? Is this supposed to be a qualified or unqualified database column name
i.e. SERVICES.SERVICEID
or is it a name of the attribute from the class behind the descriptor that owns this mapping? The only place I set the mapping's descriptors class is
descriptor.addMapping(latestEventMapping);
and I am worried that I have not stated that the mapping source class is Service.
At the moment I get the error message
Exception Description: The parameter name [serviceId] in the query's selection criteria does not match any parameter name defined in the query.
Query: ReadObjectQuery(com.surfkitchen.skynet.central.ServiceHistory)
I am confused because I have not defined a query, although I would expect the descriptor's source class (Service) to provide a set of parameters representing the primary key to all of its mappings.
James

Similar Messages

  • In firefox, the video from website "tv.vu.edu.pk" is not displaying even i have installed the latest version of JAVA. There rotates a circle around java monogram every time but video is not playing even it is working fine with internet explorer

    In firefox, the video from website "tv.vu.edu.pk" is not displaying even i have installed the latest version of JAVA. There rotates a circle around java monogram every time but video is not playing even it is working fine with internet explorer

    It's not working here as well with Java 6 U25 on Linux.

  • Hey guys, i need HELP !!!My iphone 6 just gave stolen .... But i hope that can take all the photo back... Total is almost 3000 pc ... But my icloud storage just 5gb only ... If there have any ways to let me get back those photo ? Those photo really m

    Hey guys, i need HELP !!!My iphone 6 just gave stolen .... But i hope that can take all the photo back... Total is almost 3000 pc ... But my icloud storage just 5gb only ... If there have any ways to let me get back those photo ? Those photo really mean a lot to me .... Have alot of memory with family ... It's very meaningful !!! Please kindly help me !!! Thanks           

    Please please help me, if you know how.

  • TS3408 I keep on getting this error message on my Yahoo and Safari You're almost there, but your web browser doesn't support the newest version of Yahoo! Mail

    I keep on getting this error message on my Yahoo and Safari all of a sudden;
    You're almost there, but your web browser doesn’t support the newest version of Yahoo! Mail
    The links it gives to upgrade don't work !
    I have Safari Version 5.1.7 the latest for Snow Leapord. I get the same error message on Firefox and Google Crome aI even dowmloaded another Brower for Mac still got he same error message ! I have used the Disk Utility to rparir files and rest Safari. I have deleated Firefox then downloaded a fresh version, still the same error messages ! Please help it's driving me nutts.

    Perky --
    You do not need any "Cleaner" app for Macs.  I would not be at all surprised if that didn't actually damage your Mac, especially if it were MacDefender. Applejack is OK, but I'm not sure what it erased.  Do you know?
    You also don't need any Virus Barrier.  That could also mess things up.
    The fact that all of your browsers are now messed up indicates that it is not a Safari problem, but more system-wide.
    Did you check here?
    http://help.yahoo.com/l/us/yahoo/mail/yahoomail/technical/

  • I keep on getting this error message on my Yahoo mail. You're almost there, but your web browser doesn't support the newest version of Yahoo! Mail

    I keep on getting this error message on my Yahoo mail all of a sudden;
    You're almost there, but your web browser doesn’t support the newest version of Yahoo! Mail
    The links it gives to upgrade are blocked
    I have latest version of FireFox 19 and Snow Leopard. I get the same error message on Safari and Google Crome aI even downloaded another Browser for Mac still got he same error message ! I have used the Disk Utility to repair files and rest Safari. I have deleted Firefox then downloaded a fresh version, still the same error messages ! Please help it's driving me nuts.

    You can check for problems caused by a possibly corrupted user agent.
    See:
    *https://support.mozilla.org/kb/Finding+your+Firefox+version
    *https://support.mozilla.org/kb/websites-say-firefox-outdated-or-incompatible
    *http://kb.mozillazine.org/Resetting_your_useragent_string_to_its_compiled-in_default

  • You're almost there, but your web browser doesn't support the newest version of Yahoo! Mail

    You're almost there, but your web browser doesn’t support the newest version of Yahoo! Mail
    I have the latest Mozilla Firefox 19.0.2 but the newest version of Yahoo Mail don't work,what can' i do?

    your useragent (the information the browser sends to websites to identify its version) go overwritten probably by some sort of toolbar/adware. please refer to this article in order to reset the user-agent settings in firefox: [[Websites say that Firefox is outdated or incompatible even though it's the latest version]]

  • I have FF5.0.1 installed but you keep sending me the "you are almost there" message and I have to delete it each time

    Do not know how much more detail you need. Every time I open Firefox which is already Ver 5.0.1. What I get is the screen that says "You're almost there, but you have an old version of Firefox and need to upgrade to Ver 5.0.1. I am fed up with going thru this nonsense. I ALREADY AM USING VER 5.0.1. Sylvia Kuenemann

    See these articles for some suggestions:
    * https://support.mozilla.com/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    * https://support.mozilla.com/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    * http://kb.mozillazine.org/Preferences_not_saved

  • I down loaded Firefox 3.6.10, did the execution and still when load it as my browser I get a message that says "Almost there". What is going on?

    When I load Firefox as my browser, a screen comes up that wants me to download the 3.6.10 version again but, as I said, it has been downloaded, executed and I have tried this several times with the same result. I run Vista Home Premium operating system. I can still browse the internet but still get my home page as "You are almost there" or some such. What should I do?

    I have tried everything I could to fix this, but some things require actually being on Firefox, and since I cannot get on, I cannot click on the tabs to do it. I have even totally uninstalled firefox, and that has not fixed this. I still get the same message that firefox is running and I need to close it or restart (which I have also tried dozens of times). I have removed things like Java, and that has not helped either. If I cannot even get on line in firefox, how can I fix this. I am not crazy about using internet explorer, but right now, it is my only option. I even tried to start in safe mode, and the same message box pops up!

  • Rmi almost there

    rmi almost there
    I did a version 1.1
    javac -tareget 1.1 ct277/*.class
    rmic -v1.1 rImp
    put everything in a jar
    compiled OK (so the class is seen in the build process)
    but on execution I got:
    Exception Details: javax.faces.el.EvaluationException
    java.lang.NoClassDefFoundError: cts77/rInterface (wrong name: rInterface)
    Possible Source of Error:
    Class Name: com.sun.faces.el.ValueBindingImpl
    File Name: ValueBindingImpl.java
    Method Name: getValue
    Line Number: 206
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    Stack trace:
    com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
    com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
    com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:389)
    javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1018)
    javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1045)
    javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:742)
    javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:423)
    etc etc...
    ps I posted this yesterday but it is not there now
    maybe
    1) I posted to some other forum by mistake
    2) SUN moderators removed my post because they think rmi topic is exhausted
    3) SUN moderators removed my post because they have had enough of me.
    if 2) or 3) could the moderator please email me so I dont go on posting in vain?
    cheers
    CTSkinner

    I followed the stripped down example in
    http://patriot.net/~tvalesky/easyrmi.html
    then renamed Implementation rImp
    and interface rInterface
    server rServ
    and replaced the method with a String function that returns "fred"
    - as simple as I could make it
    - it works with java Client from the command line.
    When I put all the classes in a jar, and include the jar in a Creator project, the rImplementation class is found at Build time, but causes an immediate exception at execution time
    (could there be a security problem? even though the error is ClassDef not found? I have my win2K user set at java allow all - which I hope is safe while I'm testing on 127.0.0.1)
    I put this code in a button:
    public String button1_action() {
    String serverName = "127.0.0.1";
    String cs = "ccc";
    try
    {     //bind server object to object in client
    rInterface Servo = (rInterface) Naming.lookup("rmi://"+serverName+"/rImpInst");
    cs = Servo.getSlug();
    catch(Exception e)
    cs = "Slug catch";
    // Vanilla van = new Vanilla();
    // cs = van.fudge();
    FacesContext fc = javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage(cs, ""));
    return null;
    but note: the project raises exception immediately, before the button is painted
    [the commented Vanilla.fudge is an ordinary non-rmi class which displays OK if
    Servo is not defined]
    note: cts77 is the package name. I get the same error if I explicitely say
    cts77.rInterface.
    I would be happier if no packages were involved, because rmic may not understand packages.

  • Is there any linked hash map in flex??

    Hi
    Is there any linked hash map in flex??
    Actually I am getting linked hash map from java but the objects inside them are scattered.
    Thanks and Regards
    Aruna.S.N.

    See the bottom of this LiveDoc page on ActionScript and Java type conversions.
    http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html
    If this post answers your question or helps, please mark it as such.

  • Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default

    in use:
    vRO 5.1
    eclipse 3.7.2
    vRo plug-sdk 5.1
    steps:
    1.create a plug-in project from samples(choose solar system)
    2.find the dar package and upload it by vRo configuration
    3.vRo configuration said upload successfully,but the solar system configuration is not properly configued..
    problem:
    Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default
    How to solve it??
    Thanks so much!!

    There was problem from crm side...its working now..

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • Desktop Java May not last but Enterprise Java will

    I have realized that there seems to be a kind of a futile effort battling .NET on Windows Desktop. Its really crazy having put so much effort learning desktop java only to realize that .NET may eventually topple it.
    What gives me joy anyway is the general response to Enterprise Java. Its seems to be very strong especially when coming from the perspective of the the growth of linux and the security model of its architecture. I will advice any new java newbie to just start migrating to Enterprise Java as soon as he starts picking up in java otherwise the effort to overthrow .NET on windows desktop may be toppled eventually. But i think that Desktop Java Should be empowered more for Linux Platforms this days.
    I dont know if there is a contary opinion but i am raising this issue becuase I have applied for so many IT jobs only to realize the are looking for .NET or VB when it comes to Desktop Applications. Also I will also suggest that IDE builders community shouls also support the growth of easy-to-use IDEs for J2EE so as to encourage new user to come in.
    Cheers

    I'm a web developer for 4 years, use coldfusion and over the last year started to migrate over to j2ee,
    I'll admit it a learning curve at the start from procedural to OO, however I am the only java developer in
    the company, the rest are VB, and everything Microsoft. I have to admit a hate it, DLL hell as far as COM
    is concerned.
    I don't know the difference between .NET and the old school VB stuff, but our guys are not singing off the .NET hymn sheet. If anything they are swayed by the power of java and the open source projects like apache coocon,James,POI,AXIS,Jakarta Tomcat the list goes on. However they all still develop in old VB, which quite a lot of companies are still doing.
    Its very expensive to buy is it not.
    I hate everything to do with Microsoft personally, "let me sell you a server, and I'll sell you the other half".

  • From "Almost there" when opening firefox, attempt download takes me back to "Almost there" repeatedly.

    I am unsuccessful in downloading the new 5.0.1 firefox version. I can't get past the "Almost there" screen because I download and click on the Firefox symbol to move it to the Applications folder, and when I move it from there to the Dock and open it, again, it says "Almost There." It tells me I can't perform this because I already have Firefox open, even though I have tried again and again to quit it. Do I need to delete every single vestage of firefox and start over with my bookmarks, etc. to make this work?

    A brief and probably non-helpful answer: I know of no way to eliminate your large amount of duplicates other than by repetitive, tedious manual effort.
    *There has got to be a simpler way.*
    I hope you're right, but I don't think there is a simpler way.
    BACKUP:  It also appears that the only way I can back up the catalog is to shut down LR.  Really?!
    Yes, really

  • Link Aggregation ... almost there!

    Hi all
    After struggling with Link Aggregation on Mac OS X Server to Extreme X450 switches we are almost there. We've now managed to get a live working link where the Ethernet 1 and 2 arew green and the Bond0 shows both links as active, and finally the Bond0 interface picks up a DHCP address.
    So that's great, but no Network connection which is weird because it got an IP address.
    Do we have to route the traffic over one of the other interfaces or something?
    Any suggestions at all?
    Cheers
    C

    Camelot wrote:
    The first, or at least - most obvious, problem is that you have IP addresses assigned to each of en0 and en1.
    This should not be the case. Only the bond0 network should have an IP address assigned.
    The other interfaces should not be configured at all. That's almost certainly the issue since your machine has three IP addresses in the same subnet - one on each of en0, en1 and bond0. It's no wonder things are confused
    Thanks that now works a treat!
    Was hoping you could help on another set of ports again being configured for Link Aggregation. We have tried to set it up in exactly the same way but again its not working. The ifconfig returns back the following:
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
    stf0: flags=0 mtu 1280
    en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::219:e3ff:fee7:5706%en0 prefixlen 64 scopeid 0x4
    inet 169.254.102.66 netmask 0xffff0000 broadcast 169.254.255.255
    ether 00:19:e3:e7:57:07
    media: autoselect (1000baseT <full-duplex,flow-control>) status: active
    supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control>
    en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::219:e3ff:fee7:5707%en1 prefixlen 64 scopeid 0x5
    inet 169.254.102.66 netmask 0xffff0000 broadcast 169.254.255.255
    ether 00:19:e3:e7:57:07
    media: autoselect (1000baseT <full-duplex,flow-control>) status: active
    supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control>
    fw0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 2030
    lladdr 00:1b:63:ff:fe:6e:6c:8a
    media: autoselect <full-duplex> status: inactive
    supported media: autoselect <full-duplex>
    bond0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:19:e3:e7:57:07
    media: autoselect status: inactive
    supported media: autoselect
    bond interfaces: en1 en0
    When I compared this to the working Link Aggregation ifconfig output I noticed this one has the line "media: autoselect status: inactive" as appose to active. Could this be the cause and how do I rectify it?
    Thanks

Maybe you are looking for

  • IPod not syncing with iTunes

    Okay, I checked the other topics here but I don't see anything that quite matches my issue. I recently (like many others) updated to iTunes 9 (I'm using Windows Vista), and now my 5th Gen 30gb video iPod won't sync. I'm not getting any error messages

  • Limit the result in the query's varible selection.

    I have many reports involed the requirment that in the query's varible selection we only want the users could see the calmonth demanded by me such as 200903,200902,200901,200812 and 200811 before the current system date (not include the future calmon

  • Fixing Gnome 3.8 Classic Mode

    I've abandoned the no longer supported Fallback mode as very few things are still working. I'm trying to get Classic mode to work the way I want it but have found that it is not conducive to customization. After many searches I still can't find answe

  • Muse vs Wordpress for Real Estate site?

    I need to make a fairly complex site for a real estate developer who has several subdivisions and offers extensive services.  I would love to use Muse for the design flexibility, but I can't find how I can make a searchable database of properties tha

  • Automatic batch generate for raw materila in migo

    Dear Sir, When i am doing goods receipt of raw material in MIGO when we click on check that time automaict batch genration should be done so where is customizing setting of internal batch generation.Please guide me in detail