Expression.get("PRODUCT_ID").getField("PRODUCT_NAME").like("Freezer")

Hi! All,
In ServiceRequests Table Product_Id is a an attribute, and Product Information like Product Name , Product Description is in Products Tale. The relation between theses is Product_Id column in ServiceRequests Table.
Getting the Product_Id , I need to get the Names of the Produts that have Freezer in the first word of their name.
for that I'm doing,
ReadAllQuery raq= new ReadAllQuery(ServiceRequests.class);
raq.setReferenceClass(ServiceRequests.class);
ExpressionBuilder builder = new ExpressionBuilder();
raq.setSelectionCriteria(builder.get("PRODUCT_ID").getField("PRODUCT_NAME").like("Freezer"));
// raq.setSelectionCriteria( builder.getField("PRODUCT_ID").greaterThan(100));
Vector servicelist = (Vector) session.executeQuery(raq);
I'm getting : TopLink Exception -- 6015 Invalid Query key[Product_Id]
Can some one tell me where I am doing wrong, or was it a wrong way to do to get the desired result?
Thanking you in Advance,
Samba

I didn't notice before you're using get(..) and getField(..). If you've got your classes mapped you shouldn't have to use getField(..). By capturing your object-relational mappings in TopLink, you enable querying based on the attributes of objects instead of the database columns. This helps decouple your code from the data model. For example, I can write the following expression given the classes below:
ExpressionBuilder employee = new ExpressionBuilder();
Expression where = employee.get("address").get("streetName").equal("Main");
emp = (Emp)session.readObject(Emp.class, where);
public class Emp{
   long empId;
   Address address;
public class Address {
   long addressId;
   String streetName;
...See how I reference the address attribute of an Emp and put a constraint on the streetName? This expression will result in a SQL join based on the table reference info I provided in the TopLink one-to-one mapping between Emp and Address. I don't use the column names in my query at all. The are encapsulated in the TopLink mappings.
I think this is similar to the problem you're facing. Does this help?
--Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How do I get my voicemail back like it was before my iphone 4 updated I hate the way it is now, How do I get my voicemail back like it was before my iphone 4 updated I hate the way it is now

    How do I get my voicemail back like it was before my iphone 4 updated please help

    You contact your phone carrier voicemail is a carrier feature.  You contact yoru phone carrier voicemail is a carrier feature.  You contact your phone carrier voicemail is a carrier feature.

  • I have 3 iphones, an ipod touch and an Ipad on the same itunes account.  should I have a different account for each device?  If so how do I get all my purchases, like music on all the devices?

    I have 3 iphones, an ipod touch and an Ipad on the same itunes account.  should I have a different account for each device?  If so how do I get all my purchases, like music on all the devices?

    You can sync as many devices as you want to the same iTunes account, there is no limit. You can have the same content on each device or different content, the choice is yours. iTunes will keep everything straight, by device, including separate backups. I'd suggest giving each device a unique name, to make things easier.

  • How do I get built in apps like the App Store back

    How do I get built in apps like the App Store back

    Note:  Pre-Installed iOS Apps cannot be Deleted
    Check in Restrictions... Settings > General > Restrictions
    Understanding Restrictions  >  http://support.apple.com/kb/HT4213
    2)  Check in All Folders and on All Pages/Screens...
    3)  If no joy... Settings > General > Reset > Reset Home Screen

  • Where do I get a map transition like iMovie,  in which I can put a destination city

    Where do I get a map transition like iMovie,  in which I can put a destination city

    Tom
    I want you to know, Tom, that you are your only reason that I'm still using FCP X and not banging my head against the wall. I hope Apple is compensating you well.
    What do you mean by "export it and import it into FCP?" Neither program has an  export feature. I have already imported my iMovie project to FCP X with the map and it didn't come over correctly. Where the map should be  there is simply a slide saying, "title & subtitle."

  • How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    How can I get the attributes details like user name, mail , from sAMAccount csv or notepad file through powershell or any other command in AD?

    Ok what about If i need to get all important attributes by comparing Email addresses from excel file and get all required answers
    currently I am trying to verify how many users Lines are missing , Emp numbers , Phones  from AD with HR list available to me.
    I am trying to Scan all the AD matching HR Excel sheet and want to search quickly how many accounts are active , Line Managers names , Phone numbers , locations , title , AD ID .
    these are fields I am interested to get in output file after scanning Excel file and geting reply from AD in another Excel or CSV file
    Name’tAccountName’tDescri ption’tEma I IAddress’tLastLogonoate’tManager’tTitle’tDepartmenttComp
    any’twhenCreatedtAcctEnabled’tGroups
    Name,SamAccountName,Description,EmailAddress,LastLogonDate,Manager,Title,Department,Company,whenCreated,Enabled,MemberOf | Sort-Object -Property Name
    Can you modify this script to help me out :)
    Hi,
    Depending on what attributes you want.
    Import-Module ActiveDirectory
    #From a txt file
    $USERS = Get-Content C:\Temp\USER-LIST.txt
    $USERS|Foreach{Get-ADUser $_ -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    #or from a csv file
    $USERS = Import-CSV C:\Temp\USER-LIST.csv
    $USERS|Foreach{Get-ADUser $_.SAMAccountName -Properties * |Select SAMAccountName, mail, XXXXX}|Export-CSV -Path C:\Temp\USERS-ATTRIBUTES.csv
    Regards,
    Dear
    Gautam Ji<abbr class="affil"></abbr>
    Thanks for replying I tried both but it did not work for me instead this command which i extended generated nice results
    Get-ADUser -Filter * -Property * | Select-Object Name,Created,createTimeStamp,DistinguishedName,DisplayName,
    EmployeeID,EmployeeNumber,Enabled,HomeDirectory,LastBadPasswordAttempt,LastLogonDate,LogonWorkstations,City,Manager,MemberOf,MobilePhone,PasswordLastSet,BadLogonCount,pwdLastSet,SamAccountName,UserPrincipalName,whenCreated,whenChanged
    | Export-CSV Allusers.csv -NoTypeInformation -Encoding UTF8
    only one problem is that Manager column is generating this outcome rather showing exact name of the line Manager .
    CN=Mr XYZ ,OU=Users,OU=IT,OU=Departments,OU=Company ,DC=organization,DC=com,DC=tk

  • In Jsp TagLib how can I get the Attribute value (like JavaBean) in jsp

    Dear Friends,
    TagLib how can I get the Attribute value (like JavaBean) in jsp .
    I do this thing.
    public void setPageContext(PageContext p) {
              pc = p;
    pc.setAttribute("id", new String("1") );
              pc.setAttribute("first_name",new String("Siddharth")); //,pc.SESSION_SCOPE);
              pc.setAttribute("last_name", new String("singh"));
    but in Jsp
    <td>
    <%=pageContext.getAttribute("first_name"); %>
    cause null is returing.
    Pls HELP me
    with regards
    Siddharth Singh

    First, there is no need to pass in the page context to the tag. It already is present. How you get to it depends on what type of tag:
    Using [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/SimpleTagSupport.html]SimpleTagSupport
    public class MyTag extends SimpleTagSupport
      public void doTag()
        PageContext pc = (PageContext)getJspContext();
        pc.setAttribute("first_name", "Siddharth");
        pc.setAttribute("last_name", "Singh");
        pc.setAttribute("id", "1");
    }Using [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/TagSupport.html]TagSupport or it's subclass [url http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/jsp/tagext/BodyTagSupport.html]BodyTagSupport the page context is aleady declared as an implicit object:
    public class MyTag extends TagSupport
      public void doStartTag()
        pageContext.setAttribute("first_name", "Siddharth");
        pageContext.setAttribute("last_name", "Singh");
        pageContext.setAttribute("id", "1");
    }In each case, this sort of thing should work:
    <mytags:MyTag />
    <%= pageContext.getAttribute("first_name") %>I

  • In KA02 screen how can I get different functional area like (Production, Sales, Adminstration etc)

    In KA02 screen how can I get different functional area like (Production, Sales, Adminstration etc)

    Hi,
    Please check below configuration for defining functional areas for cost elements
    SPRO> FI > FI Global settings> company code> cost of sales accounting>Functional area > enter functional area
    Regards,
    Jyoti

  • In previous version, when typing the keyword "gmail" or "ebay" or "amazon" firefox went directly to the webpage, but in version 4 it stops at google. how do I get it to be like the old one?

    it was so convenient before, and how I got most people to convert to Firefox - just type in the keyword, like "ebay" or "hotmail" and firefox found the webpage for you.
    you say firefox 4 is faster, but now I get redirected to google first, which in version 3 only happened if Firefox wasn't sure of the right homepage.
    how do I get it to be like the old one? if not, I think I'm going back to version 3. which was a lot faster because of this.

    The change between Firefox 3.6.* and Firefox 4 is how location bar search works. In Firefox 3.6 it uses Google "Browse by name" search. With the browse by name search, it performs a Google search and if there is a clear match it will take you to the site, otherwise it shows the Google search result. With Firefox 4 it just performs a Google search if you type something which is not recognised as a URL.
    To get the Firefox 3.6 behaviour on Firefox 4 you need to change a hidden preference.
    # Type '''about:config''' into the location bar and press enter
    # Accept the warning message that appears, you will be taken to a list of preferences
    # Locate the preference '''keyword.URL''', double-click on it and change its value to the link shown below
    [http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q= http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=]

  • What program can i get for my documents like exel or word, What program can i get for my documents like exel or word

    What program can i get for my documents like excel or word

    Microsoft makes an Office Suite for the Mac....It's Office 2011 at the moment

  • Can I get a query to get the output data like 4th column instead of 3rd col

    Can I get a query to get the output data like 4th column instead of 3rd column ?
    SQL&gt; select emp.deptno, empno, rownum from emp, dept where emp.deptno=dept.deptno;
    DEPTNO EMPNO ROWNUM
    10 7782 *1* *1*
    10 7839 *2* *2*
    10 7934 *3* *3*
    20 7369 *4* *1*
    20 7876 *5* *2*
    20 7902 *6* *3*
    20 7788 *7* *4*
    20 7566 *8* *5*
    30 7499 *9* *1*
    30 7698 *10* *2*
    30 7654 *11* *3*
    30 7900 *12* *4*
    30 7844 *13* *5*
    30 7521 *14* *6*
    14 rows selected.

    SQL> select emp.deptno, emp.empno,
      2    row_number() over(order by emp.deptno, emp.empno) rn,
      3    row_number() over(partition by emp.deptno order by emp.empno) dept_rn
      4  from emp, dept
      5  where emp.deptno=dept.deptno
      6  order by emp.deptno, emp.empno;
        DEPTNO      EMPNO         RN    DEPT_RN
            10       7782          1          1
            10       7839          2          2
            10       7934          3          3
            20       7369          4          1
            20       7566          5          2
            20       7788          6          3
            20       7876          7          4
            20       7902          8          5
            30       7499          9          1
            30       7521         10          2
            30       7654         11          3
            30       7698         12          4
            30       7844         13          5
            30       7900         14          6
    14 rows selected.Regards,
    Dima

  • I'm getting married and would like to change my iCloud email address or create another one

    i'm getting married and would like to change my mobileme/icloud email address to my new name. i've tried to create alias but it keeps saying cannot save address at this time? any tips? can i have 2 icloud email addresses?

    Welcome to the Apple Community.
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    You can change your details at the address above (you can't change your ID if it's a me address).
    You can of course create a new account at any time and add it as a secondary to your existing account or use it as a primary account and add your existing account as a secondary account.

  • Negative (to inline a letter or to thin it) offset path does not work in Illus-CC 2014 (when preview is on- nothing happens). How can I get this to work like in previous versions.

    Negative (to inline a letter or to thin it) offset path does not work in Illus-CC 2014 (when preview is on- nothing happens). How can I get this to work like in previous versions.

    Thanks for your quick reply. I tried a number of different values. Usually when I do a negative offset they're very small values, like -.25 or -.5.
    An Update- I took the art work into Ai CS 6 and It still did not work, which is really strange. And I've used it hundreds of times with success in the past. Also I tried it with live type and outlines, ungrouped, un-compounded still could not get it to negative offset.
    Thanks for the help.

  • HT3964 My MacBook Air running on Snow Leopard gets extremely slow (almost like a hang, except if you wait about half an hr, it actually moves) after login interface. sometimes it never gets past the background. Cannot log back in.

    My MacBook Air running on Snow Leopard gets extremely slow (almost like a hang, except if you wait about half an hr, it actually moves) after login interface. Sometimes it never gets past the background of the homepage, desktop doesn't seem to load. After multiple forced shut downs and left to run for hours, sometimes the desktop loads but the dock does not respond when applications are opened. The computer is then unable to shut down normally. Forced shut downs are necessary most times. Time machine backup takes extremely long, and attempts to use the time machine to bring the laptop back to the time befiore the problem arose was met with extremely slow and hung time machine function.
    Please help!

    There isn't much besides a failing hard drive or other hardware fault that can cause those symptoms. Run the Apple Hardware Test, or just take it to an Apple Store for testing.

  • When I type for example "Apple Store" I am getting something completely different, like the MBP is anticipating, any ideas, When I type for example "Apple Store" I am getting something completely different, like the MBP is anticipating, any ideas

    When I type for example "Apple Store" I am getting something completely different, like the MBP is anticipating, any ideas, When I type for example "Apple Store" I am getting something completely different, like the MBP is anticipating, any ideas

    what do you expect from this code out.print(lecture); ?
    lecture is an Element, toString() is not implemented, so print correctly displays some fuzzy pointer information, nothing more...

Maybe you are looking for