-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-11895 Support traversal of components in audit query API
- Loading branch information
Showing
42 changed files
with
1,121 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...ate-envers/src/main/java/org/hibernate/envers/internal/entities/ComponentDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* 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.envers.internal.entities; | ||
|
||
import org.hibernate.envers.configuration.internal.metadata.reader.ComponentAuditingData; | ||
import org.hibernate.envers.internal.entities.mapper.relation.MiddleIdData; | ||
|
||
/** | ||
* @author Felix Feisst (feisst dot felix at gmail dot com) | ||
*/ | ||
public class ComponentDescription { | ||
|
||
private final ComponentType type; | ||
private final String propertyName; | ||
private final String auditMiddleEntityName; | ||
private final MiddleIdData middleIdData; | ||
private final ComponentAuditingData auditingData; | ||
|
||
private ComponentDescription(ComponentType type, | ||
String propertyName, | ||
String auditMiddleEntityName, | ||
MiddleIdData middleIdData, | ||
ComponentAuditingData componentAuditingData) { | ||
this.type = type; | ||
this.propertyName = propertyName; | ||
this.auditMiddleEntityName = auditMiddleEntityName; | ||
this.middleIdData = middleIdData; | ||
this.auditingData = componentAuditingData; | ||
} | ||
|
||
public static ComponentDescription many(String propertyName, String auditMiddleEntityName, MiddleIdData middleIdData) { | ||
return new ComponentDescription( ComponentType.MANY, propertyName, auditMiddleEntityName, middleIdData, null ); | ||
} | ||
|
||
public static ComponentDescription one(String propertyName, ComponentAuditingData componentAuditingData) { | ||
return new ComponentDescription( ComponentType.ONE, propertyName, null, null, componentAuditingData ); | ||
} | ||
|
||
public ComponentType getType() { | ||
return type; | ||
} | ||
|
||
public String getPropertyName() { | ||
return propertyName; | ||
} | ||
|
||
public String getAuditMiddleEntityName() { | ||
return auditMiddleEntityName; | ||
} | ||
|
||
public MiddleIdData getMiddleIdData() { | ||
return middleIdData; | ||
} | ||
|
||
public ComponentAuditingData getAuditingData() { | ||
return auditingData; | ||
} | ||
|
||
public enum ComponentType { | ||
ONE, MANY | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.