TopLink essentials: extra where clause for one to many relationship?

We have a lot of tables that contain "historic" records. Those are marked by a column "historic" holding a value "Y". Sometimes we are not interested in historic values. For example in the next case:
@Entity
@Table(name="ART")
public class Article {
    @OneToMany(mappedBy="article", cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    private Collection<ArticleStats> arcItems;
    public Collection<ArticleStats> getArticleStats() {
        return arcItems;
}One article can have multiple "stats". We are in this case only interested in the "stats" of this article that are not historic. In SQL terms, I would like to add an extra where clause: "WHERE historic = 'N'".
Of course inheritance (with discriminators) is an option, but I don't prefer that. We have a lot of relationships like this and using inheritance would mean we have to add a lot of extra classes. Is there a way to add an extra where clause to the query that is used to retrieve all the stats records related tot my Article?
We use TopLink essentials with an IBM AS/400 database.

The JPA Spec does not handle this case, but TopLink Essentials does. You will need to customize your TopLink descriptor using a DescriptorCustomizer. You can set your DescriptorCustomizer in your persistence.xml using the "toplink.descriptor.customizer.<entity-name>" property set to the class name "<package>.<class>" of your customizer class.
The customizer would look something like:
public class MyCustomizer implements DescriptorCustomizer {
public void customize(ClassDescriptor descriptor) {
OneToManyMapping mapping = (OneToManyMapping )descriptor.getMappingForAttributeName("arcItems");
ExpressionBuilder builder = new ExpressionBuilder();
mapping.setSelectionCriteria(builder.getField("STAT.ART_ID").equal(builder.getParameter("ART.ID").and(builder.getField("HISTORY").equal("N")));
If you never wanted historical records you could also add this expression to your descriptor's additionalJoinExpression.
James Sutherland

Similar Messages

  • What types of containers need to be used for one-to-many relationships

    While looking at toplink examples, I noticed that synchronized containers only are being used for one-to-many relationships even though it's not required by the documentation.
    Is it required?
    Also how does merge affect it? I'm gettning concurrent modification exceptions from time to time, while using iterators for containers from these relationships.
    Does it mean that I have to use enumeration on vectors only and toplink merge isn't atomic? So there is no isolation when toplink merges the data from unit of work into identity maps?
    There is nothing about thread-safety and threading aspects of accessing containers for CollectionMapping based relationships. Please advise.

    Non synchronized containers can be used but may require some extra code to handle concurrent access. If you are accessing the objects from the shared cache (not cloned in a UnitOfWork) then you will need to isolate your iteration within a synchronized block, synchronized on the collection itself, or handle the ConncurrentModificationException if they happen rarely.
    Because these are shared instances of these collections other threads may be writing to them while they are being read from.
    --Gordon

  • Sql squery for one to many relationship

    I need to write sql for below requirement:
    table structure is
    serial no LPN
    1 4
    2 4
    3 6
    4 6
    5 6
    6 3
    7 3
    8 3
    9 1
    I have to pick distinct 'LPN' like below:
    (any serial no can be picked for the distinct LPN)
    results needs to be as below:
    serial no LPN
    1 4
    3 6
    6 3
    9 1
    Please suggest with sql.

    Hi,
    915766 wrote:
    I need to write sql for below requirement:
    table structure is
    serial no LPN
    1 4
    2 4
    3 6
    4 6
    5 6
    6 3
    7 3
    8 3
    9 1
    I have to pick distinct 'LPN' like below:That sounds like a job for "GROUP BY lpn".
    (any serial no can be picked for the distinct LPN)It looks like you're displaying the lowest serial_no for each lpn. That's easy to do, using the aggregate MIN function.
    results needs to be as below:
    serial no LPN
    1 4
    3 6
    6 3
    9 1
    Please suggest with sql.Here's one way:
    SELECT    MIN (serial_no)   AS serial_no
    ,         lpn
    FROM      table_x
    GROUP BY  lpn
    ORDER BY  lpn     -- if wanted
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • Toplink one to many relationship

    I am working on DAO layer for One to many relationship
    how can we get the list child objects based on parent id..
    we are using toplink ...

    Hi,
    If you are using with JPA, try this:
    em.createQuery("select c from child c where c.parent.id = :id").setParameter("id", parentObject.getId())
                                                                                           .getResultList();

  • Partial object read ant one-to-many relationship

    Hi,
    does Toplink support partial object reading for one-to-many links?

    Not really, but it might work in 10.1.3 or 11g preview. You can use joining (join fetch) on 1-m (10.1.3) and m-m (11g).
    In 11g you can use fetch groups that do support 1-m and m-m, and also let you join fetch or batch the relationship. You need to use weaving to use fetch groups.

  • Creating WHERE clause for an outer join using DatabaseFilter

    Hi all,
    I read a post on thie group about constructing the WHERE clause for a RowSet Controls
    SQL Query using the DatabaseFilter and this is what it said:
    ****************************************************************************The
    following example shows adding part of a WHERE clause in an action method of a
    page flow:
    DatabaseFilter.FilterTerm term = new DatabaseFilter.FilterTerm(); term.sColumnName
    = "name"; term.op = DatabaseFilter.opContains; // there are ops for equals, less
    than, etc... term.value = form.getPartialName();
    // You can also add sort terms for an ORDER BY clause allNames = dbControl.getNames(new
    DatabaseFilter(new DatabaseFilter.FilterTerm[] {term}, null));
    I am trying to create a where clause which uses a join like this:
    Select * from x,y where x.id=y.id (+)
    ie. All values from x.id but only corrosponding ones from y.id.
    Is there any way to build this outer join query using the DatabaseFilter class
    or am i forced to use a String which is contruct in my page flow as the where
    clause?like so:
    * @jc:sql command-type="grid"
    * rowset-name="RFPSRowSet"
    * max-rows="1000"
    * statement::
    * SELECT RFPS.RFP_ID,RFPS.NAME AS RFP_NAME,RFPS.FFO_NUMBER,RFPS.RFP_TYPE,RFPS.CFDA_NUMBER,COMPETITIONS.NAME
    AS COMP_NAME,COMPETITIONS.COMPETITION_ID FROM RFPS,COMPETITIONS WHERE {sql: whereClause
    } {sql: filter.getOrderByClause ()}
    public RowSet getAllRfps(java.lang.String whereClause,DatabaseFilter filter)
    throws SQLException;
    and in my pageFlow action, i do the following:
    StringBuffer whereClause= new StringBuffer();
    whereClause.append("RFPS.RFP_ID = COMPETITIONS.RFP_ID (+)");
    if ((form.getRfpTitle() != null) &&
    (!form.getRfpTitle().equalsIgnoreCase("")))
    whereClause.append(" AND UPPER(RFPS.NAME) LIKE %"+form.getRfpTitle().toUpperCase());
    if ((form.getCfdaNumber() != null) &&
    (!form.getCfdaNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.CFDA_NUMBER ="+form.getCfdaNumber());
    if ((form.getFfoNumber() != null) &&
    (!form.getFfoNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.FFO_NUMBER ="+form.getFfoNumber());
    sortFilterService = SortFilterService.getInstance(getRequest());
    DatabaseFilter filter=sortFilterService.getDatabaseFilter(getGridName());
    log.debug("***********"+whereClause.toString()+"***********");
    allRows = searchRfaAndComp.getAllRfps(whereClause.toString(),filter);
    Thanks in advance for your help,
    Regards,
    Vik.

    Thanks for your reply. Just one more question....if we indeed are trying to use
    a simple query and have a where clause like "select * from x where upper(x) like
    {x}", how do we set the UPPER filter on the column using the database filter?
    I see a IDENTIFIER.ISUPPER static field on that DatabaseFilter but am unsure how
    to use it. Would appreciate any pointers .
    Thanks again,
    Vik
    Eddie O'Neil <[email protected]> wrote:
    Vik--
    I believe that the approach that you describe below is the best one
    for dealing with outer joins
    with the DatabaseFilter.
    Apologies for the limitation...
    Eddie
    vik wrote:
    Hi all,
    I read a post on thie group about constructing the WHERE clause fora RowSet Controls
    SQL Query using the DatabaseFilter and this is what it said:
    ****************************************************************************The
    following example shows adding part of a WHERE clause in an actionmethod of a
    page flow:
    DatabaseFilter.FilterTerm term = new DatabaseFilter.FilterTerm(); term.sColumnName
    = "name"; term.op = DatabaseFilter.opContains; // there are ops forequals, less
    than, etc... term.value = form.getPartialName();
    // You can also add sort terms for an ORDER BY clause allNames = dbControl.getNames(new
    DatabaseFilter(new DatabaseFilter.FilterTerm[] {term}, null));
    I am trying to create a where clause which uses a join like this:
    Select * from x,y where x.id=y.id (+)
    ie. All values from x.id but only corrosponding ones from y.id.
    Is there any way to build this outer join query using the DatabaseFilterclass
    or am i forced to use a String which is contruct in my page flow asthe where
    clause?like so:
    * @jc:sql command-type="grid"
    * rowset-name="RFPSRowSet"
    * max-rows="1000"
    * statement::
    * SELECT RFPS.RFP_ID,RFPS.NAME AS RFP_NAME,RFPS.FFO_NUMBER,RFPS.RFP_TYPE,RFPS.CFDA_NUMBER,COMPETITIONS.NAME
    AS COMP_NAME,COMPETITIONS.COMPETITION_ID FROM RFPS,COMPETITIONS WHERE{sql: whereClause
    sql: filter.getOrderByClause ()}* ::
    public RowSet getAllRfps(java.lang.String whereClause,DatabaseFilter
    filter)
    throws SQLException;
    and in my pageFlow action, i do the following:
    StringBuffer whereClause= new StringBuffer();
    whereClause.append("RFPS.RFP_ID = COMPETITIONS.RFP_ID (+)");
    if ((form.getRfpTitle() != null) &&
    (!form.getRfpTitle().equalsIgnoreCase("")))
    whereClause.append(" AND UPPER(RFPS.NAME) LIKE %"+form.getRfpTitle().toUpperCase());
    if ((form.getCfdaNumber() != null) &&
    (!form.getCfdaNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.CFDA_NUMBER ="+form.getCfdaNumber());
    if ((form.getFfoNumber() != null) &&
    (!form.getFfoNumber().equalsIgnoreCase("")))
    whereClause.append(" AND RFPS.FFO_NUMBER ="+form.getFfoNumber());
    sortFilterService = SortFilterService.getInstance(getRequest());
    DatabaseFilter filter=sortFilterService.getDatabaseFilter(getGridName());
    log.debug("***********"+whereClause.toString()+"***********");
    allRows = searchRfaAndComp.getAllRfps(whereClause.toString(),filter);
    Thanks in advance for your help,
    Regards,
    Vik.

  • ADF dynamic where clause for VO query using BC

    I'm hoping someone can help me out. I have a read only view object that I want to filter results based on some user choices. For example the user may want to see all results or they may only want to see a much smaller subset. This is for an error dashboard, the smaller subset maybe by application or maybe by application and by error severity. I think I can use a dynamic where clause but I'm not sure, Can someone get me started down the right path, or post an example that I can see.

    Hi user,
    You can use a dynamic where clause for this, but maybe there is a more practical option. Maybe you can have a fixed where clause, but using a bind parameter, like:
    vo.application like :applicationParam. This makes an executeWithParams method available that you can call from your page, and use in the bindings. This parameter you can populate with the results of for example a poplist, with a default value of '%'.
    When you do want to use a dynamic where clause, you will need to add a method to the java code of your application module, and make this method available for the client. In this method, you can use findViewObject to retrieve your VO, use VO.setWhereClause to set the whereclause to what you want, and then call VO.executeQuery. This method can then again be called from the page.
    Success,
    Jeroen van Veldhuizen

  • DATAMOVER: Error: Syntax error in where clause for PSOPRDEFN

    SET LOG C:\PSUSER_HRM.log;
    SET input F:\psoprdefn.dat;
    IMPORT psoprdefn where OPRId = 'PS';
    when i execute this command after importing .dat file from my database i get error:
    Error: Syntax error in where clause for PSOPRDEFN
    any suggestions pls help....
    Thanks
    aravind
    Edited by: 967641 on Nov 20, 2012 11:39 AM
    Edited by: 967641 on Nov 20, 2012 11:40 AM

    That is correct.
    Datamover tries to insert data in PSOPRDEFN and rows exist with these keys.
    To avoid this you can add the following statement in your script:
    SET UPDATE_DUPS;
    This will update the values other than the keys if a row already exists in the database with the keys in the dat file.
    I can advice you to buy the new book of Jim Marion, PeopleSoft PeopleTools Data Management and Upgrade Handbook
    http://www.amazon.com/PeopleSoft-PeopleTools-Management-Upgrade-Handbook/dp/0071787925/ref=sr_1_1?ie=UTF8&qid=1353575734&sr=8-1&keywords=jim+j+marion
    It has an entire chapter on how to use datamover.
    Hakan

  • Dynamic where clause for MULTIPLE values

    In the following of dynamic where clause?
    i have some somewhat different problem.
    Is a dynamic where clause for multiple values possible?
    If the inputvariable varCode1,varCode2,varCode3,varCode4 are 0 then show all id's otherwise filter the resultset on var1 and/or var2,and/or var3,and/or var4.
    Example table:
    create table t
    (d int,var int);
    insert into t values (1 ,1 );
    insert into t values (2 ,1 );
    insert into t values (3 ,2 );
    insert into t values (4 ,3 );
    insert into t values (5 ,4 );
    insert into t values (6 ,4 );
    insert into t values (7 ,4 );
    insert into t values (8 ,4 );
    insert into t values (9 ,5 );
    insert into t values (10, 6);
    insert into t values (11, 6);
    So what i want to change the where clause upon the value of the varCodes. If var1 and var are not 0 a "AND" should be used otherwise an "OR"
    select id
    from tst
    where var = DECODE( :varCode1, 0, var, :varCode1)
    or/and(?) DECODE( :varCode2, 0, var, :varCode2)
    or DECODE( :varCode3, 0, var, :varCode3)
    or DECODE( :varCode4, 0, var, :varCode4)

    Please turn off your Caps Lock
    and try this link
    Dynamic WHERE clause

  • Toplink mapping for one-to-many object inheritance

    Hi
    I currently have a Person object, extended by two specialist classes, PremisesLicenceHolder and PersonalLicenceHolder. I have mapped this in Toplink and it works fine saving a person into the specialist tables using the primary key person_id.
    However, a single Person may be extended any number of times by either one or both of the two specialist types. So, a Person may be a PremisesLicenceHolder many times over for different premises and licences, and also a PersonalLicenceHolder several times over.
    Is it possible to map this object model in Toplink avoiding duplicate person_id primary keys in the specialist tables?
    Thanks

    Hi,
    I am happy that my object model fits the problem domain. The Person and Organisation objects contain base information and have the primary keys person_id and organisation_id. It is important that there is no duplication of person and organisation records, no matter how many times they are saved in different roles.
    There are two types of licenceholder in the problem domain, and the ILicenceHolder interface defines information and methods that are common to both. The PersonalLicenceHolder object represents one of these types of licenceholder, and is always a person, so this class extends Person and implements ILicenceHolder.
    The additional information and methods that are required by the second type of licenceholder are defined in the interface IPremisesLicenceHolder, which extends ILicenceHolder. Premises licence holders can either be people or organisations, so I have two objects to represent these - PremisesLicenceHolderPerson which implements IPremisesLicenceHolder and extends Person, and PremisesLicenceHolderOrganisation which implements IPremisesLicenceHolder and extends Organisation.
    The model is further complicated by the fact that any single Person may be both a PersonalLicenceHolder and a PremisesLicenceHolderPerson, and may be so several times over. In this case, the same basic Person information needs to be linked to several different sets of licenceholder information. In the same way, any single Organisation may be a PremisesLicenceHolderOrganisation several times over.
    Sorry this is complicated!
    My initial idea for the schemas is to have Person and Organisation tables containing the basic information with the primary keys person_id and organisation_id. The Person table would have a one-to-many relationship with both the PersonalLicenceHolder table (pk: personalLicenceHolder_id, fk: person_id), and the PremisesLicenceHolderPerson table (pk: premisesLicenceHolderPerson_id, fk: person_id). There would also be a one-to-many relationship between the Organisation table and the PremisesLicenceHolderOrganisation table (pk: premisesLicenceHolderOrganisation_id, fk: organisation_id).
    I am flexible as to the design of my schema though, as I am happy to adopt any that will facilitate the Toplink Mapping.
    Thanks for your help with this.

  • Where clause for TaskLOVVO on OTL Timecard

    Hi,
    Following is the customization on our OTL timecard layout(Projects and Payroll Layout):
    ->Extended TaskLOVVO and based on a value selected in TaskLOV, i am defaulting Hours type.
    The dynamic where clause for the TaskLOVO is taken care of by the below QUALIFIER_ATTRIBUTES(Same as seeded layout)
    QUALIFIER_ATTRIBUTE14 = "HxcCuiTaskProjectId|PROJECT|Y#HxcCuiTaskProjectNumber|PROJECT-DISPLAY|Y"
    QUALIFIER_ATTRIBUTE15 = "project_id = ::HxcCuiTaskProjectId#upper(project_number) = upper(::HxcCuiTaskProjectNumber)"
    But in some scenarios the dynamic layout is not getting appended to TaskLOVO and the query behind the TaskLOV is pulling too many records.
    This issue is happening on Fridays when around 15000 employees submit the timecards, as Friday is our deadline for Timecard submission.
    I have tried different scenarios to replicate this issue in test intances but I am not able to replicate it.
    Please suggest what could be the issue and why is the whereclause is not getting appended in some scenarios.
    Thank you

    Hi,
    Thank you for your reply.
    The whoole LDT file is more than 30000 characters, which is not allowed in the post, so I have included only the lines which have customization.
    FYI: This is a Projects and Payroll layout.
    Following is my LDT file:
    # $Header: hxczzhxclayt0093.ldt 120.0 2008/02/08 09:26:10 bbayragi noship $
    # dbdrv: exec fnd bin FNDLOAD bin &phase=dat+10 checkfile:~PROD:~PATH:~FILE &ui_apps 0 Y UPLOAD @HXC:patch/115/import/hxclaytlayoutsld.lct @~PROD:~PATH/~FILE
    LANGUAGE = "US"
    LDRCONFIG = "hxclaytlayoutsld.lct 120.0"
    #Source Database seed121
    #RELEASE_NAME 12.1.0
    # -- Begin Entity Definitions --
    BEGIN HXC_LAYOUT_COMPONENTS
    "Projects Details Alternate Timecard Layout - Project"
    OWNER = "ORACLE12.1.0"
    COMPONENT_VALUE = "PROJECT"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "HXC_TIMECARD_PROJECT"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "200"
    COMPONENT_DEFINITION = "LOV"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT = "Projects Details Alternate Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    LAST_UPDATE_DATE = "2004/05/24"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS
    "Projects Details Alternate Timecard Layout - Project"
    OWNER = "ORACLE12.1.0"
    QUALIFIER_ATTRIBUTE_CATEGORY = "LOV"
    QUALIFIER_ATTRIBUTE1 = "ProjectLOVVO"
    QUALIFIER_ATTRIBUTE2 = "N"
    QUALIFIER_ATTRIBUTE3 = "HXC_CUI_PROJECT_DETAILS_LOV"
    QUALIFIER_ATTRIBUTE4 = "809"
    QUALIFIER_ATTRIBUTE5 = "25"
    QUALIFIER_ATTRIBUTE6 = "HxcCuiProjectDetails|PROJECT-DISPLAY|CRITERIA|N|HxcCuiProjectId|PROJECT|RESULT|N|HxcCuiProjectDetails|PROJECT-DISPLAY|RESULT|N|HxcCuiProjectCoOrgId|LOCATION1|RESULT|N|HxcCuiProjectName|CNAME|RESULT|N"
    QUALIFIER_ATTRIBUTE8 = "ProjectDetails"
    QUALIFIER_ATTRIBUTE9 = "ProjectId#NUMBER"
    QUALIFIER_ATTRIBUTE10 = "oracle.apps.hxc.selfservice.timecard.server.ProjectLOVVO"
    QUALIFIER_ATTRIBUTE11 = "RESOURCE_IDENTIFIER_ID"
    QUALIFIER_ATTRIBUTE17 = "OraTableCellText"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "PROJECTS"
    QUALIFIER_ATTRIBUTE27 = "Attribute1"
    QUALIFIER_ATTRIBUTE28 = "PROJECT"
    LAST_UPDATE_DATE = "2004/05/24"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    BEGIN HXC_LAYOUT_COMPONENTS
    "Projects Details Alternate Timecard Layout - Task"
    OWNER = "ORACLE12.1.0"
    COMPONENT_VALUE = "TASK"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "HXC_TIMECARD_TASK"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "210"
    COMPONENT_DEFINITION = "LOV"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT = "Projects Details Alternate Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    LAST_UPDATE_DATE = "2004/05/24"
    BEGIN HXC_LAYOUT_COMP_PROMPTS "HxcCuiTaskProjectId" "AK_PROMPT"
    OWNER = "ORACLE12.1.0"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "HXC_TIMECARD_PROJECT"
    ATTRIBUTE_APP_SHORT_NAME = "HXC"
    LAST_UPDATE_DATE = "2004/05/24"
    END HXC_LAYOUT_COMP_PROMPTS
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS
    "Projects Details Alternate Timecard Layout - Task"
    OWNER = "ORACLE12.1.0"
    QUALIFIER_ATTRIBUTE_CATEGORY = "LOV"
    QUALIFIER_ATTRIBUTE1 = "TaskLOVVO"
    QUALIFIER_ATTRIBUTE2 = "N"
    QUALIFIER_ATTRIBUTE3 = "HXC_CUI_TASK_DETAILS_LOV"
    QUALIFIER_ATTRIBUTE4 = "809"
    QUALIFIER_ATTRIBUTE5 = "10"
    QUALIFIER_ATTRIBUTE6 = "HxcCuiTaskDetails|TASK-DISPLAY|CRITERIA|N|HxcCuiTaskProjectId|PROJECT|PASSIVE_CRITERIA|Y|HxcCuiTaskId|TASK|RESULT|N|HxcCuiTaskDetails|TASK-DISPLAY|RESULT|N|HxcCuiTaskBillableFlag|EXPTYPE|RESULT|N"
    QUALIFIER_ATTRIBUTE8 = "TaskDetails"
    QUALIFIER_ATTRIBUTE9 = "TaskId#NUMBER"
    QUALIFIER_ATTRIBUTE10 = "oracle.apps.hxc.selfservice.timecard.server.TaskLOVVO"
    QUALIFIER_ATTRIBUTE11 = "RESOURCE_IDENTIFIER_ID|TIMECARD_BIND_END_DATE"
    QUALIFIER_ATTRIBUTE14 = "HxcCuiTaskProjectId|PROJECT|Y#HxcCuiTaskProjectNumber|PROJECT-DISPLAY|Y"
    QUALIFIER_ATTRIBUTE15 = "project_id = ::HxcCuiTaskProjectId#upper(project_number) = upper(::HxcCuiTaskProjectNumber)"
    QUALIFIER_ATTRIBUTE17 = "OraTableCellText"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "PROJECTS"
    QUALIFIER_ATTRIBUTE27 = "Attribute2"
    QUALIFIER_ATTRIBUTE28 = "TASK"
    LAST_UPDATE_DATE = "2004/05/24"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    BEGIN HXC_LAYOUT_COMPONENTS
    "Projects Details Alternate Timecard Layout - Location"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "LOCATION"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "HXC_CUI_LOCATION_LABEL"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "215"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT = "Projects Details Alternate Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    LAST_UPDATE_DATE = "2004/05/24"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "Projects Details Alternate Timecard Layout - Location"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom2VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    # QUALIFIER_ATTRIBUTE5 = "10"
    # QUALIFIER_ATTRIBUTE8 = "DisplayValue"
    # QUALIFIER_ATTRIBUTE9 = "Value#NUMBER"
    QUALIFIER_ATTRIBUTE10 = "oracle.apps.hxc.selfservice.timecard.server.Custom2VO"
    QUALIFIER_ATTRIBUTE17 = "OraTableCellText"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Dummy Element Context"
    QUALIFIER_ATTRIBUTE27 = "Attribute15"
    QUALIFIER_ATTRIBUTE28 = "LOCATION1"
    LAST_UPDATE_DATE = "2004/05/24"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    BEGIN HXC_LAYOUT_COMPONENTS "Projects Details Alternate Timecard Layout - Expenditure Type"
    OWNER = "ORACLE"
    COMPONENT_VALUE = "EXPENDITURETYPE"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "HXC_TIMECARD_EXPTYPE"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "225"
    COMPONENT_DEFINITION = "PACKAGE_CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT = "Projects Details Alternate Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    LAST_UPDATE_DATE = "2004/05/23"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "Projects Details Alternate Timecard Layout - Expenditure Type"
    OWNER = "ORACLE"
    QUALIFIER_ATTRIBUTE_CATEGORY = "PACKAGE_CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "BOLINF.XXHXC_TYPE_CHOICE.EXPTTYPE"
    QUALIFIER_ATTRIBUTE2 = "@RESOURCE_IDENTIFIER_ID|@TIMECARD_BIND_END_DATE"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE8 = "aliasname"
    QUALIFIER_ATTRIBUTE9 = "value#NUMBER"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "R"
    QUALIFIER_ATTRIBUTE24 = "ET_EXPENDITURE_TYPE"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "OTL_ALIAS_1"
    QUALIFIER_ATTRIBUTE27 = "Attribute1"
    QUALIFIER_ATTRIBUTE28 = "EXPTYPE"
    LAST_UPDATE_DATE = "2004/05/24"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    BEGIN HXC_LAYOUT_COMPONENTS "Projects Details Alternate Timecard Layout - Customer name"
    OWNER = "ORACLE"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXTW_HXC_TIMECARD_CUST_NAME"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "205"
    COMPONENT_DEFINITION = "TEXT_FIELD"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT = "Projects Details Alternate Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    LAST_UPDATE_DATE = "2004/05/24"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "Projects Details Alternate Timecard Layout - Customer name"
    OWNER = "ORACLE"
    QUALIFIER_ATTRIBUTE_CATEGORY = "TEXT_FIELD"
    QUALIFIER_ATTRIBUTE1 = "N"
    QUALIFIER_ATTRIBUTE2 = "Y"
    QUALIFIER_ATTRIBUTE3 = "20"
    QUALIFIER_ATTRIBUTE4 = "1"
    QUALIFIER_ATTRIBUTE5 = "20"
    QUALIFIER_ATTRIBUTE7 = "OraTableCellText"
    QUALIFIER_ATTRIBUTE17 = "NONE"
    QUALIFIER_ATTRIBUTE20 = "Y"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "PROJECTS"
    QUALIFIER_ATTRIBUTE27 = "Attribute9"
    QUALIFIER_ATTRIBUTE28 = "CNAME"
    QUALIFIER_ATTRIBUTE30 = "Y"
    LAST_UPDATE_DATE = "2004/05/24"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    And the query in TASKLOVVO:
    SELECT task.task_number tasknumber, task.task_name, task_details taskdetails, task.task_id taskid, bolinf.GETALIASID(proj.project_type,proj.project_id,task.task_id, :1, :2) billable_flag, task.project_id, task.start_date, task.completion_date, task.chargeable_flag, proj.project_number , proj.project_details from pa_online_tasks_v task ,pa_online_projects_v proj where proj.project_id = task.project_id
    In the above query GETALIASID is a custom function that returns a value.
    Thank you
    Edited by: Santo on Mar 18, 2013 2:12 PM

  • How to change the fetch size for a one-to-many relationship

    With Toplink 10.1.3, since using scrollablecursor is a prerequisites for changing the fetchsize on a query (using the setFetchSize), I am wondering if it would be possible to change the fetchsize of the query which is associated to a one-to-many relationship.
    So, is this possible? How ?

    In TopLink 10.1.3 you can set the fetch-size on any query, it has nothing to do with using a ScrollableCursor.
    Example:
    readQuery.setFetchSize(100);
    To set the fetch size on a mapping query use,
    mapping.getSelectionQuery().setFetchSize(100);
    In 10.1.3 you can only set this in code, not currently through XML or the Mapping Workbench. In 10.1.3.1 you should be able to set the value through XML as well.

  • Help with multi-table mapping for one-to-many object inheritance

    Hi,
    I have posted on here before regarding this (Toplink mapping for one-to-many object inheritance but I am still having problems mapping my object model to my schema.
    Object model
    The Person and Organisation objects contain base information and have the primary keys person_id and organisation_id. It is important that there is no duplication of person and organisation records, no matter how many times they are saved in different roles.
    There are two types of licenceholder in the problem domain, and the ILicenceHolder interface defines information and methods that are common to both. The PersonalLicenceHolder object represents one of these types of licenceholder, and is always a person, so this class extends Person and implements ILicenceHolder.
    The additional information and methods that are required by the second type of licenceholder are defined in the interface IPremisesLicenceHolder, which extends ILicenceHolder. Premises licence holders can either be people or organisations, so I have two objects to represent these - PremisesLicenceHolderPerson which implements IPremisesLicenceHolder and extends Person, and PremisesLicenceHolderOrganisation which implements IPremisesLicenceHolder and extends Organisation.
    The model is further complicated by the fact that any single Person may be both a PersonalLicenceHolder and a PremisesLicenceHolderPerson, and may be so several times over. In this case, the same basic Person information needs to be linked to several different sets of licenceholder information. In the same way, any single Organisation may be a PremisesLicenceHolderOrganisation several times over.
    Sorry this is complicated!
    Schema
    I have Person and Organisation tables containing the basic information with the primary keys person_id and organisation_id.
    I have tried to follow Donald Smith's advice and have created a Role table to record the specialised information for the different types of licence holder. I want the foreign keys in this table to be licenceholder_id and licence_id. Licenceholder_id will reference either organisation_id or person_id, and licence_id will reference the primary key of the Licence table to link the licenceholder to the licence. Because I am struggling with the mapping, I have changed licenceholder_id to person_id in an attempt to get it working with the Person object before I try the Organisation.
    Then, when a new licenceholder is added, if the person/organisation is already in the database, a new record is created in the Role table linking the existing person/organisation to the existing licence rather than duplicating the person/organisation information.
    Mapping
    I am trying to use the toplink mapping workbench to map my PremisesLicenceHolderPerson object to my schema. I have mapped all inherited attributes to superclass (Person). The primary table that the attributes are mapped to is Person, and I have used the multi-table info tab to add Roles as an additional table and map the remaining attributes to that.
    I have created the references PERSON_ROLES which maps person.person_id to roles.person_id, ROLES_PERSON which maps roles.person_id to person.person_id and ROLES_LICENCE which maps roles.licence_id to licence.licence_id.
    I think I have put in all the relationships, but I cannot get rid of the error message "The following primary key fields are unmapped: PERSON_ID".
    Please can somebody tell me how to map this properly?
    Thank you.

    I'm not positive about your mappings, but it looks like the Person object should really have a 1:M or M:M mapping to the Licenceholder table. This then means that your object model should be similar, in that Person object could have many Licenses, instead of being LicenceHolders. From the looks of it, you have it set up from the LicenceHolder perspective. What could be done instead if a LicenceHolder could have a 1:1 reference to a person data object, rather than actually be a Person. This would allow the person data to be easily shared among licences.
    LicenceHolder1 has an entry in the LicenceHolder table and Person table. LicenceHolder2 also has entries in these tables, but uses the same entry in the Person table- essentially it is the same person/person_ID. If both are new objects, TopLink would try to insert the same person object into the Person table twice. I'm not sure how you have gotten around or are planning to get around this problem.
    Since you are using inheritance, it means that LicenceHolder needs a writable mapping to the person.person_id field- most commonly done through a direct to field mapping. From the description, it looks like roles.person_id is a foreign key in the multiple table mapping, meaning it would be set based on the value in the person.person_id field, but the person.person_id isn't actually mapped in the object. Check to make sure that the ID attribute LicenceHolder is inheriting from person hasn't been remapped in the LicenceHolder descriptor to a different field.
    Best Regards,
    Chris

  • How can I export a list of events for one of many calendars - e.g. "sailing" to use in Excel

    How can I export a list of events for one of many calendars - e.g. "sailing" to use in Excel?

    See this thread here
    Display number of emails by sender

  • One to many relationship leads to recursion?

    Hi,
    I've created a web services function which returns an object retrieved from a database using the persistence api (the class was generated by the Netbeans 5.5 "Entity Class from Database" feature.
    I can successfully return an object which has no foreign keys. However, when I try to retrieve an entity which is on either side of a 1:N relationship, I receive a stackOverflowError.
    Here's my sample schema (I'm using Derby bundled with SJAS 9 for testing)
    create table Address (
       Id int not null,
       StreetName varchar(255),
       City varchar(255),
       PostalCode varchar(255),
       Party int,
       primary key (Id)
    create table Party (
       Id int,
       Name varchar(255),
       primary key(Id)
    alter table Address add constraint foreign key (Party) references Party;So as you can see, one Party might have many addresses.
    I can retrieve either an Address or Party from the database using something like:
    em.createNamedQuery("Party.findById")
       .setParameter("id", 1)
       .getSingleResult();When I try to return it, I get a stackOverflowError in the server log. I'm using the default Toplink provider so enabling full logging on this, I can see the SQL.
    When retrieving an address, it selects all of the address fields and correctly binds the supplied Id value. It then performs a select on the Party table using the Address.Party value. This in turn causes it to attempt to retrieve an Address. After three queries, the error is thrown.
    I can't see why the above schema should cause this problem. Where an Address is requested, I would expect it to retrieve the address fields, including the value of the Party field but not the Party object itself. On the other hand. when a Party is retrieved, I would expect it to recurse through and return a collection of Address objects.
    Have I misunderstood this or am I missing some fundamental point about JAX-WS?
    Thanks for your help,
    -Phil

    You have to set both sides of the relations...
    for example to do this in a more seamless manner:
    public UserProfile
         public void addLog (UserActivityLog activity)
              logs.add (activity);
              if (!equals (activity.getUserProfile ()))
                   activity.setUserProfile (this);
    Now this is the most primitive of ways to maintain two sided relations.
    There are a lot of other patterns to get around this.
    If you want to set the UserActivityLog to a specific UserProfile without
    having a firm reference to ther UserProfile, you should get the object
    from the database/persistenceManager... as you are using application
    identity, you can do something like pm.getObjectById.
    JDO does not do magic references. If you set something to null, it will
    remain null until you set it.
    Srini wrote:
    Hi Guys
    I am trying to create a one to many relationship between 2 JDOs.
    UserProfile - User JDO having user info
    UserActivityLog - JDO having user log info
    UserProfile -- UserActivityLog
    1 many
    UserProfile - has a collection of UserActivityLog objects
    UserActivityLog - has a reference to UserProfile
    Qn 1:
    I created a UserProfile along with a collection of 2 UserActivityLog
    objects.
    Navigation:
    Now given a UserProfile object,i am able to get the UserActivityLog objects.
    But given a UserActivityLog object ,i get a NULL UserProfile object.
    Issues:
    Why this is happening???Do i need to set the reference for "UserProfile" in
    UserActivityLog before inserting???
    If so,then how do i add a UserActivityLog to an existing
    UserProfile???cos,if i create a UserActivityLog with reference to
    UserProfile ,then it will throw a Duplicate Key violation for UserProfile as
    it is already persisted in DB.
    It will be great if you can direct me to some one to many relationship
    examples already implemented.
    Thanks
    Srini
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

Maybe you are looking for

  • Ridiculous number of directories when build includes Report Generation Toolkit

    I was getting error 7 with the report generation toolkit, so I followed the steps here and it works. Only problem is, it makes a different support directory for each individual file in the NIReport.llb directory. The calendar and data directories are

  • Can't transfer video evn though video is in right format

    Ok i downloaded Videora and i transcoded my video and when i go 2 properties of the video it says its a avisynth script now. i open iTunes and i tryed 2 drag and drop the video and it had the little plus sign on the iPod and I released the mouse butt

  • Execution Statistics

    I was looking at some statistics from an ADDM report and the executions of the statement made me curious. When a Statspack (AWR in 10g) report is run are the executions of a particular statement accurate for the time frame for that report? Also If I

  • Re: Vista to XP questions for GeekSquad...

    I have a Gateway desktop Windows XP system with 2 internal CD drives and one external CD drive. I recently tried to copy files (drag and drop) to a CD on one of the internal drives and learned that the drive did not recognize that a disc was inserted

  • Minimum connection speeds 5508 controller and 2602E APs

                       We have an applicaiton that is sensitive to network speeds.  Is there a way to guarantee a minimum wireless network speed such as 100 MBs utilizing a 5508 controller and 2602e APs?