Skip to content

Commit

Permalink
HHH-12135 - Support for AttributeConverters as CDI beans
Browse files Browse the repository at this point in the history
initial work to get AttributeConverter support to be able to integrate with ManagedBeanRegistry.  There is a lot of "infrastructure" changes because the old code assumed we could instantiate the converter as soon as we knew the class which precludes lookup in the registry later.
  • Loading branch information
sebersole committed Dec 16, 2017
1 parent 173184e commit 90cabb4
Show file tree
Hide file tree
Showing 76 changed files with 1,937 additions and 955 deletions.
@@ -0,0 +1,24 @@
/*
* 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;

import javax.persistence.AttributeConverter;

import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.spi.MetadataBuildingContext;

/**
* Delayed information about an AttributeConverter. Delayed until we have
* access to {@link org.hibernate.boot.internal.ClassmateContext} during
* the MetadataSources -> Metadata process.
*
* @author Steve Ebersole
*/
public interface AttributeConverterInfo {
Class<? extends AttributeConverter> getConverterClass();
ConverterDescriptor toConverterDescriptor(MetadataBuildingContext context);
}
Expand Up @@ -401,7 +401,18 @@ public interface MetadataBuilder {
* @param definition The definition * @param definition The definition
* *
* @return {@code this} for method chaining * @return {@code this} for method chaining
*
* @deprecated (since 5.3) AttributeConverterDefinition forces early
* access to the AttributeConverter instance which precludes the
* possibility to resolve the converter from CDI, etc. Instead use
* one of:
*
* * {@link #applyAttributeConverter(Class)}
* * {@link #applyAttributeConverter(Class, boolean)}
* * {@link #applyAttributeConverter(AttributeConverter)}
* * {@link #applyAttributeConverter(AttributeConverter, boolean)}
*/ */
@Deprecated
MetadataBuilder applyAttributeConverter(AttributeConverterDefinition definition); MetadataBuilder applyAttributeConverter(AttributeConverterDefinition definition);


/** /**
Expand All @@ -410,8 +421,6 @@ public interface MetadataBuilder {
* @param attributeConverterClass The AttributeConverter class. * @param attributeConverterClass The AttributeConverter class.
* *
* @return {@code this} for method chaining * @return {@code this} for method chaining
*
* @see org.hibernate.cfg.AttributeConverterDefinition#from(Class)
*/ */
MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass); MetadataBuilder applyAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass);


Expand Down

This file was deleted.

0 comments on commit 90cabb4

Please sign in to comment.