Skip to content

Commit

Permalink
HHH-17377 - Migrate to JPA 3.2
Browse files Browse the repository at this point in the history
https://hibernate.atlassian.net/browse/HHH-17377

XJB changes (JAXB "binding model")
  • Loading branch information
sebersole committed Nov 18, 2023
1 parent 957bdca commit 551dde5
Show file tree
Hide file tree
Showing 20 changed files with 329 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,14 @@ public interface JaxbPluralAttribute extends JaxbPersistentAttribute, JaxbLockab
void setMapKeyForeignKey(JaxbForeignKeyImpl value);

List<JaxbHbmFilterImpl> getFilters();

@Override
default Boolean isOptional() {
return null;
}

@Override
default void setOptional(Boolean optional) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@
public interface JaxbStandardAttribute extends JaxbPersistentAttribute {
FetchType getFetch();
void setFetch(FetchType value);

Boolean isOptional();
void setOptional(Boolean optional);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi;
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

import java.util.List;

import org.hibernate.boot.jaxb.mapping.spi.JaxbCheckConstraintImpl;

/**
* @author Steve Ebersole
*/
public interface JaxbCheckable {

List<JaxbCheckConstraintImpl> getCheckConstraints();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* Base definition for XSD column mappings
*
* @author Steve Ebersole
*/
public interface JaxbColumn extends JaxbDatabaseObject {
String getName();

default String getTable() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

import java.util.Collections;
import java.util.List;

import org.hibernate.boot.jaxb.mapping.spi.JaxbCheckConstraintImpl;

/**
* Composition of the aspects of column definition most commonly exposed in XSD "column types"
*
* @author Steve Ebersole
*/
public interface JaxbColumnCommon
extends JaxbColumn, JaxbColumnMutable, JaxbCheckable, JaxbColumnNullable, JaxbColumnUniqueable, JaxbColumnDefinable, JaxbCommentable {
@Override
default String getTable() {
return null;
}

@Override
default Boolean isNullable() {
return null;
}

@Override
default Boolean isInsertable() {
return null;
}

@Override
default Boolean isUpdatable() {
return null;
}

@Override
default String getComment() {
return null;
}

@Override
default Boolean isUnique() {
return null;
}

@Override
default List<JaxbCheckConstraintImpl> getCheckConstraints() {
return Collections.emptyList();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
*/
public interface JaxbColumnDefaultable extends JaxbColumn {
String getDefault();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
*/
public interface JaxbColumnDefinable extends JaxbColumn {
String getColumnDefinition();
String getOptions();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

import org.hibernate.boot.jaxb.mapping.spi.JaxbForeignKeyImpl;

/**
* Composition of the aspects of column definition for join "column types" exposed in XSD
*
* @author Steve Ebersole
*/
public interface JaxbColumnJoined extends JaxbColumnCommon {
String getReferencedColumnName();
JaxbForeignKeyImpl getForeignKey();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
*/
public interface JaxbColumnMutable extends JaxbColumn {
Boolean isInsertable();
Boolean isUpdatable();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
*/
public interface JaxbColumnNullable extends JaxbColumn {

Boolean isNullable();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
*/
public interface JaxbColumnSizable extends JaxbColumn {
Integer getLength();

default Integer getPrecision() {
return null;
}

default Integer getScale() {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* Composition of the aspects of column definition for standard "column types" exposed in XSD
*
* @author Steve Ebersole
*/
public interface JaxbColumnStandard
extends JaxbColumn, JaxbColumnMutable, JaxbCheckable, JaxbColumnNullable, JaxbColumnUniqueable,
JaxbColumnDefinable, JaxbColumnSizable, JaxbColumnDefaultable, JaxbCommentable {

String getRead();
String getWrite();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
*/
public interface JaxbColumnUniqueable extends JaxbColumn {
Boolean isUnique();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* @author Steve Ebersole
*/
public interface JaxbCommentable {
String getComment();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

/**
* Marker interface for database objects
*
* @author Steve Ebersole
*/
public interface JaxbDatabaseObject {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
*/
package org.hibernate.boot.jaxb.mapping.spi.db;

import org.hibernate.boot.jaxb.mapping.spi.JaxbSchemaAware;
import org.hibernate.boot.jaxb.mapping.spi.db.JaxbCheckable;
import org.hibernate.boot.jaxb.mapping.spi.db.JaxbDatabaseObject;

/**
* @author Steve Ebersole
*/
public interface JaxbTableMapping extends JaxbSchemaAware, JaxbCheckable, JaxbDatabaseObject {
String getComment();
String getOptions();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,7 @@
<xsd:attribute name="attribute-accessor" type="xsd:string" />
<xsd:attribute name="fetch" type="orm:fetch-type"/>
<xsd:attribute name="fetch-mode" type="orm:singular-fetch-mode"/>
<xsd:attribute name="optional" type="xsd:boolean"/>
<xsd:attribute name="optimistic-lock" type="xsd:boolean" default="true" />
</xsd:complexType>

Expand All @@ -3097,7 +3098,7 @@
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="type" type="xsd:string" minOccurs="0"/>
<xsd:element name="type" type="orm:discriminator-type" minOccurs="0"/>
<xsd:element name="column" type="orm:column" minOccurs="0"/>
<xsd:element name="mapping" type="orm:any-discriminator-value-mapping" maxOccurs="unbounded" />
</xsd:sequence>
Expand Down

0 comments on commit 551dde5

Please sign in to comment.