Re: [Hibernate] 3.0.2

2005-04-23 Thread Christian Bauer
On Apr 23, 2005, at 7:54 AM, Gavin King wrote:
Are we good for a 3.0.2 release this weekend?
Nope, have to finish new tutorial.

---
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=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Quoted schema names...

2005-04-23 Thread Aleksandar Vidakovic
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() {


Re: [Hibernate] Quoted schema names...

2005-04-23 Thread Max Rydahl Andersen
On Sat, 23 Apr 2005 17:15:15 +0200, Aleksandar Vidakovic <[EMAIL PROTECTED]>  
wrote:


Attached you can find a little patch for the class
org.hibernate.mapping.Table which recognizes quoted schemas.
add it to the jira please, thanks.
--
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
---
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=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] 3.0.2

2005-04-23 Thread Steve Ebersole








The many-to-many filters are still not
ready; I’m still working on that issue with Loader and filtered joins
across the association table.

 

Up to you whether you want to hold up
3.0.2 to get this in.  

 

All the other stuff I had for 3.0.2 is
done.  We initially were tentative regarding getting the many-to-many filter
stuff into 3.0.2 anyway

 

Your call.

 









From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gavin King
Sent: Saturday, April 23, 2005
12:55 AM
To:
hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] 3.0.2



 

Are we good for a 3.0.2 release this
weekend?

 

Steve. are you ready?

 

Who wants to do the build?








RE: [Hibernate] 3.0.2

2005-04-23 Thread Gavin King








The problems you were having that you
thought were bugs in OJL: were they actually bugs in existing functionality, or
was it just a problem for the new functionality (ie. the filters)?

 

The last time we spoke, I got the
impression that your problems with many-to-many joins were new functionality
only.

 









From: Steve Ebersole 
Sent: Saturday, 23 April 2005 9:25
AM
To: Gavin King;
hibernate-devel@lists.sourceforge.net
Subject: RE: [Hibernate] 3.0.2



 

The many-to-many filters are still not
ready; I’m still working on that issue with Loader and filtered joins
across the association table.

 

Up to you whether you want to hold up 3.0.2
to get this in.  

 

All the other stuff I had for 3.0.2 is
done.  We initially were tentative regarding getting the many-to-many
filter stuff into 3.0.2 anyway

 

Your call.

 













From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Gavin King
Sent: Saturday, April 23, 2005
12:55 AM
To:
hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] 3.0.2



 

Are we good for a 3.0.2 release this
weekend?

 

Steve. are you ready?

 

Who wants to do the build?








RE: [Hibernate] 3.0.2

2005-04-23 Thread Gavin King
OK, we will shoot for early next week.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Christian Bauer
Sent: Saturday, 23 April 2005 6:55 AM
To: 

Subject: Re: [Hibernate] 3.0.2


On Apr 23, 2005, at 7:54 AM, Gavin King wrote:

> Are we good for a 3.0.2 release this weekend?

Nope, have to finish new tutorial.



---
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=6595&alloc_id=14396&op=click
___
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_ide95&alloc_id396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] 3.0.2

2005-04-23 Thread Steve Ebersole








Its not bugs per-se.  It’s just
that Loader currently cannot deal with the results as they are returned from
the join query with the new filter many-to-many filters.  The issue is in
Loader though.

 

I believe there was a bug in OJL regarding
forcing an inner join from the association table to the entity-element table
(the call to getJoinType() made from walkCollectionTree()).  I made a
change here such that an inner join is only used here for many-to-many when the
collection itself is the entry point in the load (currentDepth == 0). 
This bug caused rows to not be returned in scenarios where a fetch join was
used “the whole way across” a many-to-many if the root entity did
not have any rows in the association table due to the inner join used here
(load and criteria only).

 

Just to be clear, we are talking about two
separate issues relating to many-to-many really:

1)   The type of join to use for join fetched many-to-many
associations.  The verdict here was that fetches should use outer
joins.  CriteraQuery.createQuery() should use inner joins; CriteriaLoader
already handles this scenario.  So from Loader the only time an inner join
should really be used is if it is a collection loader for the many-to-many; that’s
what my change does.

2)   The contract between Loader and the two persisters for a many-to-many
is such that the collection is populated based on the fk value from the
association table; the collection elements are built off of the pk value from
the entity table.  In the correct join scenario (two outer joins) those
two values do not necessarily match with a filter applied to the many-to-many collection
element table (the filter correctly filters the row from the element table, but
it does not/cannot filter the row from the association table)…

 









From: Gavin
King 
Sent: Saturday, April 23, 2005
12:01 PM
To: Steve Ebersole;
'hibernate-devel@lists.sourceforge.net'
Subject: RE: [Hibernate] 3.0.2



 

The problems you were
having that you thought were bugs in OJL: were they actually bugs in existing
functionality, or was it just a problem for the new functionality (ie. the
filters)?

 

The last time we spoke, I
got the impression that your problems with many-to-many joins were new
functionality only.

 









From: Steve
Ebersole 
Sent: Saturday, 23 April 2005 9:25
AM
To: Gavin King;
hibernate-devel@lists.sourceforge.net
Subject: RE: [Hibernate] 3.0.2



 

The many-to-many filters
are still not ready; I’m still working on that issue with Loader and
filtered joins across the association table.

 

Up to you whether you
want to hold up 3.0.2 to get this in.  

 

All the other stuff I had
for 3.0.2 is done.  We initially were tentative regarding getting the
many-to-many filter stuff into 3.0.2 anyway

 

Your call.

 













From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gavin King
Sent: Saturday, April 23, 2005
12:55 AM
To:
hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] 3.0.2



 

Are we good for a 3.0.2 release this
weekend?

 

Steve. are you ready?

 

Who wants to do the build?