ADF BC equivalent of TopLink Expressions

Hi,
I'm looking for equivalent of TopLink Expressions in ADF BC world.
Does such thing exist ?
http://download-uk.oracle.com/otn_hosted_doc/ias/preview/web.1013/b13593/expres.htm

Hi,
the link you provide doesn't exist. I guess you mean http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/expres.htm
ADF BC works similar but does not have object oriented expressions that you use. E.g. to filter a query you use ViewCriteria or bind variables in the query itself
Frank

Similar Messages

  • SQL query from toplink expression

    Hi,
    I have a oracle.toplink.expressions.Expression object with me which has been created using oracle.toplink.expressions.ExpressionBuilder. I want to find its equivalent SQL query(say select emp.empname,emp.empId from employee emp) which will be fired in order to fetch data i.e. find its equivalent Statement/PreparedStatement or anything which will help me obtain the raw SQL statement about to be fired.
    Please let me know if there is any soln.
    Thanks,
    Adithya.

    You can create ReadAllQuery with the expression and get the query's SQL using query.prepareCall() and then query.getSQLString().
    James : http://www.eclipselink.org

  • GET_UTC_DATE() and GET_UTC_TIMESTAMP() with Toplink Expression

    Hi All,
    I have a requirement which needs me to do some manipulation with dates. I am writing a report query and need to use the get_utc-date() function. What is the equivalent using the toplink expression builder?
    An example of such a query should generate the following SQL:
    SELECT order_no FROM vista_order_transfer vot where vot.updated_timestamp < get_utc_date() - 30. I could not figure out how to use the expression builder to build the get_utc_date() - 30 part of this SQL.
    Any help would be gratly appreciated.
    Roland.

    There is a currentDate() method on Expression which will return the current date, but this is SYSDATE not UTC. To call this function you can use the getFunction() method on the ExpressionBuilder.
    i.e.
    ExpressionBuilder builder = new ExpressionBuilder();
    Expression expression = builder.get("updatedTimestamp").lessThan(ExpressionMath.subtract(builder.getFunction("GET_UTC_DATE"), 30));
    There is also an Expression method postfixSQL() that will let you append any SQL you wish to the expression.

  • Edit a TopLink Expression

    Hi. I am design a application in Jdeveloper 11g, but i have a problem with a try to edit a toplink expression a first argument, in the button edit I click in this button but nothing happend. Why happend this, i need edit this first argument but i can not.
    Thanks...

    I am also having this problem using JDevloper 11g Update 2 for OSX. The Expression Builder works fine on smaller projects but chokes on larger ones. It also doesn't seem to work for the Batch Read Attributes and Joined Attributes buttons.
    The following error shows up in my console:
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] Exception in thread "AWT-EventQueue-0"
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] java.lang.StackOverflowError
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.lang.StringBuffer.<init>(StringBuffer.java:104)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at sun.text.normalizer.ReplaceableString.<init>(ReplaceableString.java:46)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at sun.text.normalizer.ReplaceableUCharacterIterator.<init>(ReplaceableUCharacterIterator.java:44)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at sun.text.normalizer.UCharacterIterator.getInstance(UCharacterIterator.java:66)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at sun.text.normalizer.NormalizerBase.<init>(NormalizerBase.java:559)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at sun.text.normalizer.NormalizerBase.<init>(NormalizerBase.java:1563)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.text.CollationElementIterator.<init>(CollationElementIterator.java:105)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.text.RuleBasedCollator.getCollationElementIterator(RuleBasedCollator.java:303)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.text.RuleBasedCollator.compare(RuleBasedCollator.java:346)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at oracle.toplink.workbench.utility.node.Node$1.compare(Node.java:436)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at oracle.toplink.workbench.utility.node.Node$1.compare(Node.java:428)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.util.Arrays.mergeSort(Arrays.java:1270)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.util.Arrays.mergeSort(Arrays.java:1281)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.util.Arrays.mergeSort(Arrays.java:1282)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.util.Arrays.mergeSort(Arrays.java:1281)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.util.Arrays.sort(Arrays.java:1210)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at java.util.Collections.sort(Collections.java:159)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at oracle.toplink.workbench.mappingsmodel.mapping.relational.MWAbstractTableReferenceMapping.subQueryableElements(MWAbstractTableReferenceMapping.java:455)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at oracle.toplink.workbench.mappingsmodel.mapping.relational.MWAbstractTableReferenceMapping.isLeaf(MWAbstractTableReferenceMapping.java:447)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at oracle.toplink.workbench.mappingsplugin.ui.query.relational.QueryableTreeModel.getChild(QueryableTreeModel.java:72)
    30/04/09 11:59:07 AM [0x0-0x113113].oracle.ide.boot.Launcher[3761] at oracle.toplink.workbench.uitools.swing.Tree.expandAllNodes(Tree.java:163)

  • Why ADF Business Components and TopLink

    Hi All,
    Why are there two types of components in Businses Tier? (ADF Business Components and TopLink). Even through there are other types, I can visualize the use of other components but ADF Business Components & TopLink seems to serve the same requirement.
    Can some one provide me information on what is the difference between these two and when to use which one?

    ADF Business Components (aka BC4J) are different from Toplink from approach point of view. Basically if you are more comfortable with SQL and want fine grain control over what and how SQL are run against the database, BC4J is the way to go, because, it's you who write the queries(in ViewObjects)
    If you are from more of java backgroup and can visualize things in term of Object and relationships among objects, so on and so forth then Toplink would be the right choice.
    Pls see the post by Shay in his blog:
    http://blogs.oracle.com/shay/2006/03/10
    regards - rutwik

  • How to Query Multiple Fields from different Tables using Toplink Expression

    Hi,
    I am trying to prepare an Oracle Toplink Expression to qurey the multiple columns of different tables. the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to readAllObjects method as a parameter
    Expression exp = (..............this is the required qurey expression...................)
    Vector employees = session.readAllObjects(getClass(), exp);
    thanks,

    You havent given any information on the mapping between Cycle and Asp. I presume there is a one to one mapping between them. Also it appears there is no "WHERE" clause to limit the number of cycles being retrieved. If that is the case then I presume you want to load all cycles in the system.
    Thats just a clientSession.readAllObjects(Cycle.class). If you have indirection turned on the Asp should get loaded when you do a cycle.getAsp().
    I presume that SQL you posted loads all the columns of CYCLE and ASP. If you are interested in a subset of CYCLE or ASP then you should do a ReportQuery or partial object read.
    Hi,
    I am trying to prepare an Oracle Toplink Expression
    to qurey the multiple columns of different tables.
    the query as following. Please can anyone help?
    SELECT CYCLE.CYCLE_ID,
    CYCLE.ASPCUSTOMER_ID,
    CYCLE.FACILITYHEADER_ID,
    CYCLE.ADDUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME ADDUSERNAME,
    CYCLE.ADDDATE,
    CYCLE.LASTUPDATEUSER,
    ASP.FIRSTNAME || ' ' || ASP.LASTNAME
    LASTUPDATEUSERNAME,
    CYCLE.LASTUPDATEDATE,
    CYCLE.CYCLENAME,
    CYCLE.CYCLENUMBER,
    CYCLE.DESCRIPTION
    FROM CYCLE,ASPUSER ASP
    WHERE CYCLE.ADDUSER = ASP.ASPUSER_ID
    and then i want to send that expression to
    readAllObjects method as a parameter
    Expression exp = (..............this is the required
    qurey expression...................)
    Vector employees = session.readAllObjects(getClass(),
    exp);
    thanks,

  • Toplink expression - using complex in clause

    We are trying to build an toplink expression in java that would produce the following where clause:
    where (settlement_id, retailer_id, site_id, end_read_datetime, txn_datetime)
         in (select settlement_id, retailer_id, site_id, end_read_datetime, max(txn_datetime)
                   from tlsa_dim
         where end_read_datetime
         BETWEEN to_date('1/1/2002 00:00:01','mm/dd/yyyy hh24:mi:ss')
                        AND to_date('1/9/2002 00:00:00','mm/dd/yyyy hh24:mi:ss')
                   and site_id = '0040473041023'
              group by settlement_id, retailer_id, site_id, end_read_datetime )
    We have created a reportquery to represent the internal sub query, but
    cannot seem to find how to tell the ExpressionBuilder to get 5 fields together
    before the .in(reportQuery).
    Anyone have any ideas?          
    here is our java code
    public static ReportQuery getReportQueryForSiteIdAndEffectiveDateRangeAndMaxHistoricalStartDate() throws DataIntegrityException {
    ExpressionBuilder aBuilder = new ExpressionBuilder();
    ReportQuery query = new ReportQuery(aBuilder);
    query.setReferenceClass(Dim.class);
    query.addAttribute("settlementId", aBuilder.get("settlementId"));
    query.addAttribute("retailerId", aBuilder.get("retailerId"));
    query.addAttribute("siteId", aBuilder.get("siteId"));
    query.addAttribute("endReadDateTime", aBuilder.get("endReadDateTime"));
    query.addMaximum("max-txndatetime", aBuilder.get("historicalStartDate"));
    query.setSelectionCriteria(equalsSiteId.and(greaterThanEqualtoEffectiveStart.and(lessThanEqualtoEffectiveEnd)));
    query.addGrouping(aBuilder.get("settlementId"));
    query.addGrouping(aBuilder.get("retailerId"));
    query.addGrouping(aBuilder.get("siteId"));
    query.addGrouping(aBuilder.get("endReadDateTime"));
    // Vector reports = (Vector) session.executeQuery(query);
    return query;
    public static Expression forSiteIdAndEffectiveDateRangeAndMaxHistoricalStartDate(String siteId, DateInterval effectiveDateInterval) throws DataIntegrityException {
    ExpressionBuilder aBuilder = new ExpressionBuilder();
    Expression greaterThanEqualtoEffectiveStart = aBuilder.get("endReadDateTime").greaterThanEqual(effectiveDateInterval.getStartDate());
    Expression lessThanEqualtoEffectiveEnd = aBuilder.get("endReadDateTime").lessThanEqual(effectiveDateInterval.getEndDate());
    Vector parameterVector = new Vector();
    // trying a vector, but no luck
    parameterVector.addElement(aBuilder.get("settlementId"));
    parameterVector.addElement(aBuilder.get("retailerId"));
    parameterVector.addElement(aBuilder.get("siteId"));
    parameterVector.addElement(aBuilder.get("endReadDateTime"));
    parameterVector.addElement(aBuilder.get("historicalDateRange").get("historicalStartDate"));
    Expression inMaxGroup = aBuilder.get(parameterVector).in(getReportQueryForSiteIdAndEffectiveDateRangeAndMaxHistoricalStartDate());
    Expression equalsSiteid = forSiteId(aBuilder, aSiteId);
    return equalsSiteid.and(inMaxGroup);
    public static Expression forSiteId(ExpressionBuilder aBuilder, String aSiteId){
    Expression equalsSiteId = aBuilder.get("siteId").equalsIgnoreCase(aSiteId);
    return equalsSiteId;

    There is no expression support for this. You'll have to use SQL.
    Here is a thread of an example using Having with report queries.
    Re: How to build SQL Where clause "Having" using Toplink ExpressionBuilder
    - Don

  • How to SQL intersect using Toplink expressions

    I try to do this SQL intersect
    SELECT part_k FROM ATTR_VALUE
    where commodity_n ='dab badge' and attribute_n='Badge Width' and attribute_value_x='10'
    INTERSECT
    SELECT part_k FROM ATTR_VALUE
    where commodity_n='dab badge' and attribute_n='Brand Logo' and attribute_value_x='Jaguar'
    using the following Toplink expressions:
    Expression e1 = builder.get("commodity").equal("dab badge")
    .and(builder.get("attribute").equal("Badge Width"))
    .and(builder.get("value").equal("10"));
    Expression e2 = builder.get("commodity").equal("dab badge")
    .and(builder.get("attribute").equal("Brand Logo"))
         .and(builder.get("value").equal("Jagua"));
    Expression myExpression = e1.and(e2);
    However, this would not give me the correct result.
    Any suggestions would be greatly appreicated.

    Right, TopLink doesn't have an Intersect operator. If it did, you might still get the same problem unless you are using a report query to return only the "part_k" value instead of an object since attribute_n cannot have a value of both 'Badge Width' and 'Brand Logo' at the same time.
    You can get the part_k values or the objects from the ATTR_VALUE
    table by using a report query for the second expression as a subquery to the IN clause. Something like
      ReportQuery subquery = new ReportQuery(yourclass.class);
      ExpressionBuilder subBuilder = subquery.getBuilder();
      Expression e2 = subBuilder.get("commodity").equal("dab badge").and(subBuilder.get("attribute").equal("Brand Logo")).and(subBuilder.get("value").equal("Jagua"));
      subquery.setSelectionCriteria(e2);
      subquery.addAttribute("partk");
      Expression myExpression = e1.and( builder.get("partk").in(subquery) );Regards,
    Chris

  • ADF Email Validation using Regular Expression

    Hi,
    Wanted to add Email Validation VO search.
    It is working if i put
    <af:validateRegExp pattern="[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}"
                                             messageDetailNoMatch="The value {1} is not a valid email address:"/>However this requires email id to be entered in Capital Letters.
    Tried with below option is not working.
                   <af:inputText value="#{bindings.xxEmail.inputValue}" label="Email"
                                          required="#{bindings.xxEmail.hints.mandatory}"
                                          columns="#{bindings.xxEmail.hints.displayWidth}"
                                          maximumLength="#{bindings.xxEmail.hints.precision}"
                                          shortDesc="#{bindings.xxEmail.hints.tooltip}" id="it5">
                                <f:validator binding="#{bindings.xxEmail.validator}"/>
                                <f:validateLength minimum="6"/>             
                                <af:validateRegExp pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}"
                                             messageDetailNoMatch="The value {1} is not a valid email address:"/>
                            </af:inputText>I got above info from
    ADF Email Validation using Regular Expression
    User don't enter email id Without @ .
    Kindly suggest pattern to achive this.
    Thanks,
    jit
    Edited by: appsjit on Jan 25, 2013 7:08 PM

    The RegEx to check EMail after RFC2822
    [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?There are still some missing parts in the check as not all suffix combinations are allowed, but this is pretty good.
    Timo

  • ADF Tutorial Error Creating TopLink POJOs

    I am following the ADF tutorial found on OTN. When I get to step 12 on Page 2-4 I get the following error when creating the TopLink POJOs:
    java.lang.NullPointerException
         at oracle.ideimpl.log.TabbedLogManager.getMsgPage(TabbedLogManager.java:101)
         at oracle.toplink.addin.log.POJOGenerationLoggingAdapter.updateTask(POJOGenerationLoggingAdapter.java:42)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.fireTaskUpdated(MappingCreatorImpl.java:1049)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:231)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:201)
         at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:401)
         at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
         at java.lang.Thread.run(Thread.java:595)
    Any thoughts or ideas?

    java.lang.NullPointerException
    at oracle.ideimpl.log.TabbedLogManager.getMsgPage
    Re: Business Tier: Toplink: Java Objects from Table: Object Generation error.

  • Toplink Expression - edit button not showing all possible field names

    Hi,
    i use Jdev 11g (11.1.1.0.1) with TopLink. I created a Toplink mapping and everything works well. I now want to create another named query with a selection criteria, but the Edit-Button in the Expression Builder for the selection criteria isn't working well. If i click the button nothing happens, but JDev freezes for about 15 sec. Anyone else with this problem ?
    Thanks,
    Friedrich

    You should put all your menus in the root menu.
    <?xml version="1.0" encoding="utf-8"?>
    <openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id ="root-menu" label="Exit">
    <item label="Reboot">
    <action name="Execute">
    <execute> sudo /sbin/shutdown -r now </execute>
    </action>
    </item>
    <menu id="apps-accessories-menu" label="Accessories"/>
    <menu id="apps-editors-menu" label="Editors">
    <item label="Scite">
    <action name="Execute">
    <command> scite </command>
    <startupnotify>
    <enabled> yes </enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    </menu>
    </openbox_menu>

  • Should ADF tables created for Toplink or Web Services behave the same?

    In JDev 11g TP3, When you drag the collection data control onto a JSF, should the read only tables created from either Toplink objects or Web Service Data Controls look and behave the same? I am not able to get tables created with Web Service Data Controls to work the same as those shown in tutorials or examples.
    Thanks,
    Al

    Not so sure, 11G does seem to generate all of the controls for the response elements, even those that have nested complex types such as the one enclosed. Used the 11G TP3 Web Service Data Control wizard and all of the nested controls showed up. BUT, when dropped onto a JSF, they do not work the same as the tutorials and examples. So, I'm either doing something wrong or the controls are not working properly.
    Should I not use the 11G WSDC and just follow your example in complex return types? Or are there other steps or settings in the 11G WSDC that I need to discover (they're not documented) in order to make ADF tables work with the 11G WSDC? If so, can you help?
    <xsd:element name="PanelData" type="ns1:PanelData"/>
    <xsd:complexType name="PanelData">
    <xsd:sequence>
    <xsd:element name="lotinfo" type="ns1:LotInfoData" minOccurs="1" maxOccurs="1"/>
    <xsd:element name="backglass" type="ns1:LotInfoData" minOccurs="1" maxOccurs="unbounded"/>
    <xsd:element name="frontglass" type="ns1:LotInfoData" minOccurs="1" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>

  • Functionality equivalent to Regular Expressions

    Hi,
    We have a old, very badly designed database(which by the way is the culprit of all the problems).
    There is a varchar2 column with values like -
    C500
    500FCG
    50-100
    MX
    ADW
    Y
    10-5
    500
    B1
    C500
    I am trying to retrieve only digits with no leading or trailing alphabets. But i still want numbers like 50-100.
    I know in 10g this could be easily done with regular expressions. But we are still using oracle 9i.
    Is it possible within the sql statement or is there any other way to do it(like using some perl programs calling from plsql).
    Any suggestions greatly appreciated.
    Thanks,
    Siri

    Sorry Mohana for not explaining my req clearly.
    Actually i was able to get the results by changing your query a little.
    Here is the query -
    select NVL(replace(translate(cov_limit, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','*'),' '), cov_limit) as After, cov_limit as Before
    from test;
    SQL> /
    BEFORE
    C500
    500FCG
    50-100
    MX
    ADW
    Y
    10-5
    500
    B1
    C500
    1000
    AMD
    CAD
    MAD
    WAT
    FCG
    CG
    AD
    DW
    A
    A500
    AFTER
    500
    500
    50-100
    MX
    Y
    10-5
    500
    1
    500
    1000
    FCG
    CG
    DW
    *500
    Only thing i am not able to understand is why the alphabet 'A' is not getting replaced with blank.
    Thanks & Regards,
    Sree

  • ADF BuessServices Layer With Toplink In Jdeveloper 11.1.1.3.0

    hi,
    i want to use Toplink / EJB as my BuessServices Layer, I can't get userfull help from google and orecle , Can you give me some sample /Demo or advice?
    thank you very much~

    Hi,
    not sure what your problem is. However, have a look here - its the 9th sampl from top: http://apex.oracle.com/pls/apex/f?p=9830:32:0::NO
    Frank

  • Toplink Expression Builder and SQL Any keyword

    hi,
    How can i use the toplink expressionBuilder to make something similar to Query1 = ANY (Query2) ?
    thanx,
    jeff

    ANY is not currently supported in TopLink 10.1.3, but it supported in TopLink Essentials and will be supported in the next major release of TopLink.
    You should be able to define most queries that you would use a ANY for through using a subselect (which is supported).

Maybe you are looking for