Allow instantiation of components using interceptor

Description

This would be nice to use Interceptor instantiate functionnality before invoking the ComponentTuplizer toolchain (currently in ComponentMetamodel).

The Interceptor is an easy workaround to allow creating objects that don't have a default constructor (eg. to persist interfaces where instances only came from a factory) using entity names. Indeed, a reference to an object factory can be supplied (at Configuration step) to the Interceptor instance to do the job (-> currently tested and working great).

For Components, there's currently no such possibility but it seems technically possible looking at comments in ComponentMetamodel (commented prototype to inject a SessionFactoryImplementor) and associated open JIRA issues. Moreover, there's no tweak that could be applied to replace this functionnality since Tuplizers have fixed constructors and ComponentTuplizerFactory insctance creation is hardcoded in ComponentMetamodel.

Activity

Show:

Christian BeikovApril 4, 2024 at 11:42 AM

In ORM 6 we introduced Instantiator and adapted the CompositeUserType contract which can be used to control construction of component instances.

Out of Date

Details

Assignee

Reporter

Components

Priority

Created January 29, 2013 at 1:58 AM
Updated April 4, 2024 at 11:42 AM
Resolved April 4, 2024 at 11:42 AM