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 6695467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:13:31+00:00 2026-05-26T06:13:31+00:00

I have a JPA entity called ParentAccount that extends an abstract Account entity (see

  • 0

I have a JPA entity called ParentAccount that extends an abstract Account entity (see JPA inheritance). I have place the JSR-303 validation constraints in the Account entity.
Now I have the following Tapestry class and templates and JSR-303 validation does not seem to work:

Tapestry class:

 public class Inscription {        
    @Property
    //this is not validated...
    private ParentAccount parentAccount;

    @Property
    @Validate("required")
    private String accountPasswordConfirmation;    

    @InjectComponent
    private Form registrationForm;

    @OnEvent(EventConstants.PREPARE)
    void prepareAccount(){
        parentAccount = new ParentAccount();
    }

    @OnEvent(value= EventConstants.VALIDATE)
    void validateRegistrationForm() {
        if(registrationForm.isValid()) {
            if(accountPasswordConfirmation.equals(parentAccount.getAccountPassword())) {
                System.out.println("ok for insert");
            }
        }
    }
}

Tapestry page:

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
<head>
    <title>Hello World Page</title>
</head>
<body>
<form t:type="form" t:id="registrationForm" validate="this">
    <t:errors/>
    <div>
        <label t:type="label" for="accountEmailAddress"/>
        <input t:type="textfield" t:id="accountEmailAddress" value="parentAccount.accountEmailAddress"/>
    </div>
    <div>
        <label t:type="label" for="accountFirstName"/>
        <input t:type="textfield" t:id="accountFirstName" value="parentAccount.accountFirstName"/>
    </div>
    <div>
        <label t:type="label" for="accountLastName"/>
        <input t:type="textfield" t:id="accountLastName" value="parentAccount.accountLastName"/>
    </div>
    <div>
        <label t:type="label" for="accountPassword"/>
        <input t:type="textfield" t:id="accountPassword" value="parentAccount.accountPassword"/>
    </div>
    <div>
        <label t:type="label" for="accountPasswordConfirmation"/>
        <input t:type="textfield" t:id="accountPasswordConfirmation" value="accountPasswordConfirmation"/>
    </div>
    <div><input type="submit" value="ok"/></div>
</form>
</body>
</html>

Unfortunately, even though I have annotated the entity with @NotNull annotations, those JSR-303 constraints are ignored.

Can anyone please help?

Regards,

  • 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-26T06:13:31+00:00Added an answer on May 26, 2026 at 6:13 am

    I noticed that if I add a JSR-303 annotation to a property in the Tapestry class, it does get taken into account. Why then Tapestry won’t take into account the annotation when placed upon a property of a JPA entity??

    In Tapestry a Form is accociated by a ValidationTracker that tracks all the provided user input and validation errors for every field in the form.

    It seems the default ValidationTrackerImpl doesn’t care. You could provide your on tracker implementation via the Form’s tracker parameter. I did something similiar with Struts2 to have my entities validated.

    Maybe (hopefully) annotating your parentAccount with @Valid (graph validation as it is called in the JSR-303 specification) also works (provided Tapestry cares).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jpa entity inheritance hierarchy: abstract Account ChildminderAccount extends Account ParentAccount
I'm working with Hibernate and JPA. I have an entity called Customer that references
A have a JPA entity that has timestamp field and is distinguished by a
We have a project that uses JPA/Hibernate on the server side, the mapped entity
I have mapped class in JPA. : @Entity @Inheritance(strategy = InheritanceType.JOINED) public class User
I have a JPA Entity StatsEntity which has a composite primary key that is
I have a JPA entity class with a composite primary key (uid,lid) that in
I have a service that gets a JPA entity from outside code. In this
I have a java application which uses JPA. Say I have an entity called
I'm using Hibernate/JPA and have an @Entity object called Order, pointing at a MySQL

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.