-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: OGM Support for AttributeConverter?
PostPosted: Tue Mar 10, 2015 1:48 pm 
Newbie

Joined: Fri Feb 13, 2015 3:41 pm
Posts: 6
I was unable to get @Convert and @Converter to work with OGM:

In an @Embeddable class I have a property:

@Column
@Convert(converter = EncryptedStringConverter.class)
private String accessToken;

and

@Converter
public class EncryptedStringConverter implements AttributeConverter<String,String> {

@Override
public String convertToDatabaseColumn(String value) {
log.debug("convertToDatabaseColumn");
// encryption code
}

@Override
public String convertToEntityAttribute(String encryptedValue) {
log.debug("convertToEntityAttribute");
// decryption code
}
}

My EncryptedStringConverted did not get invoked for either convertToDatabaseColumn or convterToEntityAttribute


Top
 Profile  
 
 Post subject: Re: OGM Support for AttributeConverter?
PostPosted: Thu Mar 12, 2015 8:02 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello, I was searching JIRA for references to Converter to see if this was a known issue, and found several open issues in Hibernate ORM too.

So I'm wondering if you could have hit an existing limitation of ORM, or you can reproduce your problem only on OGM?

Please let me know, so we can properly classify the issue; definitely looks like more work is needed for this to work as expected.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: OGM Support for AttributeConverter?
PostPosted: Fri Mar 13, 2015 10:16 am 
Newbie

Joined: Fri Mar 13, 2015 10:13 am
Posts: 2
This is due to a current limitation with OGM.

Custom types and converters are not yet supported.


Top
 Profile  
 
 Post subject: Re: OGM Support for AttributeConverter?
PostPosted: Fri Mar 13, 2015 10:41 am 
Newbie

Joined: Fri Feb 13, 2015 3:41 pm
Posts: 6
Thanks for the update! I will look for another solution until this feature is available.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.