[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5688?page=c...
]
Steve Ebersole commented on HHH-5688:
-------------------------------------
Be a good opportunity to clean up the contracts a bit too. Some current thoughts:
1) Rename {{org.hibernate.bytecode.spi.BasicProxyFactory}} to
{{org.hibernate.bytecode.spi.BasicProxyInstantiator}} and
{{org.hibernate.proxy.ProxyFactory}} to
{{org.hibernate.bytecode.spi.EntityProxyInstantiator}}, since really these contracts are
about instantiating proxy instances.
2) Using a builder-style approach to both
{{org.hibernate.bytecode.spi.BasicProxyInstantiator}} and
{{org.hibernate.bytecode.spi.EntityProxyInstantiator}}
3) Replace {{BytecodeProvider#getProxyFactoryFactory}} with access to these builders.
Some illustrative code...
{code:title=BytecodeProvider.java|borderStyle=solid}
public interface BytecodeProvider {
...
public BasicProxyInstantiatorBuilder basicProxyInstantiatorBuilder();
public EntityProxyInstantiatorBuilder entityProxyInstantiatorBuilder();
}
{code}
{code:title=BasicProxyInstantiatorBuilder.java|borderStyle=solid}
public interface BasicProxyInstantiatorBuilder {
public BasicProxyInstantiator build();
public BasicProxyInstantiatorBuilder withSuperClass(Class proxySuperClass);
public BasicProxyInstantiatorBuilder withInterface(Class proxyInterface);
public BasicProxyInstantiatorBuilder withBaseName(String baseName);
public BasicProxyInstantiatorBuilder withSuffix(String suffix);
}
{code}
{code:title=BasicProxyInstantiator.java|borderStyle=solid}
public interface BasicProxyInstantiator {
public Object createInstance();
}
{code}
{code:title=EntityProxyInstantiatorBuilder.java|borderStyle=solid}
public interface EntityProxyInstantiatorBuilder {
public EntityProxyInstantiator build();
public EntityProxyInstantiatorBuilder withEntityName(String entityName);
public EntityProxyInstantiatorBuilder withEntityClass(Class entityClass);
public EntityProxyInstantiatorBuilder withInterface(Class entityInterface);
public EntityProxyInstantiatorBuilder withIdentifierGetterMethod(Method
identifierGetterMethod);
public EntityProxyInstantiatorBuilder withIdentifierSetterMethod(Method
identifierSetterMethod);
public EntityProxyInstantiatorBuilder withCompositeIdentifierType(CompositeType
compositeIdentifierType);
}
{code}
{code:title=EntityProxyInstantiator.java|borderStyle=solid}
public interface EntityProxyInstantiator {
public HibernateProxy createInstance(Serializable id, SessionImplementor session);
}
{code}
Migrate BytecodeProvider to be a Service
----------------------------------------
Key: HHH-5688
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5688
Project: Hibernate Core
Issue Type: Task
Components: core
Reporter: Steve Ebersole
Assignee: Steve Ebersole
Labels: bytecode
Fix For: 5.0.0
Time Spent: 50m
Remaining Estimate: 0h
This is deeply dependent upon the metamodel redesign ( HHH-5661 ) completion. The
{{BytecodeProvider}} selection is currently classloader-scoped (static) because of current
metamodel design.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira