Expression Join TopLink

Hello,
I'm having problems doing a join with a TopLink expression.
I am using two tables, and I have the two classes corresponding to these tables.
Also the Java Client file for both Java classes.
In the first Java client (BosetudeClient.java) I have this expression :
     ExpressionBuilder bose = new ExpressionBuilder();
     Expression exp = bose.get("betEorIs").like("1318");
     Vector objects = session.readAllObjects(jsftoplink.model.Bosetude.class,exp);
     return objects;
It returns me in a datatable the correct rows according to this expression.
Now, I want to use a join (and an expression) that links the primary key of a table and the foreign key of the second table.
Do I have to code in the BosetudeClient.java or in the second Client.java file?
How can I call multiple classes in the session.readAllObjects()?
Thank you.

You need what is called a parallel expression. The TopLink 9.0.4 documentation describes parallel expressions in section 6.2.1.4.2 of the query building basics chapter.
I am assuming you have a User object mapped to your user table.
User would have fields
id, type, name, group
You could write an expression that looked something like this:
ExpressionBuilder user1 = new ExpressionBuilder();
ExpressionBuilder user2 = new ExpressionBuilder(User.class);
Expression exp = user1.get("group").equal(user2.get("group"));
exp = exp.and(user1.get("type").equal(1));
exp = exp.and(user2.get("name").equal("bar"));

Similar Messages

  • "in" expression in toplink

    hi, i could not find any example of in expression of toplink, can anyone help about the syntax?
    i tried
    Query q= em.createQuery("select o from Ozluk o where o.personelNo in :perNo and o.accessDate in :accessDate");
    q.setParameter(....)
    Edited by: 787734 on 11.Ağu.2010 01:07

    Hi,
    IN expression is not supported in JPA 1.0, it is supported in JPA 2.0.To get JPA 2.0 you need EclipseLink.
    you can use native SQL insideto build in clause and exceute the same using toplink.
    You can also use Expression to pass list of objects using ExpressionBuilder API.Example as given below
    List keys= new ArrayList();
    keys.add(new BigDecimal(10));
         keys.add(new BigDecimal(20));
         keys.add(new BigDecimal(30));
    ExpressionBuilder seq = new ExpressionBuilder();
    ReadAllQuery query = new ReadAllQuery();
    query.setName("findDeptList");
    query.setReferenceClass(Departments .class);
    Expression exp = seq.get("departmentId").in(keys);
    query.setSelectionCriteria(exp);      
    Vector deptVec=(Vector) session.executeQuery(query);
    Hope this helps.
    Regards,
    Vinay

  • Help connect network printer to AP Express joined to an AP Extreme

    I have an AP Extreme network that I have added a AP Express (joined not extended) and thought I could connect my HP LaserJet 2000TN via an ethernet cable to my AP express. But I can not find the printer when I try to print.
    Both APs are n. The AP Extreme is connected to a cable modem via ethernet. The printer is in another room and floor level so thought this would be much easier than running an ethernet cable through the floor to the AP Extreme.
    I think I need the printer IP address but not sure how to find that, but I kind of think it is more that that.
    Any help would be greatly appreciated.
    Thanks

    Hello mhilera. Welcome to the Apple Discussions!
    Is your 802.11n AirPort Express Base Station (AXn) the only router in your network configuration? Do you have the HP printer connected directly to the AXn by USB or wirelessly with the printer's built-in wireless capability?

  • Airport express joins wireless (green flash on) but airplay doesn't work? Why oh Why?

    Airport express joins wireless (green flash on) but airplay doesn't work? I have turn off the firewall on the router, but still I cannot connct wireless to the airport express.

    Please check out the following Apple Support article to see what the minimum requirements are for AirPlay to work.
    Also the following Apple Support article talks about the specifics on how to use an AirPort Express Base Station for AirPlay.

  • Hi I am not sure ! Ask can use airport express join pc ?

    Hello I am deaf ! My use apple .  My friend. Said me can use airport express join PC ?

    The AirPort Express is a wireless router. You can use it in a number of ways, including providing a wireless network that a PC can join.

  • Expression Join

    Hello,
    I'm having problems doing a join with a TopLink expression.
    I am using two tables, and I have the two classes corresponding to these tables.
    Also the Java Client file for both Java classes.
    In the first Java client (BosetudeClient.java) I have this expression :
         ExpressionBuilder bose = new ExpressionBuilder();
         Expression exp = bose.get("betEorIs").like("1318");
         Vector objects = session.readAllObjects(jsftoplink.model.Bosetude.class,exp);
         return objects;
    It returns me in a datatable the correct rows according to this expression.
    Now, I want to use a join (and an expression) that links the primary key of a table and the foreign key of the second table.
    Do I have to code in the BosetudeClient.java or in the second Client.java file?
    How can I call multiple classes in the session.readAllObjects()?
    Thank you.

    If you have a foreign key between the two, then you should probably have a OneToOneMapping between the two. This way when you read the Bosetude class, you can access its' relationship to the other class.
    To optimize the query, you can use fetch joining (addJoinedAttribute()) or batch reading (addBatchReadAttribute()) on the query (ReadAllQuery).
    You could also use a ReportQuery to read both objects if you did not wish to relate them.
    -- James : http://www.eclipselink.org

  • Airport Express Join Wireless Network Disables Ethernet

    I have one of the the older Airport Express (firmware 6.3) and I'm trying to use it to connect a non-wireless machine to an existing network.
    Act as a single Wi-Fi interface to any computer or almost any other devices such as game consoles that has an Ethernet port but doesn't itself have built-in Wi-Fi
    If I choose "join a wireless network" it appears to disable the ethenet port. Any ideas what I might be doing wrong.
    My Setup
    ADSL Modem ------ Time Capsule ---[wireless-g]--- Airport Express ---[ethernet]---Computer

    Unfortunately, the Ethernet port is disabled when you configure the older AirPort Express version that you have to "join a wireless network"
    It can be enabled in the newer 802.11n version, which uses firmware 7.x.x.  Sorry, not possible up update the Express that you have since hardware changes were made in the 802.11n model.

  • SQL IN expression in Toplink

    Hello,
    how can I rewrite the following query using ExpressionBuilder in Toplink:
    SELECT * FROM some_table WHERE (field1, field2) IN ((1, 2), (3, 4))
    Thanks.

    TopLink does not directly support IN with arrays. You can expand the comparison using OR and AND. You could also use custom SQL, or perhaps Expression.appendSQL().
    You may try,
    fieldVector = new Vector(2);
    fieldVector.add(eb.get("field1"));
    fieldVector.add(eb.get("field2"));
    valueVector = new Vector(2);
    valueVector.add(values1);
    valueVector.add(values2);
    eb.value(fieldVector).in(valueVector)
    but I'm not sure it will work, you may need to extend something to get it working.
    -- James : http://www.eclipselink.org

  • Named Query Expression in Toplink workbench

    Hi! All,
    I have a problem which I am not sure how to solve and would appreciate any help on this.
    I have Tables
    Company, Employee, EmployeeTaxType , TaxTypeVal
    Each is mapped to a java class with the same name
    I would like to find all Employee Objects for a company where (taxTypeVal.year=2005 and taxType.quarter=2)
    I cant seem to be able to build a Named Query expression which would produce the same result.
    It always returns All employees who belong to a company and have liabilities in either year =2005 OR quarter=2
    The expression that I wrote was
    AND
    1.companyBO.companyID EQUAL COMPANY_ID
    2.AND
    2.1.employeeTaxTypeBOs.taxTypeValBOs.quarter EQUAL QUARTER
    2.2.employeeTaxTypeBOs.taxTypeValBOs.year EQUAL YEAR

    Please post the SQL that is generated from TopLink, and the xml where you define the NamedQuery. What version of the MappingWorkbench and TopLink runtime are you using?
    Deepak

  • Airport express join wifi

    Hello all
    I have been trying to connect my Toshipa Windows 7 enterprise laptop to a new Airport Express with firmware 7.6. The only way I have managed to do so is by connecting an ethernet cable to the AE and in the airport utility through the selection "Configure other" in the file menu. One interesting detail here would be that the ethernet cable comes from a powerplug device and not directly from my modem/router (non apple).
    This means that the AE is not immediately recognised by through the process i manage to get into the menu of the AE.
    My actual question is this: whenever i have tried to join my existing wireless network, i get a green light but then the only network I see is my existing network and not the apple base. The AE simply vanishes, with a green light however. Off course after that I cannot access it because the airport utility canot find it.
    Is this normal?
    Thank you in advance

    Temporarily, I suggest that your turn off the wireless security on the Cisco router and then test to see if the AirPort Express will connect that way.
    If it will, then you know that it is wireless security settings issue, and you will need try a different security setting on the Cisco. The AirPort Express will connect to a WPA2 Personal network, which is also known as WPA2-PSK-AES.  The Express will also connect to a WPA/WPA2 Personal network, known sometimes as WPA-PSK-TKIP.
    If the Express will not connect to the Cisco network with no security, then you know that it will never connect with security enabled.
    More troubleshooting will be required.  For example, the Cisco router might be using "wide channels" on the 2.4 GHz band, when Apple does not.

  • Airport Express joining a network - Please HELP!

    I just got an AirPort Express 802.11n Wi-Fi, and I am trying to make it so I can get better connection to the internet from different floors of the building wirelessly. When it decides to actually read the Express I can get to the point where it is asking me for the network I want it to join and I select it and put in the password (which I know is correct), but when I hit continue absolutely nothing happens. Its as if I did nothing. So I'm stuck because it doesn't even tell me if I did something wrong or if it wont work or anything.

    Hello feldmane. Welcome to the Apple Discussions!
    If your goal is to extend an existing wireless network with the 802.11n AirPort Express Base Station (AXn), then the option to "join an existing wireless network" would not be the correct choice. If the wireless router you want to extend is another AirPort, then you should use reconfigure them into a Wireless Distribution System (WDS) (for 802.11g) or "extend a network" (for 802.11n). If the other wireless router is NOT another AirPort, then extending with the AXn most likely will not work as very few non-AirPorts are WDS-compatible.

  • Airport Express joined to network but not discoverable

    I have two airport expresses - an older b/g model and a newer draft n model - both on their latest firmwares.
    December last year I joined them both to the wireless network in a new place and both worked fine.
    I hadn't used either since December - so there my have been some airport utility and itunes updates since then.
    Today I plugged either one in and it synched with a green light immediately - however neither could be found in itunes or airport utility.
    I have tied configuring them - both wirelessly and via ethernet cable.
    I have tried a hard reset to restore to factory default and then configure them.
    They can only be found by airport utility and iTunes under these circumstances:
    1. After a hard reset to factory settings - awaiting initial configuration
    2. Configured as it's own wireless network
    3. Joined to the existing wireless network via ethernet only (WiFi off).
    If I join to existing wireless network as I need to do the device is not discoverable.
    I input the correct credentials and then the device reboots - at this stage it drops out of the airport utility and never gets picked up by it even though it reboots with a green sync light, indicating it is now joined to the network.  Only way to still see it after reboot is if it is still attached to computer over ethernet. As soon as ethernet is disconnected it dropsout.
    I would think it was not broadcasting a wireless signal were it not for the fact that it does work when set up as its own wireless network, and also were it not for the fact that it was doing it to two different airport expresses, both different models.
    I have two laptops - one on leopard and the other on snow leopard and still no luck- so I don't think it is an OS update issue.
    I have never had trouble configuring AEX joined to an existing network before and they both were working December last year.
    So in summary: two different model AEX displaying the same behaviour, two mac laptops with different OS' used to configure, tried wireless and ethernet configurations, reboot after configuration gives green sync light but is not discoverable in itunes or airport utility. Airports ARE discoverable when broadcasting their own wireless network or joined to network over ethernet only. Airports are discoverable after hard reset to factory settings but become invisible when correctly joined to an existing wireless network after reboot.
    Please help - it is driving me crazy!!!

    I'm not trying to set it up as a network.
    I just want to be able to play iTunes on my hifi.
    The Airport Express is currently sat right next to an Huawei HG532 router with a solid green light.
    However both iTunes and Airport utility says: "Airport Utility was unable to find any Airport Wireless devices.... make sure it's plugged in etc...."
    Never had a problem before, but i've just plugged it in after a 4 month absence.

  • I can't make my AirPort Express join my D-LINK connection!

    I set the Airport Express to join my D-Link WBR-1310 connection and it goes fine all the way until it is needed to restart the Airport. After that Airport Utility won't find my Airport Express and the Airport won't join the D-Link connection; just keeps blinking the orange light.

    It's likely that the AirPort Express is not being provided with the correct information regarding the wireless security settings. The security settings must match up exactly between your D-Link wireless router and the AirPort Express.
    Can you get into the configuration page for the D-Link router and identify the exact type of wireless security that it is using and post back with that information?

  • Can my airport express join my network via Belkin Router?

    What's up everyone?
    I have a question regarding my apple airport express. Is there any way to get this my airport express to join my belkin network? My current network is being run by my Belkin N Wireless Modem-Router(model# F5D8633au4A)and i can't seem to get my airport to join it properly. Everytime i try to install it, it seems to mess with the signal my laptop gets and the AEX doesn't even connect to the network. The best i've gotten is it shows up on itunes, but i can't select the remote speakers.
    For now, i just want my AEX to be able to join wirelessly so i can use airtunes, but would it also be possible to set it up so that i can plug my xbox into it so it can go online?
    Anyone have any experience setting up the AEX with a belkin router?

    Hi:
    I do not have a Belkin router, but have basically the same problem using a Linksys 54G 802.11n router.
    I can setup my HP laptop/printer/router as a wirelss network, but cannot get my AE to join that network as a client, wirelessly. IF, I have an Ethernet cable connected from the router to the AE, I can configure the AE, get the solid green LED on it, etc., and play music out of external speakers, but all falls apart whn I disconnect the Ethernet cable from the router to the AE, even though Airport Utility has things setup as a wireless connection.
    Have you tried setting up an Apple ad-hoc network from the PC/laptop to the AE and speakers ? See if you can do that. If so, you can play music wirelessly thru the AE/speakers from iTunes (the LED will be a flashing Amber). The trick is that you have to wait about 1-2 minutes duing the config in order for the AE to establish the connection where it (the ad-hoc network) shows up in your system tray network list, when the icon is clicked. The Appel ad-hoc network will have a name like Apple XXXXXX, where the XXXXXX are 6 (of the 12) digits from the AE's MAC address (listed on its label).
    If this works, my guess is that the AE is OK, and the problem is getting your AE to join your already existing Belkin network (in my case, LinkSys network).
    I was at one of "Apple Genius Bars" last night probing this problem, and they feel that this is most likely a compatability problem between the AE and non-apple routers...though I do not feel that there should be a problem, or they shouldn't be selling the product claiming that it works with non-apple products.
    The guys at Apple suggested that I call Apple for Tech Support at:
    1-800-APL-CARE (1-800-275-2273)
    There shouldn't be a charge, though the guys at the Genius Bar said that if they try to charge, to raise a big stink over the phone since the
    Apple product is not working as claimed !
    Another issue: What level of encryption are you using with your router ?
    WEP-64, WEP-128, WPA, WPA2 ???
    This greatly affects how easy (or hard) it is to add the AE to your existing network. From what I have learned, the lower the level of encryption, the harder it is to add the AE to the network, since it is an older, less-capatible standard.
    Let me know if you find any answers...
    DaleB

  • Airport Express joining Linksys WRT54G Wireless network

    I have spent hours trying all different ways of getting my Airport Express to join my Linksys network. And then I discovered that I have to *__remove the spaces from my WPA password__* in order for my AX to join the network. My iMac and MacBook all join the network with spaces in the password, but for some reason the AX does not.
    This may be superstition, but I also made sure the pass phrase was all uppercase and exactly 13 characters. Don't know if that makes a difference, but I was tired of trying different things.
    Hope this helps some one.

    I have spent hours trying all different ways of getting my Airport Express to join my Linksys network. And then I discovered that I have to *__remove the spaces from my WPA password__* in order for my AX to join the network. My iMac and MacBook all join the network with spaces in the password, but for some reason the AX does not.
    This may be superstition, but I also made sure the pass phrase was all uppercase and exactly 13 characters. Don't know if that makes a difference, but I was tired of trying different things.
    Hope this helps some one.

Maybe you are looking for