Search criteria using EJB-QL

I need help. I am on WSAD 5.0 and EJB 2.0. I am developing search engine with 4-5 different fields (employee ID, first name, last name, dept, salary range etc) can be specified as criteria. I can do a search with 'LIKE' inside EJB-QL (provided user has specified all criteria). But user can keep it blank and if it is blank i want to omit it from 'SELECT' statement.
Now I am bit confused how it is possible using EJB-QL ? Whether dynamic EJB-QL is supported in 2.0 ? Or is it that I write direct SQL and use DAO to get the list ?
regards,
Manisha

You have to take a call i guess...but as far as making EJB QL dynamic..i dont think it works that way...but now that i think you can try something...else..
Why dont you try substituting a wildcard in all those places when you dont get a parameter
but you will have to do it in java
for example if your Query was supposed to be
Select Object(cust) from Customer cust where cust.firstName = ?1
Now if you have a parameter its good..otherwise pass the wildcard "%"...it should work..but even then it will be a bit of testing for empty parameters...and not sure about performance either...but worth a try i think

Similar Messages

  • Search Criteria not working in POWL

    Hello Experts,
    I have added the new fields in POWL Search Criteria using the Add custom field to SC and POWL.
    but after adding the fields when i try to search using the input made by the user the resultant output is always blank and also there is no data being displayed in the newly added columns.
    Please help me so that the correct output gets generated after the user input and the newly added columns are not empty.
    thanks.

    Hello Konstantin,
    thanks for the reply...
    I tried to add an extra Field(Company code) in POWL Search. the problem is the Field Company code doesnt get updated in BBP_PDHSC and BBP_PDISC with the value used in while creating SC.
    I only get the Company code value in table BBP_PDBEI for SC.
    So when i give any value in POWL search for company code no data is shown even though the SC was created in the inputted Company code.
    so how to go about adding CC as search criteria in POWL so that the resultant output is filtered on the basis of CC value.
    Thanks
    Rajat

  • Displaying Advanced Search Criteria

    Hi All,
    My question is about the Application Sourcing
    At an Advanced Table, I have added several Search Criteria using jDeveloper. Those criteria can be selected from a drop down list where the user can select; then click "Add" and then perform the search.
    When the user goes to the page only the first 4 criteria appear.
    Is it possible to have more than 4 initially appear at the page without having to add them from the drop down list?
    Thanks

    Hi,
    Its discussed earlier. Please see below thread. May answer your query.
    Re: How to display more than 4 criteria items on startup of Advanced Search LOV
    Abdul Wahid

  • Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotfo

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

  • Bug in app store using search criteria

    When using the search option in the app store a bug occurs.
    When jumping between options like update and whipping the search criteria.
    After the jump the search criteria appears again.
    How can you report such a bug?

    Find whatever apps your purchased under that Apple ID, and remove them from your system. Dragging to Trash is pretty much all you'll have to do.

  • How to control and use the search criteria values "%" ?

    Hi,
    When I searched some information in my employee name. I filled in search criteria values "%" and selected the "Go" button to see the result. But I got errors that the search criteria values should not begin with a "%" or "_" for at least one if the listed fields.
    How to control and use the search criteria values "%" ?
    Thanks,
    sinolee

    sinolee,
    These kinds of details are mentioned in Dev guide. Always have a look into dev guide before posting.
    --Shiv                                                                                                                                                                                                                                                   

  • Obtaining document info using categories/perspectives as search criteria

    Hi, I'm really stuck on this and any help would be much appreciated.
    I want to select out document information using the categories and perspectives as search criteria, I've written the following select statement but am not sure that this is the correct way to do it and I keep getting a 'unhandled user-defined exception ... at PORTAL.WWCTX_SSO'
    (I have set the context before running the sql)
    select id, display_name, description, real_filename, mime_type, doc_size
    from
    portal.wwsbr_all_items, portal.wwv_document$
    where
    wwsbr_all_items.filename = wwv_document$.name
    and category_id=(select id from portal.wwsbr_all_categories where name = 'MY_CATEGORY')
    and id in (select item_id from portal.wwsbr_item_perspectives where upper(perspective_name) = 'MY_PERSPECTIVE')
    and is_current_version = 1 and (expiredate IS NULL or expiredate > sysdate)
    Alison

    Hi Alison,
    I just tried your query in SQL* Plus, TOAD & Oracle Portal - Dynamic Page & PL?SQL Item. I set the context ( as given int he Documentation ) using :-
    PORTAL.wwctx_api.set_context('PORTAL','JKuNcME9','Oracle');I then tried your code & it works fine. I don't see the usual ORA-06510: PL/SQL: unhandled user-defined exception.
    Your logic does look fine - I haven't tired something like this with Categories & Perspectives, but your query looks fine to me. I'll try to snoop around Metalink & see what I get...
    Regards,
    Sandeep

  • Need - Search page with LOV based flexfield item as search criteria

    Our requirement is to make a flexfield item as search criteria.
    Flexfield is having 2 segments Applicaiton and Responsibility, where 2nd segment *(Responsibility) is dependent on 1st (Application).*
    Accordingly, an LOV must get displayed for each flex segment in the search panel.
    We tried to create a page having this flex (DFF) item as a search criteria, but cannot proceed to get results in results region - we tried to use both properties in the query region - resultsbasedSearch and autocustomizationCriteria:
    Any ideas how to make a search functionality having LOV based flexfield items in the search criteria?
    Any other suggestions regarding the solution are welcome.
    Thank you very much.
    Regards,
    May B.

    Hi,
    try a SQL query that uses bind variables as follows
    ... where column1 like '%:col1param%' and '%:column2%' like :col2param
    Then in the implementation (session facade) check for null values and add '%' in case a value is null.
    The query in EJB is defined in the entity
    Frank

  • Maintaing model's search criteria

    What is the best strategy/place to maintain the search criteria of a
    model ?
    My interpretation, in the context of the "RetrievingModel" interface,
    is that the "retrieve" method is responsible for getting the
    information from a datasource (database, EJB, etc.).
    If the above assumption applies, then:
    - the "retrieve" method needs to pass the search criteria to the data
    source.
    - the model is responsible for maintaining search criteria between
    calls (posts/navigation through the model data).
    PS: I use a BeanAdapterModel class as model because I want to be able
    to change the datasource from a database to EJB's.

    My interpretation, in the context of the "RetrievingModel" interface,
    is that the "retrieve" method is responsible for getting the
    information from a datasource (database, EJB, etc.).Yes.
    - the "retrieve" method needs to pass the search criteria to the data
    source.Well, not necessarily, but in general this is the recommended approach.
    (Even our QueryModels don't do this yet.) To do this, you will need to
    derive an execution context subclass that has slots for this information,
    and for which your model can test. See my previous email about the
    execution context.
    Otherwise, you can simply set the search criteria on the model directly, if
    you don't mind using the type of the model directly.
    - the model is responsible for maintaining search criteria between
    calls (posts/navigation through the model data).Generally, this is easiest to do using the RequestCompletionListener
    interface. If your model implements this interface, it will be
    automatically called back at the end of the request, where you can do things
    like add the serach criteria to the session. You can the pull them from the
    session in the setRequestContext() method (assuming you implement
    RequestParticipant).
    A different approach might be to consider the View as the arbiter of the
    seach criteria. This would lend itself to using page session more easily,
    if you needed to be sure to keep search criteria isolated per page
    rendering.
    Todd

  • Enhance Search Criteria in bt111s_oppt

    I need to enhance a search criteria as follows:
    The opportunities in the result list have to be shown only in case the user searching for them is a Sales team member on the opportunity in the result list.
    In case of BP search there is a nice class which can be used for the purpose of enhancing of the search criteria. How about opportunity. IS there a class or a BADI?

    Hi Max,
    Just to add to what Ajay has said, Please try below code:
    DATA: lr_query TYPE REF TO cl_crm_bol_dquery_service.
    lr_query ?= me->typed_context->search->collection_wrapper->get_current( ).
    lr_query->add_selection_param( EXPORTING iv_attr_name = 'SALES_TEAM_MEMBER '
                                                                                    iv_sign = 'I'
                                                                                    iv_option = 'EQ'
                                                                                    iv_low = sy-uname ).
    Regards,
    Bhushan

  • Search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.

    search criteria is not working in Responsible Group field in sap crm could you please help me this how to achieve.I have writen code on EH_ONSEARCH .as per below...what changess i need to do..and through partner function and adding the selection params please send the sample .
    code. partner funtction - ZRG DATA :
    DATA : lv_partner_fct type .
    types: begin of ty_resp,
           partner    type but000-partner,
           name_last  type but000-name_last,
           name_first type but000-name_first,
           mc_name1   type but000-mc_name1,
           mc_name2   type but000-mc_name2,
           end of ty_resp.
    DATA: lv_resp_bp type STANDARD TABLE OF ty_resp INITIAL SIZE 0,
           lw_resp_bp type ty_resp.
    IF lv_attr_name = 'Rgroup'.
    lr_entity->get_property_as_value( EXPORTING iv_attr_name = if_crm_srqm_uiu_const=>gc_attr_low
                                       IMPORTING ev_result = lv_low ).
    IF lv_low IS INITIAL.
    SELECT partner
           name_last
           name_first
           mc_name1
          mc_name2
    FROM but000 INTO table lv_resp_bp
    WHERE mc_name2 = lv_low and bu_group = '0010'.
    loop at lv_resp_bp into lw_resp_bp.
        lv_low = lw_resp_bp-mc_name2.
      lr_query_service2->add_selection_param( iv_attr_name = 'Rgroup'
                                                iv_sign = lv_sign
                                                iv_option = lv_option
                                                iv_low = lv_low
                                                iv_high = lv_high ).
      ENDLOOP.
    if lv_partner_fct = 'ZRG'.
      lr_entity = lr_iterator->get_next( ).
    CONTINUE.
    ENDIF.
    lv_attr_name = 'BU_PARTNER'.
    ENDIF.

    <b>You can acheive   this .... first by creating the search help exit    ... by  creating the maintaince  view   then   using it in the   Creation of the search help </b> ...
    see the link for attaching the view   to the serach help .
    <a href="http://">http://www.sapdevelopment.co.uk/dictionary/shelp/shelp_elementary.htm</a>
    reward  points if it is usefull...
    Girish

  • How can I develop a web application using EJB design pattern?

    I have searched over the web and found quite a lot of tutorials on how to use the EJB design pattern.
    I know that there will be a home interface, EJB object interface and a SessionBean.
    But the tutorials often only cover a single class, this made me unable to get a complete picture of how EJB design pattern can be implemented into a whole system.
    I am now required to devleop an online shopping web application using EJB and JSP page.
    I think I will need to create a lot of classes: Member, ShoppingCart, Product...etc.
    What I want to ask is that, do I need to create a home interface, EJB object interface and a SessionBean for each of these classes?
    I really need some ideas on how to develop this system using EJB + JSP pages.
    Many thanks to you all.

    For every EJB that you want to create, you will need to code a home and remote interface and a bean class.
    You could start getting your ideas here
    http://www.theserverside.com/books/wiley/masteringEJB/
    http://www.coreservlets.com

  • Looking for simple search example using SELECT

    Can anyone link me to an example of how to create a basic search page where the search criteria is selected in a drop-down list (<SELECT> in HTML)?
    Here's where I'm coming from so you have a better idea of what I'm trying to do. I've created a search page by creating a method in my App Module java class using setWhereClause(), then dropped my view onto my web page as a read-only table, and finally dropped the method and parameter as a command button and input text field, respectively. This works fine, but I'd like to replace the input text field with a select box so that the users will not have to type in their search criteria. I'd like to populate the drop-down with data from a table, which will then be sent as the argument for the method.
    I can create a ViewObject that contains the data I need, but I'm not sure where to go from there. I don't know how to create the drop-down list or connect the command button to the list. (Ultimately, I'd like to have the search text submitted when the drop-down changes, but I'll settle for pressing the button for now). I've fooled with using the LOV component, but without any luck.
    Step-by-step would be great, but if you can point me to an example, some documentation, etc., that would be great too.
    Thanks,
    Andy

    Excellent - Thanks for the link to the sample code page. I thought I had seen all the tutorials, etc. but for some reason never came across this page. The example you cited looks like it's just what I'm looking for.
    (Edit - For anyone who's interested, here's a step-by-step for creating a databound drop down list:
    http://www.oracle.com/technology/products/jdev/tips/mills/databound_lists.html )
    Andy

  • Adding a Field in  search Criteria in Web UI

    Hello All ,
       I am working on SAP CRM 7.0 Webui Marketing module (Business Role : Marketingpro) . Here when I select the "Account&Product" Work Center and go to search Contact . Here we will move to the Search Contact View here we will get a list box where we can select any search criteria to search a Contanct . Here in this  List box in need to add a new Field Called "Archiving Flag" . The component of the Search Contact is :: "BP_CONT_SEARCH" And the View is "BP_CONT_SEARCH/Search " Here in the View Structure Tab under Context->Context Node ->Search i just needd to a new Field called "Archiving Flag" in this context node "Search".  Can any Tell me the procedure to add a field to the lsit box of Search Criteria.
       Thanks in Advace
    Regards,
    Kiran Posanapalli.

    Hi Vinutha,
    U can add fields in the search view using AET in one way.
    The other way is identify the component for that search.Press F2 on the web ui screen of ur account search page and see the component name as well the view name for the search fields.
    Go to that search view in the component identified.
    In case of sales pro role,  account search component is  BP_CONT_SEARCH ,go to the view search and in that if we go to context node search an attribute named 'telephone' is present already.We can add that to visible fields in configuration tab.
    If not found under that context node then right click on context node and create a context node.Before that go to genil_model_browser and observe the relation level in which the field(mobile number) we need to add is present and copy the dependent object name.
    For example for phone number the dependent object is BuilAdressPhone. Now pass this value in create context node. Make the adjustments in configuration tab.
    *Give points if found useful.
    Regards
    HCL SPARKS

  • Error while trying to add a new field in search criteria by VO extension

    Hi,
    I am trying to add a new field by using the VO extension to a seeded OAF page used to search Repository contracts.
    I get the following error on opening the page after I have compiled my code on server and bounced apache.
    Message not found. Application: FND, Message Name: FND_VIEWOBJECT_NOT_FOUND. Tokens: VONAME =SSPN_AdvancedSearchAttributesPVO; APPLICATION_MODULE = oracle.apps.okc.repository.search.server.ContractsAdvSearchAM;
    I extended the AM also after this to include the extended VO but still the error comes.
    This page is a dynamic search page where the results change based on the different search criteria.
    Cheers
    Swati

    Hi,
    I extended the AM also after this to include the extended VO but still the error comes.There is no need to extend the AM for extending a VO. Hopefully the VO which u extending already attached to the AM oracle.apps.okc.repository.search.server.ContractsAdvSearchAM.
    Regards,
    Gyan

Maybe you are looking for