hyperjaxb3 | Hyperjaxb3 provides relational persistence for JAXB objects | SQL Database library
kandi X-RAY | hyperjaxb3 Summary
kandi X-RAY | hyperjaxb3 Summary
Hyperjaxb3 provides relational persistence for JAXB objects.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build embeddable attributes
- Checks if the field outline is complex
- Get attribute mapping
- Process a class outline
- Checks if the field outline is complex
- Get attribute mapping
- Returns a list of customizations tag names
- Generate roundtrip test class
- Generate class body
- Create association override map
- Create the embedded mapping for the given field outline
- Process a collection of properties
- Create a collection of PropertyInfos
- Create a temporal type
- Log options
- Checks if field outline is ignored
- Process the field outline
- Process the given property info
- Gets the command line arguments
- Returns a collection of elements
- Retrieves the id information
- Returns a collection of properties
- Process a CProperty
- Returns the collection of properties
- Process a property
- On reference property
- Create the attribute override
- Retrieves a collection of properties
hyperjaxb3 Key Features
hyperjaxb3 Examples and Code Snippets
Community Discussions
Trending Discussions on hyperjaxb3
QUESTION
I'm converting an XSD schema to a Java annotated bean for Hibernate with HyperJaxb3.
So far I managed to generate the Java objects, but I need to customize the remark field of the OperableType because the default generated length is 255 and I need to extend it to 4000.
Here's the fragment of the relevent xsd schema:
...ANSWER
Answered 2019-Mar-11 at 09:43After asking from help from the source, https://github.com/highsource/hyperjaxb3/issues/54, I have the answer:
QUESTION
This is my first attempt of using Hyperjaxb3. I have a snippet of my 2 XSD as shown below
ContractFullInfo.xsd
...
ANSWER
Answered 2018-Dec-11 at 20:15Your classes are not the same as you have two different complex types in your schema. They also probably reference different PersonRoleType
s, but it's hard to say without seeing your complete schemas.
While it's not impossible to map these complex types onto the same Java class, I won't do it. These are distinct types in your schemas, you should keep them distinct in Java as well.
Since you get a problem with classes having the same local name, the easiest solution would be to rename one of them. Use a binding like:
QUESTION
I just want to have a property of an Entity as Transient. The older documentation[1] of HyperJaxb seems unavailable and the one on Github[2]did not help me.
I tried to use embeddable/embeddable attributes and generated-id constructs with no success.
I have a model as follows and I want to have lastActivityTime as Transient in the generated class. The current annotation of this field is one my unsuccessful attempts.
...ANSWER
Answered 2018-Apr-02 at 15:06Simply annotate it with . The property will be annotated with
@Transient
.
QUESTION
We have a significant code base that utilizes Hyperjaxb3 to annotate Java classes that are generated using xjc (along with other xjc plugins, including one that is home-grown).
We are in the process of trying to upgrade from Hyperjaxb3 0.5.6 to 0.6.2, but have run into a significant issue with an apparent naming strategy change between these versions.
Specifically, where a complexType name like "OneTwo" results in a table name "ONETWO" in 0.5.6, whereas in 0.6.2 the table name is "ONE_TWO". Same for column names.
We have a very strong preference to NOT refactor hundreds of queries to accommodate such a naming change (although the newer, more traditional SQL naming certainly makes sense - we wish it had been the default behavior when this project started six years ago).
Is there an easy way to switch to the old naming strategy? Failing that, can you provide details on exactly how to extend Hyperjaxb3 with a custom naming strategy?
Having looked at this test or this one, it is not clear to us exactly what we need to do to our pom to specify a different naming strategy class, and the Extension Guide is currently empty.
...ANSWER
Answered 2018-Jan-13 at 16:54Author of HJ3 here.
Take a look at thes custom-naming test project. It implements and configures a custom naming strategy.
The solution consists of two parts: implementation of the naming strategy and configuration of this implementation.
You naming implementation must implement the org.jvnet.hyperjaxb3.ejb.strategy.naming.Naming
interface. The easiest would be to inherit from org.jvnet.hyperjaxb3.ejb.strategy.naming.impl.DefaultNaming
.
To configure you have to create a resource /org/jvnet/hyperjaxb3/ejb/plugin/custom/applicationContext.xml
which is basically a Spring XML configuration. There, define a bean with the name naming
:
QUESTION
I'm using maven-hyperjaxb3-plugin (0.6.1) to generate domain classes from my xsd file. Everything works very well except for one class, and even that works fine until I add more than 23 fields onto it.
Once I exceed that number of fields it generates two classes for my table named ILT: one is called ILT.java and one is called ILTRestItem.java, which I assume is something to do with using these classes with a REST API (something I don't plan to do).
The ILTRestItem class has compile errors. It does a lot of calls to XmlAdapterUtils.unmarshallJAXBElement and the error message is:
The method marshallJAXBElement(Class, QName, Class, BoundType) in the type XmlAdapterUtils is not applicable for the arguments (Class, QName, Class, String)
I am not actually too worried about that error because I would rather it just didn't create the ILTRestItem class at all. The other (smaller) classes work fine and my goal is for ILT to do the same thing.
If I run the jaxb2 plugin (maven-jaxb2-plugin) and use that to generate the classes there is no ILTRestItem generated and the classes are the right ones, but they are, of course, missing the JPA annotations. That leads me to suspect that Hyperjaxb3 is responsible for generating the ILTRestItem class, but I've looked through the source code hoping to see classes with something like 'RestItem' in them and there aren't any.
One relevant point is that I am using single table inheritance here. The ILT class and another class (IFT) use the same underlying table (Transaction) and they both extend the Transaction class. If I detach ILT from Transaction and make it a non-inherited class the ILTRestItem no longer generates.
Lots of searches of both JAXB2 and HyperJaxb3 and I don't find any reference to RestItem or just why it is generated (or which of them does it). My hope is there is some config switch to turn off RestItem generation but so far I can't see it.
For completeness I should add I tried switching out different fields to see if one of them was the trigger for this behaviour and it isn't. It really seems to be the number of fields, or possibly the total length of the record.
Also: JPA 2.1 and the relevant maven fragment is:
...ANSWER
Answered 2017-Mar-07 at 00:21Funny how once you put in a question here the answer turns up in the next 30 minutes. Sort of anyway. The problem I had was triggered by my having defined the same field in the ILT class (the one generating the ILTRestItem) and the Transaction class (the one it inherits from). Quite reasonably it was trying to split that out into a separate table and do a join. When I removed that field from ILT the problem vanished. I'm not sure how I missed that it was being cause by a particular field, I think I may have come to that conclusion before I upgraded to the latest version.
QUESTION
I have a fairly complex XML schema and I use hyperjaxb3 to generate pojo's with annotations for. There are times when I have the parent object and would like to check the value of a child object that may be 8 or 9 children deep. Is there anyway to use jaxb, or another tool, to get a list of child objects of a specific class based on jaxb annotations?
I could write a recursive function to search all children for an instance of a class but that would be less than ideal. Any advise would be appreciated, thanks.
...ANSWER
Answered 2017-Jan-20 at 01:59You don't have to write the code to walk the object tree yourself — there are a few out there already (jdereg's java-util for example), and the JAXBIntrospector
will find objects annotated with XmlRootElement
for you. There would be a little more work required if you're looking for other annotations, but not much.
For example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hyperjaxb3
You can use hyperjaxb3 like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the hyperjaxb3 component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page