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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:41:29+00:00 2026-05-17T01:41:29+00:00

I use Hyperjaxb3 to generate JPA entities from XSD schema. I have a xsd:string

  • 0

I use Hyperjaxb3 to generate JPA entities from XSD schema. I have a xsd:string type that I want to use for description text (text area in the UI):

<xsd:complexType name="Description">
    <xsd:simpleContent>
        <xsd:extension base="**xsd:string**">
            <xsd:attribute name="abc" type="xsd:NCName" use="optional" />
        </xsd:extension>
    </xsd:simpleContent>
</xsd:complexType>

Hyperjaxb3 generates class (entity) Description with attribute value, annotated like this:

@Basic
@Column(name = "VALUE_", **length = 255**)
public String getValue() {
    return value;
}

The questions I have:

I saw that if I put xsd:maxLength restriction on xsd:simpleType, JPA @Column.length has the value of maxLength. How can I set xsd:rescriction on xsd:simpleContent that is xsd:extension of xsd:string? Do I have to define a complexType with xsd:resctriction that I will extend? And if yes, will Hyperjaxb generate @Column.length by my restriction. I tried following:

   <xsd:simpleType name="DescriptionParent">
  <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4096" />
  </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="Description">
        <xsd:simpleContent>
            <xsd:extension base="DescriptionParent">
                <xsd:attribute name="abc" type="xsd:NCName" use="optional" />
            </xsd:extension>
        </xsd:simpleContent>
    </xsd:complexType>

But the JPA column length is still 255.

Is it also possible to set in my JAXB customization (*.xjb file) the lenght of the column for given type (somehow let hyperjaxb know that this is the orm I want to use for my specific type)? Or is it totally out of the way and xsd:maxLength should be used (above) I managed to set it globally for Hyperjaxb customization:

Thanks for your help.

  • 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-17T01:41:29+00:00Added an answer on May 17, 2026 at 1:41 am

    Second question: yes, you can configure global type mappings for simple types.

    See Per-type customization for single properties.

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

Sidebar

Related Questions

I'm trying to use Hyperjaxb3 with Apache CXF to generate persistence annotations from a
We use a data acquisition card to take readings from a device that increases
use case example I have a servlet that is receiving login requests. If a
Use case: 3rd party application wants to programatically monitor a text file being generated
We use QuickBooks for financial management, and feed it from a variety of sources.
use javascript or other method ? have any recommendation?
I use code belows for dump a specific schema, before dumped it has 4
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
Use case: A does something on his box and gots stuck. He asks B
I use Firebug and the Mozilla JS console heavily, but every now and then

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.