Handle <converter/> elements in orm.xml

Description

None

Activity

Show:

Brett Meyer March 7, 2014 at 10:09 PM

Bulk closing tickets resolved in released versions

Brett Meyer September 4, 2013 at 10:16 PM

Parsed and available with:

XMLContext: public Map<String, AttributeConverterDefinition> getLocalAttributeConverterDefintions()

Brett Meyer September 4, 2013 at 2:53 PM

10:15:31 AM) sebersole: brmeyer: hopefully emmanuel can give you guidance on scoping things at differing levels within annotation binder, but my guess is you'll have to do it yourself
(10:15:53 AM) sebersole: this was a huge missing piece from binders when i started on metamodel
(10:16:26 AM) sebersole: what i mean here is that you'll have a list of global attributeconverter defintions
(10:16:56 AM) sebersole: but that <converter/> in orm.xml should only apply to that orm.xml locally
(10:17:32 AM) sebersole: that kind of hierarchical context did not exist overall in binders
(10:17:57 AM) sebersole: that should be the only tricky part here
(10:18:32 AM) sebersole: from there, you'll just need to adjust where the code I am working on looks for converter definitions
(10:19:31 AM) sebersole: currently it uses org.hibernate.cfg.Mappings#locateAttributeConverter
(10:19:40 AM) sebersole: but Mappings is global
(10:22:03 AM) sebersole: making a converter available (what you'll work on) is different from applying it (what I am working on)
(10:23:29 AM) sebersole: notice though it uses a wrapper org.hibernate.cfg.AttributeConverterDefinition
(10:27:15 AM) emmanuel: brmeyer: sebersole there is no scoping per mapping file as every XMl metadata are merged by the JPAOverriding... class
(10:28:10 AM) sebersole: this is not just an issue with xml
(10:28:34 AM) sebersole: you have different levels of defining things even in annotations
(10:28:59 AM) sebersole: global, package level, class level, etc
(10:31:51 AM) emmanuel: sebersole: right so XML is converted in the correpsonding annotations at the corresponding level. And global XMl settings are available in ReflectionManager.getDefault()
(10:32:10 AM) emmanuel: As for each *Binder class does thing it depends
(10:32:20 AM) emmanuel: CollectionBinder correspond to a specific colelction
(10:32:41 AM) sebersole: the problem is that its hierarchical 🙂
(10:33:38 AM) sebersole: Binder has no such notion, brett will need to account for it manually the way the rest of Binder code does
(10:34:11 AM) sebersole: emmanuel: this is seen in things like defininng identifier generators
(10:34:20 AM) sebersole: where one level overrides another
(10:34:34 AM) sebersole: "hides" another level if you will
(10:36:35 AM) emmanuel: sebersole: the binders generally store that data into Mappings
(10:36:51 AM) emmanuel: (the global or package level settings)
(10:37:04 AM) sebersole: yep, which is global as you just said
(10:37:19 AM) sebersole: but you could define a generator on the id field
(10:37:21 AM) emmanuel: and at a given level when the consumption occurs, the local annotation and this global metadata are used
(10:37:23 AM) sebersole: much more local
(10:37:34 AM) emmanuel: generally preffering the local version according to the JPA spec
(10:37:39 AM) sebersole: right, but there is no unified handling of this
(10:37:46 AM) sebersole: which is my point
(10:37:53 AM) sebersole: thats what was added in metamodel
(10:38:05 AM) emmanuel: it's unified in the sense that only in one place do we actually define the generator for a given class
(10:38:10 AM) sebersole: so at each "level" you know which is more local
(10:38:21 AM) emmanuel: but not all generator work is done in the same class if that's what you ask
(10:38:44 AM) sebersole: i mean over the whole of annotation binding there is no unified why to handle this contextual info
(10:38:59 AM) sebersole: generator is one example of this
(10:39:15 AM) sebersole: each example needs to deal with it on its own in binder
(10:39:53 AM) emmanuel: right no, the hierarchical rules are spread across the codebase

Fixed

Details

Assignee

Brett Meyer

Reporter

Fix versions

Priority

Created August 30, 2013 at 4:47 PM
Updated March 7, 2014 at 10:09 PM
Resolved September 6, 2013 at 9:35 PM