[JPA] Manually instantiating entities with lazy associations. How?

Hi,
I need to construct a dynamic native query.
(I can't use JPQL, because I need to call stored procedures. I can't use a named native query because I'm working on a Search Page and the users may enter various search criteria. A static named query won't be flexible enough for me. I must generate a query on-the-fly.)
So, I don't know how to make the dynamic native query to produce entities for me, because I don't know how to specify resultSetMapping for it. So, I'm forced to instantiate the entities manually.
But now I've run upon another problem. The entities have associations. I need them to be LAZY associations. So, how can I manually instantiate an entity in which the associations aren't triggered yet? I think it's not possible but I figured that it doesn't hurt to ask.
I seem to have a HUGE problem in my hands.
(If only JPQL could call stored procedures, I'd have constructed a JPQL dynamic query and that would be it. Come to think of it, it all boils down to generating a SQL string from the JPQL string. And generating a stored procedure call inside that SQL string shouldn't be that hard, especially having in mind how many other hurdles have already been overcome by the JPQL parsers. But alas, it's not possible. At least I don't know of a way to do it.)
Best regards,
Bisser

Ooops, sorry about my post above. I just noticed that I can specify the resultClass or the resultSetMapping as a parameter to the EntityManager.createNativeQuery(...) method.

Similar Messages

  • Reverted OS with MobileMe associated, how can I link it to my iCloud account?

    Hi, I have three Apple Compueter, all of them had iCloud running.
    I had a disk failure on one of them and I found that the only working copy of my disk image with the Apps and files has MobileMe on it right before migrating.
    How can set up my iCloud account again on this Mac?
    When I get to the iCloud log on, it says that I must migrate my data from MobileMe to iCloud, problem is that MobileMe is long gone. Any way to remove it?
    Thank you,
    JM

    Hi,
    Yes  was a rever to 10.7.x but I am now in 10.7.5. However, the image I had backed up had MobileMe credentials and when I try to log onto iCloud, it tells me I have to migrate from MobileMe.
    I believe what I am trying to do is disasociate the MobileMe account then go directly to iCloud on this machine.
    Thank you,
    JM

  • HANA XSODATA Create multiple entities with associations in single LUW

    Hi all,
    Is it possible to create multiple entities with associations in a single LUW.
    For e.g. we have a Sales Order and Item. This is modelled as 2 DB tables and 2 entities.
    In XSOData I have defined association relationship between them.My XSOData definition is like this...
    "XSDemo.DB::SO"    as "SalesOrder"
       navigates ("SalesOrder_OrderItem" as "SOItem");
       "XSDemo.DB::ITEM" as "OrderItem";
       association "SalesOrder_OrderItem" principal "SalesOrder"("OrderID") multiplicity "1"
       dependent "OrderItem"("OrderID") multiplicity "*";
    My post URI is
    http://server:port/SODemo.xsodata/SalesOrder
    My data is as follows
      "ID": 1,
      "Customer": 123,
      "Desc": "Test SO",
      "SOItem": [
          "Material": "MAT1",
          "Qty": "10",
          "Item": "10"
          "Material": "MAT2",
          "Qty": "20",
          "Item": "5"
    From the post, I get a response 201 (Created). However, only the Sales Order is created. The Items are not created.
    My question is:
    1. Is it possible to create Order and Item together in a single post call ?? If yes, how. What is the syntax of XSOData / Post Request
    2. If it is not possible to create Order and Item together in a single post call, then how do we ensure atomicity of the transaction.
    For e.g. What is Order creation is success and then the Item creation fails ...
    How can we ensure that all is committed or none is committed.
    3. From the documentation I understand that this might be possible using modification exits... However, I want to achieve this without using modification exits...
    Is this possible or not ?

    Hi Thomas,
    Actually the problem is that Sales Order and Order Items are modeled as different entities... So, XSOData allows creation of Sales Order Item independently WITHOUT creation of a sales order header.
    For e.g. URL : http://server:port/SODemo.xsodata/OrderItem
    Ideally, the XSOData should implement a logic that a Dependent entity cannot be created without a Principal entity.
    For e.g. using a Sales order BAPI you cannot create a sales order item alone !
    Similarily, since XSOData is the end point service for the consumer, the XSOData should have the logic to ensure that both principal and dependent entities are created together.
    Otherwise, in the UI the developer has to ensure that the post body is build correctly...

  • How do you manually manage podcasts with the new iTunes?

    Like the subject line says: How do you manually manage podcasts with the new iTunes?
    With the previous version of iTunes, when I plugged in my iPod, I could select the iPod, select podcasts, and manually delete episodes. With the new iTunes, I can't select individual episodes when looking at my iPod through iTunes. Is my only option to Sync? If so, why is that my only option?
    This question probably has a simple answer, and I'm just not seeing it.

    Rock,
    I think I figured out a way to do what you want to do - which is the same way that I use Itunes with my Ipod. (My Itunes libary was destroyed last year so I can no longer auto synch my Ipod as I would lose thousands of songs).
    Funnily enough, I discovered this new way of manually moving podcasts while trying to figure out what cpragman was trying to say (I never could - he must be smarter than me, as I couldn't get his method to work).
    1. Open up your Itunes in your regular Library view. Choose Pocasts from the left hand side (either in the sidebar if you have that enabled, or from the little "radio" icon if you don't.)
    2. Mouse to the podcast you want to place on your Ipod.
    3. Right-click it.  A long menu will pop up.
    4. Move to the "Add to Playlist" option.  As you hover, all your playlists will be visible. But at the very top will be the name of your Ipod itself (whatever you named it originally).  Choose THAT name, and voila! That podcast will now copy to your Ipod and be easily available when you disconnect.
    A nice feature of this method is that you can shift-click several podcasts at once and do the same thing, and all your selected podcasts will copy over (if you're like me and update your Ipod only every few weeks).
    Hope this helps - let me know if it works for you!

  • How do I manually transfer music with the new itunes update for Windows?  I don't want to sync my library and lose all of my music for what I have in my current library.

    How do I manually transfer music with the new itunes update for Windows?  I don't want to sync my library and lose all of my music for what I have in my current library.

    The same way it was done in every previous version.
    Connect the device to the computer.
    Right click on the device in iTunes and select Transfer Purchases.
    Why would you lose any content by syncing with iTunes?
    Is this not the computer that the device is normally synced with?

  • [svn:bz-trunk] 18814: Add manual test for BLZ-594 with instructions on how to run the test.

    Revision: 18814
    Revision: 18814
    Author:   [email protected]
    Date:     2010-11-24 09:31:56 -0800 (Wed, 24 Nov 2010)
    Log Message:
    Add manual test for BLZ-594 with instructions on how to run the test.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-594
    Modified Paths:
        blazeds/trunk/qa/apps/qa-manual/WEB-INF/flex/remoting-config.mods.xml
    Added Paths:
        blazeds/trunk/qa/apps/qa-manual/WEB-INF/src/test/
        blazeds/trunk/qa/apps/qa-manual/WEB-INF/src/test/RpcTest.java
        blazeds/trunk/qa/apps/qa-manual/bugs/BLZ-594/
        blazeds/trunk/qa/apps/qa-manual/bugs/BLZ-594/BLZ-594.mxml
        blazeds/trunk/qa/apps/qa-manual/bugs/BLZ-594/readme.txt

    You do have a very complex looking site and may need several tables in mysql to handle all that data. If you knew to phpmysql I would suggest taking a look at this tutorial it will help get you started in understanding how to $_GET info from a database and also how to $_POST data to a database. I am no expert just learning myself and I found this very helpful. This is the link http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    There are also many tutorials on Youtube to help build a CMS Content Management Site I would suggest the following: -
    http://www.youtube.com/user/phpacademy
    http://www.youtube.com/user/betterphp
    http://www.youtube.com/user/flashbuilding
    And many more on my channel here
    http://www.youtube.com/user/Whisperingonthewind
    CMS's are easier to maintain, add edit and delete content.
    I have also recently bought a Book by David Powers Training from the Source very helpful.
    Anyway hope you get it sorted.

  • HT204053 I have a phone number associated with face time. how can I delete it?

    I have a phone number associated with face time. how can I delete it?

    You mean from your iPhone?  Don't think this is possible.

  • I want to use my IPOD Classic 160gb for notepad entries in addition to the music and books I listen to. It is set to "Open ITunes when connected to computer" and "manually manage music and videos". How can I do that without losing some of the features

    I want to use my IPOD Classic 160gb for notepad entries in addition to the music and books I listen to. It is set to "Open ITunes when connected to computer" and "manually manage music and videos".  How can I do that without losing some of the features of those two?   I just want to add a feature.  Thanks

    Settings>Store (or iTunes & App Stores if you are running iOS6)>Apple ID. Tap your son's ID and sign out. Sign in with your ID and password.
    You shouldn't lose the music, but if you try to update any apps that you bought with the family ID, you will have to use that password that is linked with that ID in order to update.
    Avoid downloading past purchased content with the old ID if you can since you will associate the iPad with the old ID for 90 days and you will lock yourself out of your own, new ID for that period of time. Read more about associated devices in iTunes here.
    iTunes Store: Associating a device or computer to your Apple ID

  • Lazy associations

    We understand that FDS supports lazy associations, but the
    documentation is unclear about whether it's necessary and in what
    manner to partially initialize an array which is not empty but in
    the "lazy" state, as opposed to the fully initialized state, and
    the empty state.
    We are using the Java adapter, so our application is
    responsible for how data comes out of the DAO layer.
    Any information would be appreciated - thank you.

    If you are returning collections where the set of ids is too
    large to be returned all at once, you should implement that
    relationship using a fill method, not using an association
    property. In this case, usually the id of the related item is at
    least one of the fill parameters. For example, I have reimplemented
    the crm demo in beta 2 so that it returns the list of employees for
    a given company as a fill method which takes the company id as a
    parameter. This allows you to either use fill parameters to
    demarcate pages (i.e. you might have a page number parameter), or
    to use flex's built in paging support.
    Currently in FDMS, the fill method must return all of the
    items to be returned in the fill so if the fill is too large to be
    returned as a single result set even for the server, you need to
    split it up using fill parameters to control the paging (in other
    words, you have to do paging yourself and can't use fdms' builtin
    paging support to do this automatically). Though we wanted to
    support complete 'client controlled' paging all the way through to
    the database, it is fairly challenging to keep a list sync'd
    between two clients when you do not even know the complete contents
    of the list, how big it is, the ways the client can access pages
    etc. We might be able to support a variant of the fill method which
    implements paging only for the auto-sync-enabled=false case (where
    you are not sync'ing changes between clients) but it sounds like
    you need clients to be kept in sync even on these large lists as
    they change?
    I think that in the general case of client controlled but
    server performed filtering and sorting, you pass in the sorting and
    filtering criteria (including ranges) via fill parameters. The
    server performs the operation and returns that set of items so you
    get an ArrayCollection on the client which contains just a page of
    data at a time. If you want to implement a virtual array collection
    on top of that which represents the entire data set that will then
    make fill calls as needed to fetch pages you'd have to do that
    yourself in action script code. Another strategy would be to make
    the paging controls explicit in the UI (ie. have a next page button
    which fetches the next page instead of scrolling through the list)
    and that would make it easier.
    In terms of caching, when you have auto-sync-enabled set to
    true, FDMS must at least cache the graph of ids of all of the
    managed items by all active managed clients. By default, it caches
    the items too but you can turn this off with
    <cache-items>false</cache-items>. If you need to keep
    your clients up-to-date with changes performed by code that
    accesses the DB directly or is just not going through flex, you can
    use the 'server push api' to tell flex about these changes, or just
    use this api to periodically refresh your clients. If your clients
    do not need to be made aware of these changes, you can just let
    them drift out of sync and use the conflict detection facilities to
    deal with stale updates. If you are using timestamps for your
    version numbers, you could probably implement a "get me a list of
    everything that has changed" query in a scheduled task which then
    uses the server push api to keep clients in sync.

  • I need to open a file with an associated programm.

    I need to open a file with an associated programm.
    I'm looking for two solutions:
    1. for Linux/Solaris/Unix/...
    2. for Windows 95/98/Nt/2000
    For Windows I have done this with command line
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + uSavePath);
    but it doesn't work on windows2000. We need an universal solution.
    For linux
    Process p = Runtime.getRuntime().exec("netscape openURL " + uSavePath);
    But may be anybody know better solution?

    You are right. For unix better solution is that my program to care about all association itself. As I undestend now it's a common solution for unix applications.
    But for windows it will be ugly enough. I've found another way for windows
    Win2000/NT: "cmd /C start filename /B"
    other Wins: start filename
    for linux I've stopped at doing this via Netscape.
    May be in future I'll make my property file.
    start filename - on Win95(may be 98/ME) returns -1 if file not assotiated with a programm, and doesn't shows openWith dialog. It solved using something like "rundll32 shell32, OpenWith filename"
    It's all for those how will solve this problem in future.

  • I had created two photo albums on my ipad, by transferring photos from my hp laptop. I want to make space available on my ipad by deleting these photos, but the same hp laptop is no more with me. How do I delete these photos?

    I had created two photo albums on my ipad, by transferring photos from my hp laptop. I want to make space available on my ipad by deleting these photos, but the same hp laptop is no more with me. How do I delete these photos?

    1, you can't at the moment, though with iOS 5 in the Autumn, from http://www.apple.com/ios/ios5/features.html#photos :
    Even organize your photos in albums — right on your device
    2, by removing it from you synced from and re-syncing. Only photos taken with the iPad, copied to it via the camera connection kit, or saved from emails/websites etc can be deleted directly on the iPad (either via the trashcan icon in the top right corner if viewing the photo in full screen, or via the icon of the box with the arrow coming out of it in thumbnail view)
    3, the location of the photos that you synced to the iPad should be listed on the iPad's Photos tab when connected to your computer's iTunes.
    4, you can copy the photos from your iPad to your computer : http://support.apple.com/kb/HT4083 . You should also be able to delete them from the iPad as part of the transfer process to your computer, and it's then your choice whether to add them to your sync photo list so as to copy them back to the iPad. Copying them to your computer would allow you to organise them into folders and therefore be able to sync them back into separate albums.
    5, I don't use Dropbox either. There are some third-party browser apps in the iTunes App Store that allow you to download pages so that you can view them when offline e.g. Atomic Web (the whole page is saved within Atomic Web, it doesn't place a photo into the Photos app)
    6, deleting content should help. If you remove an app from your iPad then you also remove the content that it's got on the iPad - so if you then decide to reinstall it back onto the iPad then you will need to manually add back any content that you want in it. None of the Apple built-in apps (including Photos) can be removed from the iPad

  • Manual key negotiation with pix 501

    how to use manual key negotiation with pix 501 6.3 to solve VPN tunnel negotiation problem

    http://www.cisco.com/en/US/docs/security/pix/pix63/configuration/guide/ipsecint.html#wp1045493
    "Manual configuration of SAs is not supported on the PIX 501 because of the restriction in the number of ISAKMP peers allowed on that platform."
    However I'm sure a proper solution can be found to your original problem (establishing VPN with huawei)
    Please rate helpful posts.
    Regards
    Farrukh

  • Pricing - Manual Condition Type with value = 0

    Hi gurus,
    I need to insert a manual condition type with value = 0 into the billing data set.
    I realize that if its valiue is 0 it is not active.
    Anyone knows how to make it active despite its value = 0?
    Thank you.

    Dear Customer,
    if you have customized the condition as price then the condition will be inactive if the condition is set to zero.
    This is calling in:
    LV61AA55                                                                               
    inactivate prices with rate / condition value zero                   
          if xkomv-koaid eq 'B' and xkomv-kbetr eq 0 and komp-kposn ne 0 and 
             xkomv-kgrpe eq ' ' and xkomv-kinak ca ' Y' and xkomv-kwert eq 0 
             and xkomv-kntyp ne 'e' and komp-fareg na '45'.                  
            xkomv-kinak = 'X'.                                               
          endif.                                                             
    If you need an active condition with value zero, then the condition class should not be 'B' (price)
    I hope that the information are helpful.
    regards
    Claudia

  • Deactivate manual PR creation with account assignment "N"

    Hi experts,
    How to Deactivate the manual PR creation with account assignment "N" in ME51N ,as these PR with account assignment "N" is to be made from CJ20N Tcode.
    Kindly help..
    Thanks

    Hi,
    The above proposed solution is not working.Kindly let me know if can be done through any development.If so,please tell me the USER EXIT for this requirement..
    There is no way through configuration changes to block the manual creation of PR for account assignment "N"
    Thanks
    Edited by: ARITRA MUKHERJEE on Sep 4, 2010 10:13 AM

  • I have purchased the ESO 60Da and the manual that came with it is for the 60D.

    I have the EOS 60Da and the manual that came with the camera is for the 60 D I need a source in info on how to use the camera specifically for astro photography.  I know absolutely nothing about this.  My telescope is the Meade RCX 400 16" and I live in Belize in Central America

    http://www.usa.canon.com/cusa/professional/products/professional_cameras/digital_slr_cameras/eos_60d...
    Edit: Ok, looks like that doesn't really supply any real information.  I'd assume the camera works the same as the 60D, but providing information on how to connect various third-party telescopes is kind of outside the scope of Canon documentation.

Maybe you are looking for