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

  • Home
  • SEARCH
  • 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 8626815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:07:21+00:00 2026-06-12T08:07:21+00:00

I have a table called RR. In which there will be two sets of

  • 0

I have a table called RR. In which there will be two sets of values. My table is

CREATE TABLE "TSL_RR_CONFIGURATION"
  (
    "ID"                       NUMBER(19,0),
    "TRK_TYPE"                 VARCHAR2(2 BYTE),
    "MEASURE_SYSTEM"           VARCHAR2(1 BYTE),
    "MIN_LENGTH"               NUMBER,
    "MAX_LENGTH"               NUMBER,
    "MIN_WIDTH"                NUMBER,
    "MAX_WIDTH"                NUMBER,
    "MIN_HEIGHT"               NUMBER,
    "MAX_HEIGHT"               NUMBER,
    "MIN_WEIGHT"               NUMBER,
    "MAX_WEIGHT"               NUMBER,
    "LOCATION_ID"              NUMBER(19,0),
    "IDX"                      NUMBER DEFAULT 0,
    "INSERTTIME" TIMESTAMP (6),
    "UPDATETIME" TIMESTAMP (6),
    CONSTRAINT "TSL_RR_CONFIGURATION_LOCA_FK1" FOREIGN KEY ("LOCATION_ID") REFERENCES "LOCATION" ("ID") ENABLE
  )

Using Hibernate One-to-many relation:following is my code to map the list

<list name="revRecov" table="TSL_RR_CONFIGURATION" cascade="all" access="field">
            <key column="LOCATION_ID"  />
            <index column="idx" />
            <one-to-many class="RevRecovery" />
        </list>

using spring form tags to show in a JSP form:

    <c:forEach items="${location.revRecov}" var="item" varStatus="loop">
                <c:choose>          
                    <c:when test="${measureSys}">
                     <tr> <td><form:input path="revRecov[${loop.index}].trkType" /></td></tr>
                        <tr>
                            <td>Max Length: 
                                <form:input path="revRecov[${loop.index}].maxLength" size="15" maxlength="14" />inches</td>
                            <td>Min Length: 
                                <form:input path="revRecov[${loop.index}].minLength" size="15" maxlength="14" />inches</td> 
                            </tr>
                             </c:when>
                             <c:otherwise>
                              <tr> <td><form:input path="revRecov[${loop.index}].trkType" /></td></tr>
                      <tr><td>Max Length: 
                       <form:input path="revRecov[${loop.index}].maxLength" size="15" maxlength="14" />cm</td>
                      <td>Min Length: 
                      <form:input path="revRecov[${loop.index}].minLength" size="15" maxlength="14" />cm</td></tr>
                   </c:otherwise>
                 </c:choose>
     </c:foreach>

Using <c:when test> tag to show the values either in inches or cm. My list has values something like

"97" "120" "5"
"12" "400" "1"

if it is 97, I have to show a label as Package and for 12, I should have pallet. Even when I validate it will be problem because, both the rows will be having different set of Max and Min values.

So, I was thinking, If I can make that list into two different lists and then pass it to JSP, I can validate as well.

What will be the best scenario to achieve it?If I divide into twolists is it going to be an issue when I save them to database?

Any suggestion is greatly appreciated?

EDITED: In my case it solves the issue of different sets in the JSP, but it still remains validating an issue and what if I have more then 2 rows, I cannot use the index to show them in JSP for all the rows.

  • 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-06-12T08:07:23+00:00Added an answer on June 12, 2026 at 8:07 am

    SOLVED: I can use the index of the row to show as different sets in the JSP
    Instead of this: <form:input path="revRecov[${loop.index}].maxLength" size="15" maxlength="14" />inches</td>

    used this:

    <form:input path="revRecov[0].maxLength" size="15" maxlength="14" />inches</td>
    <form:input path="revRecov[1].maxLength" size="15" maxlength="14" />inches</td>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a table called propAmenities which holds two column amenity_id and property_id basically
I have a main table called M1 which consists of Ids of three individual
I have a table called tester which I need to overlay with a temporary
I have a table called restaurants which contains each restaurant information, I want to
I have a table called Tournaments which is created using the EF code first
I have a table called Person which I have already mapped in hibernate I
I have a table called Town which holds a relation between player and a
I have a table called order which contains columns id , user_id , price
Let's say I have a table called Users which represents registered users of a
I have a table called TPM_TASKS which contain all tasks, as well as a

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.