Lucene Analyzer classes for CQ search

CQ 5.4. I'm trying to get accented characters to be indexed with the same weight as their non-accented equivalents. So a search for "biere" would return the same results as a search for "bière".
From what I've read on Lucene and Jackrabbit documentation, the way to do this would be to specify in the workspace.xml config <SearchIndex>...</SearchIndex> the param:
<param name="analyzer" value="org.apache.lucene.analysis.ASCIIFoldingFilter"/>
or any similar classes specified here: http://lucene.apache.org/core/3_6_0/api/all/org/apache/lucene/analysis/package-summary.htm l.
However it seems like none of these classes are in scope in CQ:
06.11.2012 16:43:15 *WARN * SearchIndex: Invalid Analyzer class: org.apache.lucene.analysis.ASCIIFoldingFilter (SearchIndex.java, line 1698)
java.lang.ClassNotFoundException: org.apache.lucene.analysis.ASCIIFoldingFilter
I'm wondering how to load analyzer classes. Should I build the default Lucene package as an OSGi bundle? Or is there another way?

Hi,
Please note that CQ 5.4 is bundled with Lucene version 2.4.1 which does not have the ASCIIFoldingFilter yet (check the list of available analyzer filters: find <CQ_HOME> -name "lucene-core*.jar" | xargs jar tf | grep "analysis/.*Filter").
As an alternative, you can use the ISOLatin1AccentFilter (org.apache.lucene.analysis.ISOLatin1AccentFilter) which should satisfy the requirement of your use case (i.e. replacing accented characters by their unaccented equivalent).
On a side note: As CQ 5.5 is bundled with Lucene version 3.0.3, you will be able to use ASCIIFoldingFilter which deprecates ISOLatin1AccentFilter in newer versions of Lucene.
Gregor

Similar Messages

  • Error while mapping a Java class for a Search Dialog Box component

    Hi,
    Scenario : There is PAR which I have developed for the sorting options for a Search Component set to be used in Km Search Iview.
                   I have copied this PAR from a similiar search functionality and customised the same.
    Problem: When I deploy the PAR and then map this class for the sort options while creating a New Search Dialog box :
    I get the following "Class not found error" ... Please can you let me know what could be the problem.
    Any help would be appreciated here as I have tried all the possibilities to solve the problem.
    Regards,
    Vaishali.

    I modified the xml file as described in the forum.But the error persists.
    One interesting thing is:
    When I create model after restarting the NDS,I get the following error:
    org.eclipse.swt.SWTException: Failed to execute runnable <i>(java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library librfc. Found version "620.0.1237" but required at least version "620.0.1374".)</i>
    I get the NoClassDef found error next time onwards,
    Where do I get the 620.0.1374 version of librfc?
    thanx.
    Bhupesh

  • Spry tabbed panels - Different Hover Class for each tab

    Already posted this in the general Dreamweaver section, but just realized there was a specific Spry section. So, my apologies for the repost.
    I'm setting up spry tabbed panels, and I'm wanting to use an image for each tab, with the text already on it. I've figured this much out by creating a different class for each in the spry tabbed panel css.
    However, I'd also like to have a second hover image for each tab. I'm having trouble figuring out how to set up separate classes for each tab's hover state.
    Any help?
    Thanks.

    Just in case you did not notice the announce at the top of this forum's main page, I have copied it here.
    Announcement: New to Spry, or  the Spry forums?
    Hide Details
    Before you post a topic please verify  that:
    You  are using the latest Spry files
    The latest version of  the Adobe Spry Framework is 1.6.1, this is the same version that ships  with Dreamweaver CS4. If you use Dreamweaver CS3 (uses Spry 1.4), its  wise to upgrade your files to the latest version. This can easily be  done using the Spry Updater that can be found here.
    Your  question was not asked before
    Using the search  functionality on forums you can easily find out if your question has  been answered before. While you are in search, you can specify the  search locations. The Spry forum can be found under:
    Adobe  Labs > Spry Framework for Ajax
    Yoru question can not be  found in the existing documentation
    Spry provides you  with allot of documentation this can found on different locations. In  the sidebar of this forum you can find a small summary of resources that  will help you on your way.
    If these options do not apply to your question,  please be so kind to also supply the following information in your topic  together with a clear description of your issue:
    What  browsers does this issue occure:
    example: Internet Explorer 8 on  Window 7 and Firefox 3.0 on Mac OSX
    What version  of Spry are using:
    example: Spry 1.6.1 ( the version number can  be found in license header of the .css and .js files )
    What  is the url of your website or page in issue:
    example: http://www.example.com/page/in/issue.html
    Step  to reproduce the issue:
    example: Scroll down till you find the  header "help", there you will see a Spry Accordion. When you click on it  it will not open or close.
    So users can provide you with a  better answer, without having to ask you for further details.
    by Arnout Kazemier at Oct 23, 2009 2:47 PM                        
    landon_tc wrote:
    Actually, I do remember posting that, and have updated it with what worked for me. However, I could not recall posting it in a specific ajax spry forum, so I assumed I just posted in the general forum. Hence the current situation.
    Yeah and my name is not Ben Pleysier.
    landon_tc wrote:
    Any help with the current problem?
    Please have a look at this thread http://forums.adobe.com/message/2662019#2662019
    I hope this helps.
    Ben Pleysier

  • Unable to compil class for jsp

    error is
    HTTP Status 500 -
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 6 in the generated java file
    Syntax error on token ".", Identifier expected after this token
    An error occurred at line: 7 in the generated java file
    Syntax error on token ".", Identifier expected after this token
    An error occurred at line: 9 in the jsp file: /travel/issue.jsp
    LibraryStudent cannot be resolved to a type
    6: <BODY>
    7: <H1>issue books</H1>
    8: <CENTER>
    9: <jsp:useBean id="student"
    10: type="LibraryStudent"
    11: scope="session" />
    12: student name:
    An error occurred at line: 9 in the jsp file: /travel/issue.jsp
    LibraryStudent cannot be resolved to a type
    6: <BODY>
    7: <H1>issue books</H1>
    8: <CENTER>
    9: <jsp:useBean id="student"
    10: type="LibraryStudent"
    11: scope="session" />
    12: student name:
    An error occurred at line: 13 in the jsp file: /travel/issue.jsp
    LibraryStudent cannot be resolved to a type
    10: type="LibraryStudent"
    11: scope="session" />
    12: student name:
    13: <jsp:getProperty name="student" property="studentName" />
    14:
    15: book name:
    16: <jsp:getProperty name="student" property="bookName" />
    An error occurred at line: 16 in the jsp file: /travel/issue.jsp
    LibraryStudent cannot be resolved to a type
    13: <jsp:getProperty name="student" property="studentName" />
    14:
    15: book name:
    16: <jsp:getProperty name="student" property="bookName" />
    17:
    18: <jsp:getProperty name="student"
    19: property="issueData" />
    An error occurred at line: 18 in the jsp file: /travel/issue.jsp
    LibraryStudent cannot be resolved to a type
    15: book name:
    16: <jsp:getProperty name="student" property="bookName" />
    17:
    18: <jsp:getProperty name="student"
    19: property="issueData" />
    20: </FORM>
    21: </CENTER>LibraryStudent.java is   
    import java.util.*;
    import java.text.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class LibraryStudent {
    private String emailAddress, s,password, sname,bname;
    private String date,value;
    public String getStudentName() {
    return(sname);
    public void setStudentName(String sname) {
    this.sname = sname;
    public String getEmailAddress() {
    return(emailAddress);
    public void setEmailAddress(String emailAddress) {
    this.emailAddress = emailAddress;
    public String getPassword() {
    return(password);
    public void setPassword(String password) {
    this.password = password;
    public String getBookName() {
    return(bname);
    public void setBookName(String bname) {
    this.bname = bname;
    public String getDate() {
    return(date);
    public void setDate(String date) {
    this.date = date;
    public String getIssueData() //method that create connection withh database
    throws ServletException,IOException{
    try{
    getDate();                   //and add a entry in database
    getBookName();
    getStudentName();
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:db2");
    Statement st=con.createStatement();
    String sql =
        "insert into table1 (bookname,studentname,date) values(bname,sname,date)";
      st.executeUpdate(sql);
    System.out.println(sql);
    String s=  "your book has been issued ";
    return(s);
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    public String getSumbitData()
    throws ServletException,IOException{
    try
    getBookName();
    getStudentName();
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:db2");
    Statement st=con.createStatement();
    String sql =
        "delete from db2 where bookname='bname' and studentname=sname";
      st.executeUpdate(sql);
    System.out.println(sql);
    String s="your book has been sumbitted ";
    return(s) ;
    catch(Exception e)
    e.printStackTrace();
    return "failed";
    public static int findStudent    //to validate customer
    (String emailAddress,
    String password) throws ServletException,IOException{
    try
    if (emailAddress == null) {
    return(0);
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:user");
    Statement st=con.createStatement();
    String sql="select * from user where name='"+emailAddress+"' and password='"+password+"'";
    System.out.println(sql);
    ResultSet rs=st.executeQuery(sql);
    if(rs.next())
    return(1);
    else
    return(0);
    }catch(Exception e)
    e.printStackTrace();
    return (0);}
      to be continued.............

    and Library.java is import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Library extends HttpServlet {
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    String emailAddress = request.getParameter("emailAddress");//use to email&pass
    String password = request.getParameter("password");//from html page
    LibraryStudent student = new LibraryStudent();//Make a student Object
    int a=LibraryStudent.findStudent(emailAddress, password);//to validate student
    if (a==0) {
    gotoPage("/library/accounts.jsp", request, response);
    else
    student.setStudentName(request.getParameter("sname"));//use to sent other textbox
    student.setBookName(request.getParameter("bname"));//data in librarystudent
    student.setDate(request.getParameter("date"));//class after validation
    HttpSession session = request.getSession(true);
    session.putValue("student", student);
    //for moving different page
    if (request.getParameter("issue") != null) {
    gotoPage("/travel/issue.jsp",
    request, response);
    } else if (request.getParameter("sumbit") != null) {
    gotoPage("/travel/sumbit.jsp",
    request, response);
    } else if (request.getParameter("search") != null) {
    gotoPage("/travel/search.jsp",
    request, response);
    } else if (request.getParameter("account") != null) {
    gotoPage("/travel/EditAccounts.jsp",
    request, response);
    } else {
    gotoPage("/travel/IllegalRequest.jsp",
    request, response);
    private void gotoPage(String address,
    HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    RequestDispatcher dispatcher =
    getServletContext().getRequestDispatcher(address);
    dispatcher.forward(request, response);
    }    issue.jsp is
       <%@page import="java.io.,java.util.,java.sql.*"%>
    <HTML>
    <HEAD>
    <TITLE>issue books</TITLE>
    </HEAD>
    <BODY>
    <H1>issue books</H1>
    <CENTER>
    <jsp:useBean id="student"
    type="LibraryStudent"
    scope="session" />
    student name:
    <jsp:getProperty name="student" property="studentName" />
    book name:
    <jsp:getProperty name="student" property="bookName" />
    <jsp:getProperty name="student"
    property="issueData" />
    </FORM>
    </CENTER>
    </BODY>
    </HTML> plz solve my problem .i m new to servlet and jsp and i have keen desire to learn this topic

  • How to create object class for a z table

    Hi All,
    I have a z table and I want to register the changes of fields should be logged to CDHDR and CDPOS table.
    Is this possible?
    If yes how can I creat an object class for a z table. I have already checked the change document option in z data element.
    Please help.
    Regards,
    Jeetu
    Moderator message: standard functionality, please search for available information/documentation before asking.
    locked by: Thomas Zloch on Oct 6, 2010 6:16 PM

    Tcode SCDO. You'll need to create a change document for you Z table and then use the FM created to record the changed data.

  • Implementation of F4 value help for a search field which is an EEWB field

    Hi...
                I am trying to create a F4 value help for a search field which is an eewb field.The f4 value help jus need to be a pop up containing the values of the field existing in the system.Since this is a search field the GET_V method cannot be used. I tried implementing it by creating a search help and then using it in the GET_DQUERY_VALUEHELPS method.But the problem when u use the search help is that all the values including the null values and duplicate entries will be populated when f4 is clicked.Is there any way to filter the values that get populated when f4 is clicked?If any other method can be used to implement the functionality please let me know..Thanks in advance....

    Hi,
    the GET_V methods worked for me most of the time. Even in advanced searchs. Only time they do not is if there is a different aproach considered in the GET_DQUERY_VALUEHELPS.
    As the GET_V_ you created obviously was called I suppose you found the correct place to Populate it to be used in the search.
    I do not know what the problem with the NULL values and duplicate entries is you talked about, but it sounds to me the creation of your valuehelp class is flawed. Not the integration into the UI.
    Maybe have a look at SAPs' standard implementations of Search Components. You should get a feeling for how search helps work. See. BT111S_OPPT, BP_HEAD_SEARCH
    cheers Carsten

  • Where can I see the generated/interposition classes for jboss

    ello,
    Can anyone tell me where the java files generated by jboss are kept or how I can see them. (the implementation for ejbobject or cmp abstract classes for instance).
    Thanks in advance,
    Julien.

    I think u can find it inside {jboss}\server\default\work
    or you can search for the .java file inside the Jboss
    MyHome*.java
    Baiju

  • Best collection for ordered search?

    I have a list of objects that need to be in a specific order (e.g. sorted by name). The list does not only contain the names as elements, but specific objects that have a field for the name/id. With a simple ArrayList, this is no problem. However, I also need to search in this (big) list very often for another field (date). The simple search is not very smart (for -loop over all elements until found).
    I found the java.util.TreeMap class and its javadoc tells about what I'm looking for ... i think:
    [This class guarantees that the map will be in ascending key order, sorted according to the natural order for the key's class (see Comparable), or by the comparator provided at creation time, depending on which constructor is used.
    This implementation provides guaranteed log(n) time cost for the containsKey, get, put and remove operations.
    /i]
    So, does this data structure fullfill my 3 needs:
    1) elements need to be sorted
    2) search is quite fast (compared to brainless iteration over all elements)
    3) insertion guarantees the elements to be in sorted order

    You mean to say your list could have three kinds of
    elements: name(String), date or an Object. In that
    case you need to implement comparator for elements in
    a way specific to your needs. I think TreeMap is the
    best fit for your requirement, but I am no expert.
    Just trying to think along with you, I could be as
    wrong as u could be.No, my List contains objects of the same type (class "Item"). Each item object has misc fields: "posId", "incDate" and others. The list is filled so that the objects are ordered by incDate and posId. I sometimes have to search for specific incDate and sometimes for specific posIds, but to make things worse: I don't search for just 1 hit, but for a range of hits (time frame or set of objects with same posIds).
    So, I doubt I can use a Hashtable or a TreeMap, because they are based on unique keys. I fear I have to stick with my plain ArrayList and do stupid for-loop searches to find my ranges - even though the objects are sorted ... ?

  • Class for BP relationships

    Is there a general class for creating relationships and / or storing relationship attributes? I did do an extensive search in CRM, but couldn't find any class according to my requirements.
    Kind regards,
    Micky.

    Hi,
    You can use FM *CRM_ISA_BUPA_RELSHIP_CREATE*.
    In the exporting     PARTNER1  &  PARTNER2  input the partner_guid and in RELATIONSHIPCATEGORY  input relation.
    Thanks
    RR

  • Same Feeder Class for 2 GUIBBs

    Hi All,
    I have created one feeder class for 2 GUIBBs (List UIBB and Form UIBB) by implementing respective interfaces for them. These GUIBBs have been included in the same user screen. I have also setup parameter for this feeder class (No meaningful purpose, but just to try out). Here are my questions:
    1. I was expecting a single instance of this class when user enters the screen which would then become basis for sharing data between these UIBBs. However, I noticed that 2 instance were created for each UIBB. Is it the normal behaviour? I also tried giving same value or no value to feeder class parameter but for no help.
    2. To get rid of above problem, I declared feeder class attributes that were part of sharing as static attributes. But now the problem was, my Form data was dependent on List data. So I wanted that GET_DATA method of List UIBB should be called before GET_DATA method of Form UIBB. However, Form method is getting called first. Since it always happen, I wanted to know how the system decides on the sequence of calls and is there any way to program /change that sequence.
    Thanks!
    Bhaskar

    So this is what I am trying to do:
    When the user enter Pernr and hit 'Search',
    - all the related records should get updated in the list.
    - Details section should get updated with the 1st index record
    - On selection of other records from list, the related data should get update in details section.
    Now the problem is, as I mentioned, the GET_DATA method of Form UIBB is getting called before List UIBB. Due to this, there is a lag in the details section data update. As earlier noted, I am using the same class for both UIBBs.
    Advice please.
    Best Regards,
    Bhaskar

  • Interactive Scripting Editor (ISE) how to write a class for an action?

    Hi - I need to write a class for an action in the interactive scripting editor.  The class will create a new case (case management) and return the number.  I have created a class with a method that does this and has been fully tested but we cannot get it to work as part of an action within the ISE.  Are there any guidelines for writing classes for the ISE.  Or  has anyone done this?  Do I need a super class?  I have searched every where but can find nothing on this.  Many thanks.

    Hi Nigel,
    I am also looking for the answer to this.  Please let me know when you find a solution.
    Kind Regards,
    Andrew Griffin.

  • FM/BAPI/CLASS for  VA01,VA02,VA03 ie maintain sales order.

    Hi,
       Is there any FM or Class to maintain sales orders. Any help will be appriciated.
    Regards,
    Sami.

    Go to SE37 and search for BAPISALESORDER*
    You find a list of bapi's. Some examples:
    BAPI_SALESORDER_CHANGE
    BAPI_SALESORDER_CONFIRMDELVRY
    BAPI_SALESORDER_CREATEFROMDAT1
    BAPI_SALESORDER_CREATEFROMDAT2
    BAPI_SALESORDER_CREATEFROMDATA
    BAPI_SALESORDER_GETLIST
    BAPI_SALESORDER_GETSTATUS
    BAPI_SALESORDER_SIMULATE
    I checked and didn't found a class for this but i guess the one you want is BAPI_SALESORDER_CHANGE.
    The BAPI does not do a commit therefor use the following after the first BAPI: BAPI_TRANSACTION_COMMIT
    Edited by: Christophe Gillijns on May 26, 2010 3:27 PM

  • Class for Purchase order item components and Production order components

    I'm looking for a some classes.   I'm very new to objects, so I could be searching for them incorrectly.
    The first class I'm looking for is a purchase order class that contains the item components.  I've looked at CL_PO_ITEM_HANDLE_MM and CL_PO_HEADER_HANDLE_MM.  I couldn't find components as a part of either of the classes.
    The second one I'm looking for is not as critical.  It is for the components for a production order.   I have a function module: BAPI_PRODORD_GET_DETAIL that gets the components for the order.  However, to take advantage of objects - I read somewhere - that if possible I should avoid calling a function module.
    Any help that you could give would be greatly appreciated.
    Thank you!
    Michelle

    Hello Michelle
    I do not think there are already classes available on ERP 6.0 for reading production order (yet I might be wrong...). However, regarding purchase order you are already on the right track.
    *& Report  ZUS_SDN_OO_READ_PO
    *& Thread: Class for Purchase order item components and Production order components
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1206523"></a>
    "& NOTE: Coding adapted from BAPI_PO_GETDETAIL1
    REPORT  zus_sdn_oo_read_po.
    TYPE-POOLS: abap, mmpur.
    PARAMETER:
      p_ebeln   TYPE ebeln  DEFAULT '3000000045'.
    DATA: gs_document    TYPE mepo_document,
          go_po          TYPE REF TO cl_po_header_handle_mm,
          gs_header      TYPE mepoheader,
          gd_tcode       TYPE sy-tcode,
          gd_result      TYPE mmpur_bool.
    data: gt_items       type PURCHASE_ORDER_ITEMS,
          gs_itm         type PURCHASE_ORDER_ITEM,
          gs_item        type mepoitem.
    START-OF-SELECTION.
    *  prepare creation of PO instance
      gs_document-doc_type    = 'F'.
      gs_document-process     = mmpur_po_process.
      gs_document-trtyp       = 'A'.  " anz.  => display
      gs_document-doc_key(10) = p_ebeln.
    *  object creation and initialization
    **  l_ebeln = purchaseorder.
      CREATE OBJECT go_po.
      CALL METHOD go_po->po_initialize( im_document = gs_document ).
      CALL METHOD go_po->set_po_number( im_po_number = p_ebeln ).
      CALL METHOD go_po->set_state( cl_po_header_handle_mm=>c_available ).
    *  read purchase order from database
      gd_tcode = 'ME23N'.
      CALL METHOD go_po->po_read
        EXPORTING
          im_tcode     = gd_tcode
          im_trtyp     = gs_document-trtyp
          im_aktyp     = gs_document-trtyp
          im_po_number = p_ebeln
          im_document  = gs_document
        IMPORTING
          ex_result    = gd_result.
    *  there was a problem in reading the PO
      IF ( gd_result EQ mmpur_no ).
    **    l_messages = l_handler->get_list_for_bapi( ).
    **    PERFORM return TABLES l_messages return
    **                          poitem poschedule poaccount.
    **    CALL METHOD l_po->po_close( ).
      ELSE.
        gs_header = go_po->if_purchase_order_mm~get_data( ).
        WRITE: / gs_header-ebeln,
                 gs_header-bukrs,
                 gs_header-bsart,
                 gs_header-lifnr.
      ENDIF.
      gt_items = go_po->if_purchase_order_mm~get_items( ).
      LOOP AT gt_items INTO gs_itm.
        gs_item = gs_itm-item->get_data( ).
        write: / gs_item-ebelp,
                 gs_item-matnr,
                 gs_item-menge.
      ENDLOOP.
    END-OF-SELECTION.
    Regards
      Uwe

  • Create JPub class for table of records/record types and access them

    Hi,
    I have the following object types in the database:
    PERSON_REC with 3 fields and
    PERSON_TAB table of PERSON_REC
    I have created a Java class for PERSON_REC using JPub. The created class implements CustomDatum and CustomDatumFactory. How do I do it for table of records type i.e PERSON_TAB??
    I have a stored procedure that has PERSON_TAB as a OUT parameter. How do retrieve the value from callablestatement? Is there a sample code anywhere. Kindly direct me.
    I have seen sample code and documentation for PERSON_REC type from JPub but not for table of records; also there is no sample code for accessing them from JDBC. Please help me..
    Thanks and regards,
    Vadi.

    Vadi,
    Try searching this forum's archives for the words "STRUCT" and "ARRAY".
    Good Luck,
    Avi.

  • Is creating an entity object expensive for wrapping search values..

    I am trying to create a very robust generic method that searches for entities that match the fields according to a enum of search types.
    The easiest way I find is to wrap all the values into an instance of the entity class so that testing can be done on field values expected to be present.
    So the question is if creating an entity object for the sole purpose of wrapping search values is considered expensive?

    yawmark wrote:
    User has the ability to search for a number by simply providing a number and then choosing to find all numbers that match, or especifically just a home, work or cell number that match.That requirement doesn't make any sense to me. Can you please elaborate on that use case? I understand phone number reverse look-ups, but those are typically looking for a person or business. One typically wouldn't search for a number by providing a matching number.
    ~But one could...
    I think a point is being missed here and therefore I need to discuss a new design pattern I am using...
    1) I create a entity class as per usual but I break a o-o rule with encapsulation. All of my fields are protected and not private. This allows me to create a subclass of the entity and inherit the members so that they can be used for the function of this class. The sole purpose of this subclass is to put an o-o framework around a String[] of search criteria provided according to the type of search to be done.
    2) The method in my interface for finding is now extremely robust and is defined as follows...
    @Local
    public interface DBLocal<Entity, RecNo, T extends  Entity> {
         * Retuns a List of all {@code <Entity>} records that match the search
         * criteria based on the type of search.
         * @param entitySub the entity subclass object that contains the values
         * to be used in searching. These values <b>must</b> be in
         * the correct fields in order for the search to be accurate. Eg: If a
         * request is done to search for all records that have names that match
         * according to a persons name, then a <code>getName()</code> method on
         * the {@code entity} subclass would be expected to
         * <ol>
         * <li> not return null
         * </li>
         * <li> Return the value "Tom" if the user wishes to find all records
         * that have the name "Tom".
         * </ol>
         * @param typeOfSearch the <code>SearchType</code> that is to be done.
         * @return a List of all {@code <Entity>} records that match the search
         * criteria based on the type of search.
         * @see phonebook.util.SearchType
         * @throws IllegalArgumentException if the search criteria provided is
         * incorrect for the type of search requested.
         * @throws DataAccessException if an underlying error causes the search to
         * fail.
        public List findBySearchType(T entitySub, SearchType typeOfSearch)
                throws DataAccessException;As you can see I am aiming for an interface that I can use as a utility class. Type T is a subclass of the entity that this interface is mostly being used for and will always be a subclass created specifically to hold the search data. The SearchType is an enum that contains an enumeration of the search types allowed.
    Yes it may not be normal to provide a phone number and then search but I have seen this functionality where one can go online and do a search based solely on the number entered. Anyway I thing I found a design that is reusable now and my problem is solved.
    Many thanks
    Yucca
    Edited by: Yucca on Jul 17, 2009 8:33 PM

Maybe you are looking for