Skip to content

Commit

Permalink
Introduce VirtualIdEmbeddable and IdClassEmbeddable + instantiators
Browse files Browse the repository at this point in the history
More clean-up (Tuplizers!!)

Mostly EntityTuplizer in this commit

Still need to
  - integrate EmbeddableInstantiator work
  - integrate embedded forms.  `VirtualIdEmbeddable` does not really need it as it can use the id-mapping itself as the embedded form.  But `IdClassEmbedded` should really be integrated
  - integrate `VirtualKeyEmbeddable` and `VirtualKeyEmbedded` for use as inverse composite fks
  - share `#finishInit` handling for `EmbeddableMappingType`, `VirtualIdEmbeddable` and `IdClassEmbeddable`
  • Loading branch information
sebersole committed Dec 1, 2021
1 parent bb2b0a6 commit d506bb3
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 458 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
* @apiNote Like ManagedTypeRepresentationStrategy itself, incubating because we
* currently need to differentiate between strategy for entity/mapped-superclass
* versus strategy for embeddables
*
* @author Steve Ebersole
*/
@Incubating
public interface ManagedTypeRepresentationResolver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* both IdentifiableType and EmbeddableType types but that requires (planned)
* changes to the Hibernate type system that will not happen until a later date
*
* @author Steve Ebersole
* @see ManagedTypeRepresentationResolver
*/
@Incubating
public interface ManagedTypeRepresentationStrategy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
/**
* Contract for implementors responsible for instantiating entity/component instances.
*
* @author Steve Ebersole
* @deprecated (as of 6.0) This contract is no longer used by Hibernate. Implement/use
* {@link org.hibernate.metamodel.spi.Instantiator} instead. See
* {@link org.hibernate.metamodel.spi.ManagedTypeRepresentationStrategy}
*/
@Deprecated
public interface Instantiator extends Serializable {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import org.hibernate.mapping.Component;
/**
* Defines a POJO-based instantiator for use from the tuplizers.
*
* @deprecated (as of 6.0) Like {@link Instantiator} itself, deprecated.
*/
@Deprecated
public class PojoInstantiator implements Instantiator, Serializable {
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( PojoInstantiator.class.getName() );

Expand All @@ -30,6 +33,10 @@ public class PojoInstantiator implements Instantiator, Serializable {
private final boolean embeddedIdentifier;
private final boolean isAbstract;

/**
* @deprecated (as of 6.0) See {@link PojoInstantiator}
*/
@Deprecated
public PojoInstantiator(
Class mappedClass,
ReflectionOptimizer.InstantiationOptimizer optimizer,
Expand All @@ -48,10 +55,18 @@ public PojoInstantiator(
}
}

/**
* @deprecated (as of 6.0) See {@link PojoInstantiator}
*/
@Deprecated
public PojoInstantiator(Component component, ReflectionOptimizer.InstantiationOptimizer optimizer) {
this( component.getComponentClass(), optimizer );
}

/**
* @deprecated (as of 6.0) See {@link PojoInstantiator}
*/
@Deprecated
public PojoInstantiator(Class componentClass, ReflectionOptimizer.InstantiationOptimizer optimizer) {
this.mappedClass = componentClass;
this.isAbstract = ReflectHelper.isAbstractClass( mappedClass );
Expand Down

0 comments on commit d506bb3

Please sign in to comment.