com.ibm.commerce.member.search

Class ECUserQuery

  • All Implemented Interfaces:
    java.io.Serializable


    public class ECUserQuery
    extends ECQuery
    The WCUserQuery is a concrete instantiation of the WCQuery abstract class. It is used to generate search queries for users in the WebSphere Commerce database. This class knows the list of tables that can be selected from for a USER query, and also knows how to join these tables. It has default values for the list of attributes to retrieve for a user, and the semantics of the different types of users in the WebSphere Commerce system (B2B users, B2C shoppers, administrators). Usage: This example searches for all users whose logonId is LIKE %myLogon%
                            ECUserQuery query = new ECUserQuery();
                            WhereClauseSearchCondition whereClause = 
                                    new WhereClauseSearchCondition(
                                            new TableField("USERREG", "LOGONID"),
                                            WhereClauseSearchCondition.SEARCHTYPE_CASEINSENSITIVE_CONTAINS,
                                            "myLogon");
                            query.setWhereClause(whereClause);
    
                            Vector vecResults =
                                    (new UserSearchAccessBean()).executeCustomizeableMemberSearch(
                                            query);
     
    The Vector of results contains Vectors, each of which has one entry -- for the USERS.USERS_ID of the user found. Tables that can be used as query parameters for user queries are:
    USERS
    --
    The user's user record
    USERREG
    --
    The user's user registry record
    USERDEMO
    --
    The user's demographics information
    USERPROF
    --
    The user's user profile information
    PARENTORG
    --
    The user's parent organization (ORGENTITY table)
    ANCESTORORG
    --
    The user's ancestor organization (ORGENTITY table)
    ADDRESS
    --
    The user's selfaddress
    BUSPROF
    --
    The user's business profile information
    ACCOUNT
    --
    Accounts owned by the parent organization
    MBRROLE
    --
    Roles played by the user
    MBRATTRVAL
    --
    Custom member attributes for the user
    MBRREL
    --
    The user's ancestors
    MEMBER
    --
    The user's MEMBER table entry
    MBRGRPMBR
    --
    The user's MBRGRPMBR table entry
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright
        See Also:
        Constant Field Values
      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The class name.
        See Also:
        Constant Field Values
      • PROFILETYPE_B2B_USERS_ONLY

        public static final java.lang.String[] PROFILETYPE_B2B_USERS_ONLY
        Constant to be used with the USERS.PROFILETYPE filter. Use this constant if you want to return only B2B users.
      • PROFILETYPE_B2C_USERS_ONLY

        public static final java.lang.String[] PROFILETYPE_B2C_USERS_ONLY
        Constant to be used with the USERS.PROFILETYPE filter. Use this constant if you want to return only B2C users.
      • PROFILETYPE_B2B_AND_B2C_USERS

        public static final java.lang.String[] PROFILETYPE_B2B_AND_B2C_USERS
        Constant to be used with the USERS.PROFILETYPE filter. Use this constant if you want to return B2B and B2C users.
      • REGISTERTYPE_REGISTERED_CUSTOMERS_ONLY

        public static final java.lang.String[] REGISTERTYPE_REGISTERED_CUSTOMERS_ONLY
        Constant to be used with the USERS.REGISTERTYPE filter. Use this constant if you want to return only registered shoppers.
      • REGISTERTYPE_ADMINISTRATORS_ONLY

        public static final java.lang.String[] REGISTERTYPE_ADMINISTRATORS_ONLY
        Constant to be used with the USERS.REGISTERTYPE filter. Use this constant if you want to return only administrators.
      • REGISTERTYPE_REGISTERED_CUSTOMERS_AND_ADMINISTRATORS

        public static final java.lang.String[] REGISTERTYPE_REGISTERED_CUSTOMERS_AND_ADMINISTRATORS
        Constant to be used with the USERS.REGISTERTYPE filter. Use this constant if you want to return registered shoppers and administrators.
      • JOIN_MEMBER

        public static final java.lang.String JOIN_MEMBER
        Join condition for the MEMBER table.
        See Also:
        Constant Field Values
      • JOIN_USERREG

        public static final java.lang.String JOIN_USERREG
        Join condition for the USERREG table.
        See Also:
        Constant Field Values
      • JOIN_USERDEMO

        public static final java.lang.String JOIN_USERDEMO
        Join condition for the USERDEMO table.
        See Also:
        Constant Field Values
      • JOIN_BUSPROF

        public static final java.lang.String JOIN_BUSPROF
        Join condition for the BUSPROF table.
        See Also:
        Constant Field Values
      • JOIN_USERPROF

        public static final java.lang.String JOIN_USERPROF
        Join condition for the USERPROF table.
        See Also:
        Constant Field Values
      • JOIN_PARENTORG

        public static final java.lang.String JOIN_PARENTORG
        Join condition for the parent organization from the ORGENTITY table.
        See Also:
        Constant Field Values
      • JOIN_ANCESTORORG

        public static final java.lang.String JOIN_ANCESTORORG
        Join condition for any ancestor organization from the ORGENTITY table.
        See Also:
        Constant Field Values
      • JOIN_ADDRESS

        public static final java.lang.String JOIN_ADDRESS
        Join condition for the ADDRESS table.
        See Also:
        Constant Field Values
      • JOIN_ACCOUNT

        public static final java.lang.String JOIN_ACCOUNT
        Join condition for the ACCOUNT table.
        See Also:
        Constant Field Values
      • JOIN_MBRREL

        public static final java.lang.String JOIN_MBRREL
        Join condition for the MBRREL table.
        See Also:
        Constant Field Values
      • JOIN_MBRROLE

        public static final java.lang.String JOIN_MBRROLE
        Join condition for the MBRROLE table.
        See Also:
        Constant Field Values
      • JOIN_MBRATTRVAL

        public static final java.lang.String JOIN_MBRATTRVAL
        Join condition for the MBRATTRVAL table.
        See Also:
        Constant Field Values
      • JOIN_MBRGRPMBR

        public static final java.lang.String JOIN_MBRGRPMBR
        Join condition for the MBRGRPMBR table.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ECUserQuery

        public ECUserQuery()
        Default constructor.
    • Method Detail

      • getWhereClauseFilterForProfileTypes

        public static WhereClauseCondition getWhereClauseFilterForProfileTypes(java.lang.String[] astrProfileTypes)
        Filter for specific values of USERS.PROFILETYPE. Valid values are 'B' for B2B users, and 'C' for B2C users.
        Parameters:
        astrProfileTypes - The PROFILETYPE values to filter by.
        Returns:
        WhereClauseCondition The filter where clause condition.
      • getWhereClauseFilterForRegisterTypes

        public static WhereClauseCondition getWhereClauseFilterForRegisterTypes(java.lang.String[] astrRegisterTypes)
        Filter for specific values of USERS.REGISTERTYPE. Valid values are 'R' for registered shoppers, 'A' for administrators, and 'S' for site administrators.
        Parameters:
        astrRegisterTypes - The REGISTERTYPE values to filter by.
        Returns:
        WhereClauseCondition The filter where clause condition.
      • getWhereClauseAllUsersInOrgsICanManage

        public static WhereClauseCondition getWhereClauseAllUsersInOrgsICanManage(java.lang.Long anUserId)
        This Where Clause can be used to filter only those users for whom the active user has 'organization manage' authority for one of the ancestors. This would include users under organizations where an administrative role is played explicitly or implicitly through role inheritance. This will also include users under organizations for which a role is played transitively by membership in the registered customer member group.
        Parameters:
        anUserId - The user who is performing the query
        Returns:
        WhereClauseCondition The access control prefiltering where clause condition; null if the userId was not defined; an empty condition if the user is a site administrator.