Re: [Hibernate] Quoted schema names...

2005-04-25 Thread Emmanuel Bernard
Didn't we have some trouble in 2.1.7 with a similar patch?
Aleksandar Vidakovic wrote:
Salut all,
I had problems with schemas containing a dash in the name. SchemaExport
fails e. g. with a schema name like component-security on postgresql
(I'm sure that this is an issue on other DB systems, too). When I looked
into hibernates source I saw that table names can be quoted with
backticks, but schema names cannot. Is there a reason for this
behaviour...? I admit that I'm new to hibernate... at least concerning
it's source code ;-)
Attached you can find a little patch for the class
org.hibernate.mapping.Table which recognizes quoted schemas.
Cheers,
Aleks
 


Index: Table.java
===
RCS file: /cvsroot/hibernate/Hibernate3/src/org/hibernate/mapping/Table.java,v
retrieving revision 1.33
diff -u -r1.33 Table.java
--- Table.java  11 Apr 2005 12:40:40 -  1.33
+++ Table.java  23 Apr 2005 15:04:44 -
@@ -38,6 +38,7 @@
private Map uniqueKeys = new HashMap();
private final int uniqueInteger;
private boolean quoted;
+   private boolean quotedSchema;
private static int tableCounter = 0;
private List checkConstraints = new ArrayList();
private String rowId;
@@ -78,7 +79,7 @@
public String getQualifiedName(Dialect dialect, String defaultCatalog, 
String defaultSchema) {
if ( subselect != null ) return (  + subselect +  );
String quotedName = getQuotedName( dialect );
-   String usedSchema = schema == null ? defaultSchema : schema;
+   String usedSchema = schema == null ? defaultSchema : 
getQuotedSchema( dialect );
String usedCatalog = catalog == null ? defaultCatalog : catalog;
return Table.qualify( usedCatalog, usedSchema, quotedName, 
dialect.getSchemaSeparator() );
}
@@ -109,6 +110,12 @@
name;
}
+   public String getQuotedSchema(Dialect dialect) {
+   return quotedSchema ?
+   dialect.openQuote() + schema + 
dialect.closeQuote() :
+   schema;
+   }
+
public void setName(String name) {
if ( name.charAt( 0 ) == '`' ) {
quoted = true;
@@ -435,7 +442,13 @@
}
public void setSchema(String schema) {
-   this.schema = schema;
+   if ( schema.charAt( 0 ) == '`' ) {
+   quotedSchema = true;
+   this.schema = schema.substring( 1, schema.length() - 1 
);
+   }
+   else {
+   this.schema = schema;
+   }
}
	public String getCatalog() {
 

--
Emmanuel Bernard
[EMAIL PROTECTED]
callto://emmanuelbernard
http://www.hibernate.org

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Just saw some commits from Steve...

2005-04-25 Thread Gavin King








does that mean we can do 3.0.2 tonight / tomorrow?








Re: [Hibernate] Just saw some commits from Steve...

2005-04-25 Thread Christian Bauer
On Apr 25, 2005, at 6:54 PM, Gavin King wrote:
does that mean we can do 3.0.2 tonight / tomorrow?
Whats so important in 3.0.2?

---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] Just saw some commits from Steve...

2005-04-25 Thread Gavin King
Lots of bugfixes.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Christian Bauer
Sent: Monday, 25 April 2005 9:58 AM
To: hibernate-devel@lists.sourceforge.net
hibernate-devel@lists.sourceforge.net
Subject: Re: [Hibernate] Just saw some commits from Steve...


Whats so important in 3.0.2?



---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=ick
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95alloc_id396op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] Just saw some commits from Steve...

2005-04-25 Thread Steve Ebersole








I still need to figure out the filter
issue with Loader reading different values (FK vs. PK) for the many-to-many.



After thinking about it some more decided
to commit what I have since it does fix that other issue.



Im working on the other right now.











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Gavin King
Sent: Monday, April 25, 2005 11:54
AM
To:
hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] Just saw some
commits from Steve...





does that mean we can do
3.0.2 tonight / tomorrow?