Yes, I can certainly see the attraction - and it *has* been requested
before.

It would be nice to be able to plug in a something like:

NamingStrategy strategy = new MyCustomNamingStrategy();
Configuration cfg = new Configuration();
cfg.setNamingStrategy(strategy);

perhaps we could even allow this as:

<hibernate-mapping naming="pkg.MyCustomNamingStrategy">

The naming strategy itself would have methods like:

String getColumnName(String propertyName)
String getTableName(String className)
String overrideColumName(String columnName)
String overrideTableName(String tableName)


Add a feature request to JIRA!


Note that this is *really* easy to do, with just a little bit of playing
with the .cfg package.
Why not implement it yourself, and send a patch?






|---------+------------------------------------------->
|         |           Timo Verhoeven <[EMAIL PROTECTED]>|
|         |           Sent by:                        |
|         |           [EMAIL PROTECTED]|
|         |           ceforge.net                     |
|         |                                           |
|         |                                           |
|         |           02/08/03 02:25 AM               |
|         |                                           |
|---------+------------------------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                          |
  |       To:       [EMAIL PROTECTED]                                                  
                      |
  |       cc:                                                                          
                                          |
  |       Subject:  [Hibernate] Feature idea                                           
                                          |
  
>------------------------------------------------------------------------------------------------------------------------------|





Hi all!

When I design database datamodels I usually encounter clashes between
reserved names and names I'd like to use for my tables/columns, e.g.
"user", "role", etc.. So I ended up prefixing all tables/views/columns:
Tables have a "tbl" prefix, views a "qry" prefix and columns either
have a "fld" or a prefix based on the datatype ("txt"/"str" for
varchars, etc.).

I like to keep my mapping files small (/ to have few xdoclet tags) and
like the fact that hibernate has smart default for column names: it
uses the property's name.

Would it be possible/would you consider it useful to be able to specify
"default prefixes" for tables/columns so that I don't have to name my
columns manually in my mappings when I have to use prefixes? Such
settings could go into the SessionFactory configuration.


Opinions?

Timo



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel




**********************************************************************
Any personal or sensitive information contained in this email and
attachments must be handled in accordance with the Victorian Information
Privacy Act 2000, the Health Records Act 2001 or the Privacy Act 1988
(Commonwealth), as applicable.

This email, including all attachments, is confidential.  If you are not the
intended recipient, you must not disclose, distribute, copy or use the
information contained in this email or attachments.  Any confidentiality or
privilege is not waived or lost because this email has been sent to you in
error.  If you have received it in error, please let us know by reply
email, delete it from your system and destroy any copies.
**********************************************************************






-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to