Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[326] Integrate and modernize hyperjaxb3 plugin #331

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions basics/pom.xml-merge
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
</dependency>
<!-- Maven JAXB2 Plugin -->
<dependency>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>${maven-jaxb2-plugin.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import org.jvnet.jaxb2_commons.locator.ObjectLocator;
import org.w3c.dom.Node;

import java.math.BigDecimal;
import java.util.Objects;

public class ExtendedJAXBEqualsStrategy extends JAXBEqualsStrategy {

@Override
Expand All @@ -21,6 +24,11 @@ protected boolean equalsInternal(ObjectLocator leftLocator,
return equalsInternal(leftLocator, rightLocator,
(XMLGregorianCalendar) lhs, (XMLGregorianCalendar) rhs);

} else if (lhs instanceof BigDecimal
&& rhs instanceof BigDecimal) {
return equalsInternal(leftLocator, rightLocator,
(BigDecimal) lhs, (BigDecimal) rhs);

} else {
return super.equalsInternal(leftLocator, rightLocator, lhs, rhs);
}
Expand All @@ -34,11 +42,31 @@ protected boolean equalsInternal(ObjectLocator leftLocator,
.toGregorianCalendar().getTimeInMillis());
}

protected boolean equalsInternal(ObjectLocator leftLocator,
ObjectLocator rightLocator,
BigDecimal left,
BigDecimal right) {
if (Objects.equals(left, right)) {
return true;
}
if (left == null || right == null) {
return false;
}
return left.compareTo(right) == 0;
}

protected boolean equalsInternal(ObjectLocator leftLocator,
ObjectLocator rightLocator, Node lhs, Node rhs) {
final Diff diff = new Diff(new DOMSource((Node) lhs), new DOMSource(
(Node) rhs));
return diff.identical();
}
public static JAXBEqualsStrategy INSTANCE2 = new ExtendedJAXBEqualsStrategy();
@SuppressWarnings("deprecation")
public static EqualsStrategy INSTANCE = INSTANCE2;

public static JAXBEqualsStrategy getInstance() {
return INSTANCE2;
}

}
21 changes: 11 additions & 10 deletions hyperjaxb/dist/pom.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>hyperjaxb3-dist</artifactId>
<packaging>pom</packaging>
<name>Hyperjaxb3 Distribution</name>
<parent>
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>hyperjaxb3</artifactId>
<version>0.6.3-SNAPSHOT</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-parent</artifactId>
<version>2.0.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hyperjaxb3-dist</artifactId>
<packaging>pom</packaging>
<name>JAXB Tools :: Hyperjaxb3 :: Distribution</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down Expand Up @@ -105,4 +106,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 0 additions & 2 deletions hyperjaxb/ejb/.gitignore

This file was deleted.

This file was deleted.

13 changes: 7 additions & 6 deletions hyperjaxb/ejb/extensions/naming/custom-naming-pre_0_6_0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>hyperjaxb3-ejb-extensions-naming</artifactId>
<version>0.6.3-SNAPSHOT</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-extensions-naming</artifactId>
<version>2.0.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hyperjaxb3-ejb-extensions-custom-naming-pre_0_6_0</artifactId>
<packaging>jar</packaging>
<name>Hyperjaxb3 EJB Extensions Naming [custom-naming-pre_0_6_0]</name>
<name>JAXB Tools :: Hyperjaxb3 :: EJB :: Extensions :: Naming [custom-naming-pre_0_6_0]</name>

<dependencies>
<dependency>
<groupId>org.jvnet.hyperjaxb3</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-plugin</artifactId>
<!--version>${project.version}</version-->
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
10 changes: 6 additions & 4 deletions hyperjaxb/ejb/extensions/naming/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>hyperjaxb3-ejb-extensions</artifactId>
<version>0.6.3-SNAPSHOT</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-extensions</artifactId>
<version>2.0.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hyperjaxb3-ejb-extensions-naming</artifactId>
<packaging>pom</packaging>
<name>Hyperjaxb3 EJB Extensions Naming</name>
<name>JAXB Tools :: Hyperjaxb3 :: EJB :: Extensions :: Naming</name>

<modules>
<module>custom-naming-pre_0_6_0</module>
</modules>
Expand Down
10 changes: 6 additions & 4 deletions hyperjaxb/ejb/extensions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jvnet.hyperjaxb3</groupId>
<artifactId>hyperjaxb3-ejb</artifactId>
<version>0.6.3-SNAPSHOT</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb</artifactId>
<version>2.0.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hyperjaxb3-ejb-extensions</artifactId>
<packaging>pom</packaging>
<name>Hyperjaxb3 EJB Extensions</name>
<name>JAXB Tools :: Hyperjaxb3 :: EJB :: Extensions</name>

<modules>
<module>naming</module>
</modules>
Expand Down
4 changes: 0 additions & 4 deletions hyperjaxb/ejb/plugin/.gitignore

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions hyperjaxb/ejb/plugin/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions hyperjaxb/ejb/plugin/.settings/org.eclipse.m2e.core.prefs

This file was deleted.

51 changes: 31 additions & 20 deletions hyperjaxb/ejb/plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -1,48 +1,55 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>hyperjaxb3-ejb-plugin</artifactId>
<packaging>jar</packaging>
<name>Hyperjaxb3 EJB Plugin</name>
<parent>
<groupId>org.jvnet.hyperjaxb3</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb</artifactId>
<version>0.6.3-SNAPSHOT</version>
<version>2.0.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>hyperjaxb3-ejb-plugin</artifactId>
<packaging>jar</packaging>
<name>JAXB Tools :: Hyperjaxb3 :: EJB :: Plugin</name>

<dependencies>
<dependency>
<groupId>org.jvnet.annox</groupId>
<artifactId>annox</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-annox</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-basics-annotate</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb2-basics-tools</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.hyperjaxb3</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-roundtrip</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.hyperjaxb3</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-runtime</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.hyperjaxb3</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-schemas-persistence</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.hyperjaxb3</groupId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>hyperjaxb3-ejb-schemas-customizations</artifactId>
</dependency>

<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
Expand All @@ -58,6 +65,10 @@
<artifactId>jaxb-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>xsom</artifactId>
</dependency>
<!--dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
Expand All @@ -67,8 +78,8 @@
<artifactId>persistence-api</artifactId>
</dependency-->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -78,4 +89,4 @@
<build>
<defaultGoal>install</defaultGoal>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Array;

import org.jvnet.annox.model.XAnnotation;
import org.jvnet.annox.model.annotation.field.XAnnotationField;
import org.jvnet.annox.model.annotation.field.XArrayAnnotationField;
import org.jvnet.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.annox.model.annotation.value.XBooleanAnnotationValue;
import org.jvnet.annox.model.annotation.value.XEnumAnnotationValue;
import org.jvnet.annox.model.annotation.value.XIntAnnotationValue;
import org.jvnet.annox.model.annotation.value.XStringAnnotationValue;
import org.jvnet.annox.model.annotation.value.XXAnnotationAnnotationValue;
import org.jvnet.jaxb.annox.model.XAnnotation;
import org.jvnet.jaxb.annox.model.annotation.field.XAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.field.XArrayAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.value.XBooleanAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XEnumAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XIntAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XStringAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XXAnnotationAnnotationValue;

public class AnnotationUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import javax.persistence.QueryHint;
import javax.persistence.TemporalType;

import org.jvnet.annox.model.XAnnotation;
import org.jvnet.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.annox.model.annotation.value.XClassByNameAnnotationValue;
import org.jvnet.annox.model.annotation.value.XEnumAnnotationValue;
import org.jvnet.jaxb.annox.model.XAnnotation;
import org.jvnet.jaxb.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.value.XClassByNameAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XEnumAnnotationValue;
import org.jvnet.hyperjaxb3.annotation.util.AnnotationUtils;

import com.sun.java.xml.ns.persistence.orm.AssociationOverride;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jvnet.annox.model.XAnnotation;
import org.jvnet.jaxb.annox.model.XAnnotation;
import org.jvnet.hyperjaxb3.ejb.plugin.EjbPlugin;
import org.jvnet.hyperjaxb3.ejb.strategy.ignoring.Ignoring;
import org.jvnet.hyperjaxb3.ejb.strategy.mapping.Mapping;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.hyperjaxb3.ejb.strategy.annotate;

import org.jvnet.annox.model.annotation.value.XStringAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XStringAnnotationValue;
import org.jvnet.hyperjaxb3.xsd.util.StringUtils;

import com.sun.codemodel.JAnnotationArrayMember;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.hyperjaxb3.ejb.strategy.annotate;

import org.jvnet.annox.model.annotation.value.XStringAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XStringAnnotationValue;
import org.jvnet.hyperjaxb3.xsd.util.StringUtils;

import com.sun.codemodel.JAnnotationUse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.jvnet.hyperjaxb3.ejb.strategy.annotate;

import org.jvnet.annox.model.XAnnotationFieldVisitor;
import org.jvnet.annox.model.annotation.field.XArrayAnnotationField;
import org.jvnet.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.annox.model.annotation.value.XAnnotationValue;
import org.jvnet.jaxb.annox.model.XAnnotationFieldVisitor;
import org.jvnet.jaxb.annox.model.annotation.field.XArrayAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.value.XAnnotationValue;

import com.sun.codemodel.JAnnotationArrayMember;
import com.sun.codemodel.JAnnotationUse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.jvnet.hyperjaxb3.ejb.strategy.annotate;

import org.jvnet.annox.model.XAnnotationFieldVisitor;
import org.jvnet.jaxb.annox.model.XAnnotationFieldVisitor;

import com.sun.codemodel.JAnnotationUse;
import com.sun.codemodel.JCodeModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import javax.persistence.SqlResultSetMappings;
import javax.persistence.TemporalType;

import org.jvnet.annox.model.XAnnotation;
import org.jvnet.annox.model.annotation.field.XArrayAnnotationField;
import org.jvnet.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.annox.model.annotation.value.XClassByNameAnnotationValue;
import org.jvnet.annox.model.annotation.value.XEnumAnnotationValue;
import org.jvnet.jaxb.annox.model.XAnnotation;
import org.jvnet.jaxb.annox.model.annotation.field.XArrayAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.field.XSingleAnnotationField;
import org.jvnet.jaxb.annox.model.annotation.value.XClassByNameAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XEnumAnnotationValue;
import org.jvnet.hyperjaxb3.annotation.util.AnnotationUtils;

import com.sun.java.xml.ns.persistence.orm.AssociationOverride;
Expand Down
Loading