Skip to content

Commit d146ee5

Browse files
sebersoledreab8
authored andcommitted
HHH-17377 - Migrate to JPA 3.2
https://hibernate.atlassian.net/browse/HHH-17377 XJB changes (JAXB "binding model")
1 parent 2ef8524 commit d146ee5

20 files changed

+329
-32
lines changed

hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/spi/JaxbPluralAttribute.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,14 @@ public interface JaxbPluralAttribute extends JaxbPersistentAttribute, JaxbLockab
6767
void setMapKeyForeignKey(JaxbForeignKeyImpl value);
6868

6969
List<JaxbHbmFilterImpl> getFilters();
70+
71+
@Override
72+
default Boolean isOptional() {
73+
return null;
74+
}
75+
76+
@Override
77+
default void setOptional(Boolean optional) {
78+
79+
}
7080
}

hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/spi/JaxbStandardAttribute.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
public interface JaxbStandardAttribute extends JaxbPersistentAttribute {
1818
FetchType getFetch();
1919
void setFetch(FetchType value);
20+
21+
Boolean isOptional();
22+
void setOptional(Boolean optional);
2023
}

hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/spi/JaxbTableMapping.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/spi/JaxbCheckConstraint.java renamed to hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/spi/db/JaxbCheckConstraint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Hibernate, Relational Persistence for Idiomatic Java
33
*
44
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5-
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
66
*/
7-
package org.hibernate.boot.jaxb.mapping.spi;
7+
package org.hibernate.boot.jaxb.mapping.spi.db;
88

99
/**
1010
* @author Steve Ebersole
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
6+
*/
7+
package org.hibernate.boot.jaxb.mapping.spi.db;
8+
9+
import java.util.List;
10+
11+
import org.hibernate.boot.jaxb.mapping.spi.JaxbCheckConstraintImpl;
12+
13+
/**
14+
* @author Steve Ebersole
15+
*/
16+
public interface JaxbCheckable {
17+
18+
List<JaxbCheckConstraintImpl> getCheckConstraints();
19+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
6+
*/
7+
package org.hibernate.boot.jaxb.mapping.spi.db;
8+
9+
/**
10+
* Base definition for XSD column mappings
11+
*
12+
* @author Steve Ebersole
13+
*/
14+
public interface JaxbColumn extends JaxbDatabaseObject {
15+
String getName();
16+
17+
default String getTable() {
18+
return null;
19+
}
20+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
6+
*/
7+
package org.hibernate.boot.jaxb.mapping.spi.db;
8+
9+
import java.util.Collections;
10+
import java.util.List;
11+
12+
import org.hibernate.boot.jaxb.mapping.spi.JaxbCheckConstraintImpl;
13+
14+
/**
15+
* Composition of the aspects of column definition most commonly exposed in XSD "column types"
16+
*
17+
* @author Steve Ebersole
18+
*/
19+
public interface JaxbColumnCommon
20+
extends JaxbColumn, JaxbColumnMutable, JaxbCheckable, JaxbColumnNullable, JaxbColumnUniqueable, JaxbColumnDefinable, JaxbCommentable {
21+
@Override
22+
default String getTable() {
23+
return null;
24+
}
25+
26+
@Override
27+
default Boolean isNullable() {
28+
return null;
29+
}
30+
31+
@Override
32+
default Boolean isInsertable() {
33+
return null;
34+
}
35+
36+
@Override
37+
default Boolean isUpdatable() {
38+
return null;
39+
}
40+
41+
@Override
42+
default String getComment() {
43+
return null;
44+
}
45+
46+
@Override
47+
default Boolean isUnique() {
48+
return null;
49+
}
50+
51+
@Override
52+
default List<JaxbCheckConstraintImpl> getCheckConstraints() {
53+
return Collections.emptyList();
54+
}
55+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
6+
*/
7+
package org.hibernate.boot.jaxb.mapping.spi.db;
8+
9+
/**
10+
* @author Steve Ebersole
11+
*/
12+
public interface JaxbColumnDefaultable extends JaxbColumn {
13+
String getDefault();
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
6+
*/
7+
package org.hibernate.boot.jaxb.mapping.spi.db;
8+
9+
/**
10+
* @author Steve Ebersole
11+
*/
12+
public interface JaxbColumnDefinable extends JaxbColumn {
13+
String getColumnDefinition();
14+
String getOptions();
15+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html.
6+
*/
7+
package org.hibernate.boot.jaxb.mapping.spi.db;
8+
9+
import org.hibernate.boot.jaxb.mapping.spi.JaxbForeignKeyImpl;
10+
11+
/**
12+
* Composition of the aspects of column definition for join "column types" exposed in XSD
13+
*
14+
* @author Steve Ebersole
15+
*/
16+
public interface JaxbColumnJoined extends JaxbColumnCommon {
17+
String getReferencedColumnName();
18+
JaxbForeignKeyImpl getForeignKey();
19+
}

0 commit comments

Comments
 (0)