-->
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.  [ 3 posts ] 
Author Message
 Post subject: Plug-in before statement-generation..?
PostPosted: Thu Nov 06, 2003 8:38 am 
Newbie

Joined: Thu Nov 06, 2003 8:27 am
Posts: 3
Hi,

I'm new with Hibernate and I wonder if there are any plugin-interfaces,
so that I can manipulate SELECT/UPDATE/INSERT-statement-generation ?

I need to do this because I want to use a SQL-function-call for certain fields (in the statement).

So for example instead of a generated:

SELECT name FROM secretusers ORDER BY name

... I want to have this:

SELECT decrypt(name) FROM secretusers ORDER BY decrypt(name)

The decrypt() function is a stored-procedure which does what its name implies. Never mind the performance-degradation or using other encryption-strategies... that's just the way it is with a legacy database I need to use with hibernate.

Is this possible ?
Or can I just rename these certain fields in the Hibernate-mapping so that the table-column name is "decrypt(name)" instead of "name" ?
Does this mapping-name yield unexpected behaviour with Hibernate's internal (caching-, collection-, etc.)mechanisms ?

J


Top
 Profile  
 
 Post subject: ....related to
PostPosted: Thu Nov 06, 2003 8:43 am 
Newbie

Joined: Thu Nov 06, 2003 8:27 am
Posts: 3
http://forum.hibernate.org/viewtopic.php?t=925295

I think this forum-post is dealing with the same issue.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 8:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use the formula attribute of <property> to do this.

It /is/ possible to customize SQL generation, but only by using a custom persister, which is a bit of a PIA.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.