Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3335926
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:04:29+00:00 2026-05-18T00:04:29+00:00

How does Seam Framework handle composite primary keys in pages.xml using EntityHome? The usual

  • 0

How does Seam Framework handle composite primary keys in pages.xml using EntityHome?

The usual approach is to assign an ID to entityHome components, like:

<page view-id="/team-list.xhtml">
  <param name="club" value="#{clubHome.id}" converterId="javax.faces.Integer" validatorId="javax.faces.LongRange" />
</page>

This assigns the (atomic) ID to clubHome from the URL

http://&#8230;?club=12345…

but what’s the technique to apply for entities using composite primary keys? Here the key is composed of (roundId, ordinalNumber), giving a URL

http://&#8230;?round=143&group=1…

<page view-id="/standings.xhtml">
  <param name="group" value="#{groupHome.setId(new GroupId(round???, group???))}" />
</page>

The above is a non-working attempt to assign a new composite ID to groupHome. The problem here is how to reference the URL params. (Is there a way to create temp vars in pages.xml?)

Other than that, I see no other way but to assign the atomic PK properties to member variables in one or several different EntityHome components, of course requiring EntityHome subclasses with resprective getters and setters:

@Name("groupHome")
public class GroupHome extends EntityHome<Group>
{
    // temp var
    private Integer ordinalNumber;

    public void setOrdinalNumber(Integer ordinalNumber)
    {
        this.ordinalNumber = ordinalNumber;
    }

    public Integer getOrdinalNumber()
    {
        return ordinalNumber;
    }

}

Used as following from pages.xml:

<page view-id="/standings.xhtml">
  <param name="round" value="#{roundHome.id}" />
  <param name="group" value="#{groupHome.ordinalNumber}" />
</page>

So, what’s the best practice here? I can neither find any examples using composite primary keys in “Seam in Action” nor in/on the net.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:04:30+00:00Added an answer on May 18, 2026 at 12:04 am

    You can use the following

    Mark your GroupId as @Scope(ScopeType.EVENT)

    @Name("groupId")
    @Scope(ScopeType.EVENT)
    @AutoCreate
    public class GroupId implements Serializable {
    
        private Integer id;
        private Integer ordinalNumber;
    
    }
    

    Set up your page as

    <page view-id="/standings.xhtml">
        <param name="round" value="#{groupId.id}" />
        <param name="group" value="#{groupId.ordinalNumber}"/>
        <action execute="#{groupHome.setId(groupId)}"/>
    </page>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know if I can inject value from pages.xml into a Seam component?
I have a website developed using Java EE and the Seam Framework. We are
Does Seam support multiple persistence units in its configuration? Also, when would you want
I created an application using seam-gen. The created operation to search the DB ends
Does anybody know when Seam 3 will officially be out?
I'm using seam to develop a simple web app. Using a4j commandButton in many
I'd like to be able to make an Ajax call using JSF/Seam/RichFaces and have
I have a jboss seam 2.2.2 project and it is my first time using
I am using Jetty 7 with JBoss Seam and have 2 Java Mail Sessions
I am trying a simple thing in Seam using rich faces. i am displaying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.