You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <one...@us...> - 2003-03-16 01:45:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate/test Modified Files: ABCProxy.hbm.xml ABCProxyTest.java MasterDetail.hbm.xml Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: ABCProxy.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCProxy.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ABCProxy.hbm.xml 9 Feb 2003 06:28:16 -0000 1.4 --- ABCProxy.hbm.xml 16 Mar 2003 01:45:53 -0000 1.5 *************** *** 7,11 **** <generator class="vm"/> </id> ! <discriminator column="clazz" type="integer"/> <property name="name"/> <subclass name="net.sf.hibernate.test.B" discriminator-value="null" proxy="net.sf.hibernate.test.B"> --- 7,11 ---- <generator class="vm"/> </id> ! <discriminator column="clazz" type="integer" force="true" not-null="false"/> <property name="name"/> <subclass name="net.sf.hibernate.test.B" discriminator-value="null" proxy="net.sf.hibernate.test.B"> Index: ABCProxyTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCProxyTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ABCProxyTest.java 9 Feb 2003 06:28:16 -0000 1.4 --- ABCProxyTest.java 16 Mar 2003 01:45:53 -0000 1.5 *************** *** 116,119 **** --- 116,120 ---- c1b.getName().equals("c1") ); + System.out.println( s.delete("from a in class A") ); t.commit(); s.close(); *************** *** 121,125 **** s = sessions.openSession(); t = s.beginTransaction(); ! s.find("from b in class B"); t.commit(); s.close(); --- 122,130 ---- s = sessions.openSession(); t = s.beginTransaction(); ! s.save( new B() ); ! s.save( new A() ); ! assertTrue( s.find("from b in class B").size()==1 ); ! assertTrue( s.find("from a in class A").size()==2 ); ! s.delete("from a in class A"); t.commit(); s.close(); Index: MasterDetail.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MasterDetail.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MasterDetail.hbm.xml 28 Jan 2003 10:22:21 -0000 1.3 --- MasterDetail.hbm.xml 16 Mar 2003 01:45:53 -0000 1.4 *************** *** 21,30 **** </set> <set name="incoming" lazy="true" table="mtm"> ! <key column="outg"/> ! <many-to-many class="net.sf.hibernate.test.Master" column="incm"/> </set> <set name="outgoing" lazy="true" table="mtm" inverse="true"> ! <key column="incm"/> ! <many-to-many class="net.sf.hibernate.test.Master" column="outg"/> </set> <!-- <cache timeout="10000" type="readwrite"/> --> --- 21,30 ---- </set> <set name="incoming" lazy="true" table="mtm"> ! <key column="outgoingabcdef"/> ! <many-to-many class="net.sf.hibernate.test.Master" column="incomingabcdef"/> </set> <set name="outgoing" lazy="true" table="mtm" inverse="true"> ! <key column="incomingabcdef"/> ! <many-to-many class="net.sf.hibernate.test.Master" column="outgoingabcdef"/> </set> <!-- <cache timeout="10000" type="readwrite"/> --> |
From: <one...@us...> - 2003-03-16 01:45:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate/mapping Modified Files: Column.java PersistentClass.java RootClass.java Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: Column.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Column.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Column.java 15 Mar 2003 04:38:17 -0000 1.10 --- Column.java 16 Mar 2003 01:45:52 -0000 1.11 *************** *** 79,83 **** catch (Exception e) { throw new MappingException( ! "Could not determine type for column " + name + " of type " + type.getClass().getName() + ": " + e.getClass().getName(), e ); --- 79,88 ---- catch (Exception e) { throw new MappingException( ! "Could not determine type for column " + ! name + ! " of type " + ! type.getClass().getName() + ! ": " + ! e.getClass().getName(), e ); Index: PersistentClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PersistentClass.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PersistentClass.java 15 Mar 2003 04:38:17 -0000 1.11 --- PersistentClass.java 16 Mar 2003 01:45:52 -0000 1.12 *************** *** 156,159 **** --- 156,163 ---- } + public boolean isForceDiscriminator() { + return false; + } + public void createPrimaryKey() { //Primary key constraint Index: RootClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/RootClass.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RootClass.java 27 Jan 2003 07:12:03 -0000 1.9 --- RootClass.java 16 Mar 2003 01:45:52 -0000 1.10 *************** *** 27,30 **** --- 27,31 ---- private boolean explicitPolymorphism; private Class persister; + private boolean forceDiscriminator; public Property getIdentifierProperty() { *************** *** 166,169 **** --- 167,186 ---- public void setCache(CacheConcurrencyStrategy cache) { this.cache = cache; + } + + /** + * Returns the forceDiscriminator. + * @return boolean + */ + public boolean isForceDiscriminator() { + return forceDiscriminator; + } + + /** + * Sets the forceDiscriminator. + * @param forceDiscriminator The forceDiscriminator to set + */ + public void setForceDiscriminator(boolean forceDiscriminator) { + this.forceDiscriminator = forceDiscriminator; } |
From: <one...@us...> - 2003-03-16 01:45:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate/sql Modified Files: InFragment.java Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: InFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/InFragment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InFragment.java 9 Feb 2003 06:28:16 -0000 1.2 --- InFragment.java 16 Mar 2003 01:45:53 -0000 1.3 *************** *** 33,43 **** buf.append(columnName); if ( values.size()>1 ) { buf.append(" in ("); Iterator iter = values.iterator(); while ( iter.hasNext() ) { ! buf.append( iter.next() ); ! if ( iter.hasNext() ) buf.append(StringHelper.COMMA_SPACE); } buf.append(StringHelper.CLOSE_PAREN); } else { --- 33,55 ---- buf.append(columnName); if ( values.size()>1 ) { + boolean allowNull = false; buf.append(" in ("); Iterator iter = values.iterator(); while ( iter.hasNext() ) { ! Object value = iter.next(); ! if ( "null".equals(value) ) { ! allowNull = true; ! } ! else { ! buf.append(value); ! if ( iter.hasNext() ) buf.append(StringHelper.COMMA_SPACE); ! } } buf.append(StringHelper.CLOSE_PAREN); + if (allowNull) buf + .insert(0, " is null or ") + .insert(0, columnName) + .insert(0, StringHelper.OPEN_PAREN) + .append(StringHelper.CLOSE_PAREN); } else { |
From: <one...@us...> - 2003-03-16 01:45:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate/persister Modified Files: EntityPersister.java NormalizedEntityPersister.java Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/EntityPersister.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** EntityPersister.java 4 Mar 2003 10:53:47 -0000 1.20 --- EntityPersister.java 16 Mar 2003 01:45:52 -0000 1.21 *************** *** 74,77 **** --- 74,78 ---- private final String discriminatorColumnName; + private final boolean forceDiscriminator; private final String[] subclassColumnClosure; private final String[] subclassColumnAliasClosure; *************** *** 625,628 **** --- 626,630 ---- Value d = model.getDiscriminator(); if (d==null) throw new MappingException("discriminator mapping required for polymorphic persistence"); + forceDiscriminator = model.isForceDiscriminator(); discriminatorColumnName = ( (Column) d.getColumnIterator().next() ).getName(); try { *************** *** 645,648 **** --- 647,651 ---- } else { + forceDiscriminator = false; discriminatorColumnName = null; discriminatorType = null; *************** *** 822,826 **** public String queryWhereFragment(String name, boolean innerJoin, boolean includeSubclasses) throws MappingException { ! if ( innerJoin && isInherited() ) { InFragment frag = new InFragment() .setColumn( name, getDiscriminatorColumnName() ); --- 825,829 ---- public String queryWhereFragment(String name, boolean innerJoin, boolean includeSubclasses) throws MappingException { ! if ( innerJoin && ( forceDiscriminator || isInherited() ) ) { InFragment frag = new InFragment() .setColumn( name, getDiscriminatorColumnName() ); Index: NormalizedEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/NormalizedEntityPersister.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NormalizedEntityPersister.java 4 Mar 2003 10:53:47 -0000 1.13 --- NormalizedEntityPersister.java 16 Mar 2003 01:45:52 -0000 1.14 *************** *** 673,679 **** discriminatorSQLString = "0"; } - catch (ClassCastException cce) { - throw new MappingException("Illegal discriminator type: " + model.getDiscriminator().getType().getClass().getName() ); - } catch (Exception e) { throw new MappingException("Could not format discriminator value to SQL string", e ); --- 673,676 ---- |
From: <one...@us...> - 2003-03-16 01:45:55
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate/engine Modified Files: Cascades.java Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: Cascades.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Cascades.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Cascades.java 22 Jan 2003 13:09:19 -0000 1.6 --- Cascades.java 16 Mar 2003 01:45:52 -0000 1.7 *************** *** 232,236 **** } else { ! if (child instanceof PersistentCollection ) { PersistentCollection pc = (PersistentCollection) child; if ( pc.hasQueuedAdds() ) { --- 232,236 ---- } else { ! if (child instanceof PersistentCollection) { PersistentCollection pc = (PersistentCollection) child; if ( pc.hasQueuedAdds() ) { |
From: <one...@us...> - 2003-03-16 01:45:55
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate/collection Modified Files: CollectionPersister.java PersistentCollection.java Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CollectionPersister.java 15 Mar 2003 04:38:15 -0000 1.15 --- CollectionPersister.java 16 Mar 2003 01:45:52 -0000 1.16 *************** *** 27,30 **** --- 27,31 ---- import net.sf.hibernate.mapping.Table; import net.sf.hibernate.metadata.CollectionMetadata; + import net.sf.hibernate.sql.Alias; import net.sf.hibernate.sql.Delete; import net.sf.hibernate.sql.Insert; *************** *** 66,73 **** private final String[] keyColumnNames; private final String[] indexColumnNames; - private final String[] unquotedIndexColumnNames; private final String[] elementColumnNames; private final String[] unquotedElementColumnNames; private final String[] rowSelectColumnNames; private final Type rowSelectType; private final boolean primitiveArray; --- 67,76 ---- private final String[] keyColumnNames; private final String[] indexColumnNames; private final String[] elementColumnNames; + private final String[] unquotedIndexColumnNames; private final String[] unquotedElementColumnNames; private final String[] rowSelectColumnNames; + private final String[] indexColumnAliases; + private final String[] elementColumnAliases; private final Type rowSelectType; private final boolean primitiveArray; *************** *** 91,95 **** private static final Log log = LogFactory.getLog(CollectionPersister.class); ! public CollectionPersister(Collection collection, Configuration datastore, SessionFactoryImplementor factory) throws MappingException, CacheException { collectionType = collection.getType(); --- 94,99 ---- private static final Log log = LogFactory.getLog(CollectionPersister.class); ! public CollectionPersister(Collection collection, Configuration datastore, SessionFactoryImplementor factory) ! throws MappingException, CacheException { collectionType = collection.getType(); *************** *** 120,123 **** --- 124,128 ---- array = collection.isArray(); + Table table; if (isOneToMany) { EntityType type = collection.getOneToMany().getType(); *************** *** 125,157 **** PersistentClass associatedClass = datastore.getClassMapping( type.getPersistentClass() ); span = associatedClass.getIdentifier().getColumnSpan(); - elementColumnNames = new String[span]; iter = associatedClass.getKey().getColumnIterator(); ! int j=0; ! while ( iter.hasNext() ) { ! Column col = (Column) iter.next(); ! elementColumnNames[j] = col.getName(); ! j++; ! } ! Table table = associatedClass.getTable(); ! qualifiedTableName = table.getQualifiedName( factory.getDefaultSchema() ); enableJoinedFetch = OuterJoinLoader.EAGER; } else { ! Table table = collection.getTable(); ! qualifiedTableName = table.getQualifiedName( factory.getDefaultSchema() ); elementType = collection.getElement().getType(); span = collection.getElement().getColumnSpan(); ! elementColumnNames = new String[span]; ! enableJoinedFetch = collection.getElement().getOuterJoinFetchSetting(); ! iter = collection.getElement().getColumnIterator(); - int i= 0; - while ( iter.hasNext() ) { - Column col = (Column) iter.next(); - elementColumnNames[i] = col.getName(); - i++; - } } ! unquotedElementColumnNames = StringHelper.unQuote(elementColumnNames); --- 130,159 ---- PersistentClass associatedClass = datastore.getClassMapping( type.getPersistentClass() ); span = associatedClass.getIdentifier().getColumnSpan(); iter = associatedClass.getKey().getColumnIterator(); ! table = associatedClass.getTable(); enableJoinedFetch = OuterJoinLoader.EAGER; } else { ! table = collection.getTable(); elementType = collection.getElement().getType(); span = collection.getElement().getColumnSpan(); ! enableJoinedFetch = collection.getElement().getOuterJoinFetchSetting(); iter = collection.getElement().getColumnIterator(); } ! ! qualifiedTableName = table.getQualifiedName( factory.getDefaultSchema() ); ! String[] aliases = new String[span]; ! elementColumnNames = new String[span]; ! int j=0; ! while ( iter.hasNext() ) { ! Column col = (Column) iter.next(); ! elementColumnNames[j] = col.getName(); ! aliases[j] = col.getAlias(); ! j++; ! } ! ! Alias alias = new Alias("__"); ! elementColumnAliases = alias.toAliasStrings(aliases); ! unquotedElementColumnNames = StringHelper.unQuote(elementColumnAliases); *************** *** 169,177 **** rowSelectColumnNames = indexColumnNames; rowSelectType = indexType; ! unquotedIndexColumnNames = StringHelper.unQuote(indexColumnNames); } else { indexType = null; indexColumnNames = null; unquotedIndexColumnNames = null; rowSelectColumnNames = elementColumnNames; --- 171,181 ---- rowSelectColumnNames = indexColumnNames; rowSelectType = indexType; ! indexColumnAliases = alias.toAliasStrings(indexColumnNames); ! unquotedIndexColumnNames = StringHelper.unQuote(indexColumnAliases); } else { indexType = null; indexColumnNames = null; + indexColumnAliases = null; unquotedIndexColumnNames = null; rowSelectColumnNames = elementColumnNames; *************** *** 368,373 **** SelectFragment frag = new SelectFragment() .setSuffix(StringHelper.EMPTY_STRING) ! .addColumns(alias, elementColumnNames); ! if (hasIndex) frag.addColumns(alias, indexColumnNames); return frag.toFragmentString() .substring(2); //strip leading ',' --- 372,377 ---- SelectFragment frag = new SelectFragment() .setSuffix(StringHelper.EMPTY_STRING) ! .addColumns(alias, elementColumnNames, elementColumnAliases); ! if (hasIndex) frag.addColumns(alias, indexColumnNames, indexColumnAliases); return frag.toFragmentString() .substring(2); //strip leading ',' Index: PersistentCollection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/PersistentCollection.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PersistentCollection.java 6 Mar 2003 11:12:11 -0000 1.9 --- PersistentCollection.java 16 Mar 2003 01:45:52 -0000 1.10 *************** *** 166,171 **** public abstract void readEntries(Iterator entries); public abstract Object readFrom(ResultSet rs, CollectionPersister role, Object owner) throws HibernateException, SQLException; ! public abstract void writeTo(PreparedStatement st, CollectionPersister role, Object entry, int i, boolean writeOrder) ! throws HibernateException, SQLException; public abstract Object getIndex(Object entry, int i); public abstract void beforeInitialize(CollectionPersister persister); --- 166,170 ---- public abstract void readEntries(Iterator entries); public abstract Object readFrom(ResultSet rs, CollectionPersister role, Object owner) throws HibernateException, SQLException; ! public abstract void writeTo(PreparedStatement st, CollectionPersister role, Object entry, int i, boolean writeOrder) throws HibernateException, SQLException; public abstract Object getIndex(Object entry, int i); public abstract void beforeInitialize(CollectionPersister persister); |
From: <one...@us...> - 2003-03-16 01:45:55
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate Modified Files: hibernate-mapping-2.0.dtd Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: hibernate-mapping-2.0.dtd =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hibernate-mapping-2.0.dtd,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** hibernate-mapping-2.0.dtd 15 Feb 2003 01:00:49 -0000 1.15 --- hibernate-mapping-2.0.dtd 16 Mar 2003 01:45:52 -0000 1.16 *************** *** 73,76 **** --- 73,77 ---- <!ATTLIST discriminator not-null (true|false) "true"> <!ATTLIST discriminator length CDATA #IMPLIED> + <!ATTLIST discriminator force (true|false) "false"> <!-- Versioned data requires a column holding a version number. This is exposed to the |
From: <one...@us...> - 2003-03-16 01:45:55
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv21387/src/net/sf/hibernate/cfg Modified Files: Binder.java Log Message: fixed problem loading one-to-many in Sybase alias length limitation for collection columns added force attribute to <discriminator> better handling of 'null' discriminators Index: Binder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Binder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Binder.java 1 Mar 2003 12:15:26 -0000 1.8 --- Binder.java 16 Mar 2003 01:45:52 -0000 1.9 *************** *** 245,249 **** ( (Column) discrim.getColumnIterator().next() ).setType(Hibernate.STRING); } ! model.setPolymorphic(true); } else if ( "jcs-cache".equals(name) ) { --- 245,250 ---- ( (Column) discrim.getColumnIterator().next() ).setType(Hibernate.STRING); } ! model.setPolymorphic(true); ! if ( "true".equals( subnode.attributeValue("force") ) ) model.setForceDiscriminator(true); } else if ( "jcs-cache".equals(name) ) { |
From: <one...@us...> - 2003-03-15 04:38:21
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv15497/sf/hibernate/util Modified Files: StringHelper.java Log Message: refactored alias generation into Alias class Index: StringHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/StringHelper.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** StringHelper.java 12 Mar 2003 08:24:24 -0000 1.10 --- StringHelper.java 15 Mar 2003 04:38:18 -0000 1.11 *************** *** 118,141 **** public static String suffix(String name, String suffix) { ! ! if (suffix==null) return name; ! ! char quote = name.charAt(0); ! int quoteType = Dialect.QUOTE.indexOf(quote); ! boolean nameEscaped = quoteType > -1; ! StringBuffer nameBuffer = new StringBuffer(30); ! ! if (nameEscaped) { ! nameBuffer.append( name.substring(1, name.length()-1) ).append(suffix); ! } ! else { ! nameBuffer.append(name).append(suffix); ! } ! ! if (nameEscaped) { ! nameBuffer.insert(0, quote); ! nameBuffer.append( Dialect.CLOSED_QUOTE.charAt(quoteType) ); ! } ! return nameBuffer.toString(); } --- 118,122 ---- public static String suffix(String name, String suffix) { ! return (suffix==null) ? name : name + suffix; } |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv15497/sf/hibernate/sql Modified Files: ANSICaseFragment.java DecodeCaseFragment.java Select.java SelectFragment.java SimpleSelect.java Log Message: refactored alias generation into Alias class Index: ANSICaseFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/ANSICaseFragment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ANSICaseFragment.java 1 Feb 2003 12:24:07 -0000 1.1 --- ANSICaseFragment.java 15 Mar 2003 04:38:17 -0000 1.2 *************** *** 1 **** ! //$Id$ package net.sf.hibernate.sql; import java.util.Iterator; import java.util.Map; import net.sf.hibernate.util.StringHelper; import org.apache.commons.collections.SequencedHashMap; /** * Represents an SQL <tt>case when .... then .... end as ...</tt> */ public class ANSICaseFragment extends CaseFragment { private String returnColumnName; private Map cases = new SequencedHashMap(); public CaseFragment setReturnColumnName(String returnColumnName) { this.returnColumnName = returnColumnName; return this; } public CaseFragment setReturnColumnName(String returnColumnName, String suffix) { return setReturnColumnName( StringHelper.suffix(returnColumnName, suffix) ); } public CaseFragment addWhenColumnNotNull(String alias, String columnName, String value) { cases.put( alias + StringHelper.DOT + columnName + " is not null", value ); return this; } public String toFragmentString() { StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ); buf.append("case"); Iterator iter = cases.entrySet().iterator(); while ( iter.hasNext() ) { Map.Entry me = (Map.Entry) iter.next(); buf.append(" when ") .append( me.getKey() ) .append(" then ") .append( me.getValue() ); } return buf.append(" end as ") .append(returnColumnName) .toString(); } } \ No newline at end of file --- 1 ---- ! //$Id$ package net.sf.hibernate.sql; import java.util.Iterator; import java.util.Map; import net.sf.hibernate.util.StringHelper; import org.apache.commons.collections.SequencedHashMap; /** * Represents an SQL <tt>case when .... then .... end as ...</tt> */ public class ANSICaseFragment extends CaseFragment { private String returnColumnName; private Map cases = new SequencedHashMap(); public CaseFragment setReturnColumnName(String returnColumnName) { this.returnColumnName = returnColumnName; return this; } public CaseFragment setReturnColumnName(String returnColumnName, String suffix) { return setReturnColumnName( new Alias(suffix).toAliasString(returnColumnName) ); } public CaseFragment addWhenColumnNotNull(String alias, String columnName, String value) { cases.put( alias + StringHelper.DOT + columnName + " is not null", value ); return this; } public String toFragmentString() { StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ); buf.append("case"); Iterator iter = cases.entrySet().iterator(); while ( iter.hasNext() ) { Map.Entry me = (Map.Entry) iter.next(); buf.append(" when ") .append( me.getKey() ) .append(" then ") .append( me.getValue() ); } return buf.append(" end as ") .append(returnColumnName) .toString(); } } \ No newline at end of file Index: DecodeCaseFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/DecodeCaseFragment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DecodeCaseFragment.java 1 Feb 2003 12:24:07 -0000 1.1 --- DecodeCaseFragment.java 15 Mar 2003 04:38:17 -0000 1.2 *************** *** 1 **** ! //$Id$ package net.sf.hibernate.sql; import java.util.Iterator; import java.util.Map; import net.sf.hibernate.util.StringHelper; import org.apache.commons.collections.SequencedHashMap; /** * Represents an SQL <tt>decode( pkvalue, key1, 1, key2, 2, ..., 0)</tt> */ public class DecodeCaseFragment extends CaseFragment { private String returnColumnName; private Map cases = new SequencedHashMap(); public CaseFragment setReturnColumnName(String returnColumnName) { this.returnColumnName = returnColumnName; return this; } public CaseFragment setReturnColumnName(String returnColumnName, String suffix) { return setReturnColumnName( StringHelper.suffix(returnColumnName, suffix) ); } public CaseFragment addWhenColumnNotNull(String alias, String columnName, String value) { cases.put( alias + StringHelper.DOT + columnName, value ); return this; } public String toFragmentString() { StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ); Iterator iter = cases.entrySet().iterator(); while ( iter.hasNext() ) { Map.Entry me = (Map.Entry) iter.next(); if (me.getValue().equals("0")) { buf.insert(0, me.getKey()); } else { buf.append(", ") .append( me.getKey() ) .append(", ") .append( me.getValue() ); } } return buf.insert(0, "decode (").append(",0 ) as ") .append(returnColumnName) .toString(); } } \ No newline at end of file --- 1 ---- ! //$Id$ package net.sf.hibernate.sql; import java.util.Iterator; import java.util.Map; import net.sf.hibernate.util.StringHelper; import org.apache.commons.collections.SequencedHashMap; /** * Represents an SQL <tt>decode( pkvalue, key1, 1, key2, 2, ..., 0)</tt> */ public class DecodeCaseFragment extends CaseFragment { private String returnColumnName; private Map cases = new SequencedHashMap(); public CaseFragment setReturnColumnName(String returnColumnName) { this.returnColumnName = returnColumnName; return this; } public CaseFragment setReturnColumnName(String returnColumnName, String suffix) { return setReturnColumnName( new Alias(suffix).toAliasString(returnColumnName) ); } public CaseFragment addWhenColumnNotNull(String alias, String columnName, String value) { cases.put( alias + StringHelper.DOT + columnName, value ); return this; } public String toFragmentString() { StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ); Iterator iter = cases.entrySet().iterator(); while ( iter.hasNext() ) { Map.Entry me = (Map.Entry) iter.next(); if (me.getValue().equals("0")) { buf.insert(0, me.getKey()); } else { buf.append(", ") .append( me.getKey() ) .append(", ") .append( me.getValue() ); } } return buf.insert(0, "decode (").append(",0 ) as ") .append(returnColumnName) .toString(); } } \ No newline at end of file Index: Select.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/Select.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Select.java 20 Jan 2003 18:45:18 -0000 1.1 --- Select.java 15 Mar 2003 04:38:17 -0000 1.2 *************** *** 18,28 **** public String toStatementString() { StringBuffer buf = new StringBuffer( ! selectClause.length() + fromClause.length() + outerJoinsAfterFrom.length() + whereClause.length() + outerJoinsAfterWhere.length() + 20 ); buf.append("SELECT ").append(selectClause) ! .append(" FROM ").append(fromClause) ! .append(outerJoinsAfterFrom) ! .append(" WHERE ").append(whereClause) ! .append(outerJoinsAfterWhere); if (orderByClause!=null) buf.append(" ORDER BY ").append(orderByClause); return buf.toString(); --- 18,33 ---- public String toStatementString() { StringBuffer buf = new StringBuffer( ! selectClause.length() + ! fromClause.length() + ! outerJoinsAfterFrom.length() + ! whereClause.length() + ! outerJoinsAfterWhere.length() + ! 20 ); buf.append("SELECT ").append(selectClause) ! .append(" FROM ").append(fromClause) ! .append(outerJoinsAfterFrom) ! .append(" WHERE ").append(whereClause) ! .append(outerJoinsAfterWhere); if (orderByClause!=null) buf.append(" ORDER BY ").append(orderByClause); return buf.toString(); Index: SelectFragment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/SelectFragment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelectFragment.java 20 Jan 2003 18:45:18 -0000 1.1 --- SelectFragment.java 15 Mar 2003 04:38:17 -0000 1.2 *************** *** 66,70 **** buf.append(col) .append(" as ") ! .append( StringHelper.suffix( columnAlias, suffix) ); } return buf.toString(); --- 66,70 ---- buf.append(col) .append(" as ") ! .append( new Alias(suffix).toAliasString(columnAlias) ); } return buf.toString(); Index: SimpleSelect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/SimpleSelect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleSelect.java 2 Feb 2003 06:41:05 -0000 1.2 --- SimpleSelect.java 15 Mar 2003 04:38:17 -0000 1.3 *************** *** 15,18 **** --- 15,20 ---- public class SimpleSelect { + //private static final Alias DEFAULT_ALIAS = new Alias(10, null); + private String tableName; private String orderBy; *************** *** 37,40 **** --- 39,43 ---- public SimpleSelect addColumn(String columnName) { columns.add(columnName); + //aliases.put( columnName, DEFAULT_ALIAS.toAliasString(columnName) ); return this; } |
From: <one...@us...> - 2003-03-15 04:38:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv15497/sf/hibernate/loader Modified Files: Loader.java OuterJoinLoader.java Log Message: refactored alias generation into Alias class Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Loader.java 4 Mar 2003 10:53:47 -0000 1.13 --- Loader.java 15 Mar 2003 04:38:17 -0000 1.14 *************** *** 26,29 **** --- 26,30 ---- import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.persister.Loadable; + import net.sf.hibernate.sql.Alias; import net.sf.hibernate.type.Type; *************** *** 196,200 **** if (id==null) { //TODO: we can cache these on this object, from the constructor ! String[] keyColNames = StringHelper.suffix( persister.getIdentifierColumnNames(), suffix ); StringHelper.unQuoteInPlace(keyColNames); --- 197,201 ---- if (id==null) { //TODO: we can cache these on this object, from the constructor ! String[] keyColNames = new Alias(suffix).toAliasStrings( persister.getIdentifierColumnNames() ); StringHelper.unQuoteInPlace(keyColNames); *************** *** 303,309 **** if ( persister.hasSubclasses() ) { ! String col = StringHelper.unQuote( ! StringHelper.suffix( persister.getDiscriminatorColumnName(), suffix ) ! ); // Code to handle subclasses of topClass --- 304,308 ---- if ( persister.hasSubclasses() ) { ! String col = new Alias(suffix).toAliasString( persister.getDiscriminatorColumnName() ); // Code to handle subclasses of topClass *************** *** 335,339 **** for (int i=0; i<types.length; i++) { //TODO: we can cache these on this object, from the constructor ! String[] cols = StringHelper.suffix( persister.getPropertyColumnNames(i), suffix ); StringHelper.unQuoteInPlace(cols); --- 334,338 ---- for (int i=0; i<types.length; i++) { //TODO: we can cache these on this object, from the constructor ! String[] cols = new Alias(suffix).toAliasStrings( persister.getPropertyColumnNames(i) ); StringHelper.unQuoteInPlace(cols); Index: OuterJoinLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** OuterJoinLoader.java 23 Feb 2003 07:22:11 -0000 1.13 --- OuterJoinLoader.java 15 Mar 2003 04:38:17 -0000 1.14 *************** *** 15,18 **** --- 15,19 ---- import net.sf.hibernate.persister.Loadable; import net.sf.hibernate.persister.NormalizedEntityPersister; + import net.sf.hibernate.sql.Alias; import net.sf.hibernate.sql.JoinFragment; import net.sf.hibernate.type.AbstractComponentType; *************** *** 232,239 **** tableName = StringHelper.unqualify(tableName); ! return StringHelper.suffix( ! tableName.length() <=5 ? tableName : tableName.substring(0, 5), ! Integer.toString(n) + StringHelper.UNDERSCORE ! ); } --- 233,238 ---- tableName = StringHelper.unqualify(tableName); ! return new Alias( 5, Integer.toString(n) + StringHelper.UNDERSCORE ) ! .toAliasString(tableName); } |
From: <one...@us...> - 2003-03-15 04:38:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv15497/sf/hibernate/collection Modified Files: CollectionPersister.java Log Message: refactored alias generation into Alias class Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CollectionPersister.java 9 Mar 2003 04:04:05 -0000 1.14 --- CollectionPersister.java 15 Mar 2003 04:38:15 -0000 1.15 *************** *** 91,95 **** private static final Log log = LogFactory.getLog(CollectionPersister.class); - public CollectionPersister(Collection collection, Configuration datastore, SessionFactoryImplementor factory) throws MappingException, CacheException { --- 91,94 ---- |
From: <one...@us...> - 2003-03-15 04:38:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv15497/sf/hibernate/mapping Modified Files: Column.java PersistentClass.java Log Message: refactored alias generation into Alias class Index: Column.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Column.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Column.java 2 Mar 2003 06:58:50 -0000 1.9 --- Column.java 15 Mar 2003 04:38:17 -0000 1.10 *************** *** 6,9 **** --- 6,10 ---- import net.sf.hibernate.dialect.Dialect; import net.sf.hibernate.engine.Mapping; + import net.sf.hibernate.sql.Alias; import net.sf.hibernate.type.Type; import net.sf.hibernate.util.StringHelper; *************** *** 48,52 **** } else { ! return name.substring(0, 10) + uniqueInteger + StringHelper.UNDERSCORE; } } --- 49,53 ---- } else { ! return new Alias(10, Integer.toString(uniqueInteger) + StringHelper.UNDERSCORE).toAliasString(name); } } Index: PersistentClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PersistentClass.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PersistentClass.java 27 Jan 2003 12:51:50 -0000 1.10 --- PersistentClass.java 15 Mar 2003 04:38:17 -0000 1.11 *************** *** 6,11 **** import net.sf.hibernate.cache.CacheConcurrencyStrategy; import net.sf.hibernate.util.JoinedIterator; - import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.util.Stringable; --- 6,11 ---- import net.sf.hibernate.cache.CacheConcurrencyStrategy; + import net.sf.hibernate.sql.Alias; import net.sf.hibernate.util.JoinedIterator; import net.sf.hibernate.util.Stringable; *************** *** 160,164 **** PrimaryKey pk = new PrimaryKey(); pk.setTable(table); ! pk.setName( StringHelper.suffix( table.getName(), "PK" ) ); table.setPrimaryKey(pk); --- 160,164 ---- PrimaryKey pk = new PrimaryKey(); pk.setTable(table); ! pk.setName( PK_ALIAS.toAliasString( table.getName() ) ); table.setPrimaryKey(pk); *************** *** 168,171 **** --- 168,173 ---- } } + + private static final Alias PK_ALIAS = new Alias(15, "PK"); } |
From: <one...@us...> - 2003-03-13 03:20:49
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv28710 Modified Files: changelog.txt Log Message: latest changes Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** changelog.txt 12 Mar 2003 12:28:57 -0000 1.11 --- changelog.txt 13 Mar 2003 03:20:46 -0000 1.12 *************** *** 19,25 **** --- 19,28 ---- * fixed a bug in Query.setParameterList() * Ingres support (Ian Booth) + * collections now detect changes not made via wrapper for newly saved objects * new (experimental) Criteria + Expression APIs * Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing Type) * added Hibernate.isInitialized() + * added Hibernate.refresh(Object, LockMode) + * update(), saveOrUpdate() no longer initialize a proxy Changes in version 2.0 beta 3 (24.2.2003) |
From: <one...@us...> - 2003-03-13 03:16:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv27048/sf/hibernate/impl Modified Files: QueryImpl.java SessionImpl.java Log Message: improved handing of proxies in QueryImpl don't initialize proxies in update() or saveOrUpdate() added Session.refresh(Object, LockMode) Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/QueryImpl.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** QueryImpl.java 12 Mar 2003 12:28:58 -0000 1.11 --- QueryImpl.java 13 Mar 2003 03:16:00 -0000 1.12 *************** *** 174,180 **** } ! public Query setEntity(int position, Object val) throws HibernateException { ! val = HibernateProxyHelper.unproxy(val, session); ! setParameter( position, val, Hibernate.association( val.getClass() ) ); return this; } --- 174,179 ---- } ! public Query setEntity(int position, Object val) { ! setParameter( position, val, Hibernate.association( HibernateProxyHelper.getClass(val) ) ); return this; } *************** *** 230,236 **** } ! public Query setEntity(String name, Object val) throws HibernateException { ! val = HibernateProxyHelper.unproxy(val, session); ! setParameter( name, val, Hibernate.association( val.getClass() ) ); return this; } --- 229,234 ---- } ! public Query setEntity(String name, Object val) { ! setParameter( name, val, Hibernate.association( HibernateProxyHelper.getClass(val) ) ); return this; } *************** *** 322,327 **** private Type guessType(Object param) throws HibernateException { ! param = HibernateProxyHelper.unproxy(param, session); ! Class clazz = param.getClass(); return guessType(clazz); } --- 320,324 ---- private Type guessType(Object param) throws HibernateException { ! Class clazz = HibernateProxyHelper.getClass(param); return guessType(clazz); } *************** *** 397,401 **** public Query setProperties(Object bean) throws HibernateException { - bean = HibernateProxyHelper.unproxy(bean, session); Class clazz = bean.getClass(); Iterator iter = session.getFactory().getNamedParameters(queryString).iterator(); --- 394,397 ---- Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** SessionImpl.java 8 Mar 2003 06:31:22 -0000 1.25 --- SessionImpl.java 13 Mar 2003 03:16:01 -0000 1.26 *************** *** 27,30 **** --- 27,31 ---- import net.sf.hibernate.Criteria; import net.sf.hibernate.FlushMode; + import net.sf.hibernate.Hibernate; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Interceptor; *************** *** 1027,1030 **** --- 1028,1032 ---- if (obj==null) throw new NullPointerException("attempted to update null"); + if ( !Hibernate.isInitialized(obj) ) return; Object object = HibernateProxyHelper.unproxy(obj, this); *************** *** 1062,1065 **** --- 1064,1068 ---- public void saveOrUpdate(Object obj) throws HibernateException { if (obj==null) throw new NullPointerException("attempted to update null"); + if ( !Hibernate.isInitialized(obj) ) return; Object object = HibernateProxyHelper.unproxy(obj, this); *************** *** 1119,1122 **** --- 1122,1126 ---- if (id==null) throw new NullPointerException("null is not a valid identifier"); if (obj==null) throw new NullPointerException("attempted to update null"); + if ( !Hibernate.isInitialized(obj) ) return; Object object = HibernateProxyHelper.unproxy(obj, this); *************** *** 1754,1757 **** --- 1758,1765 ---- public void refresh(Object object) throws HibernateException { + refresh(object, LockMode.READ); + } + + public void refresh(Object object, LockMode lockMode) throws HibernateException { if (object==null) throw new NullPointerException("attempted to refresh null"); *************** *** 1764,1768 **** removeEntity( new Key(e.id, e.persister) ); try { ! e.persister.load( e.id, object, LockMode.READ, this); } catch (SQLException sqle) { --- 1772,1776 ---- removeEntity( new Key(e.id, e.persister) ); try { ! e.persister.load( e.id, object, lockMode, this); } catch (SQLException sqle) { |
From: <one...@us...> - 2003-03-13 03:16:21
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv27048/sf/hibernate/test Modified Files: FooBarTest.java Log Message: improved handing of proxies in QueryImpl don't initialize proxies in update() or saveOrUpdate() added Session.refresh(Object, LockMode) Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** FooBarTest.java 12 Mar 2003 08:24:24 -0000 1.41 --- FooBarTest.java 13 Mar 2003 03:16:02 -0000 1.42 *************** *** 59,62 **** --- 59,83 ---- } + public void testEmptyCollection() throws Exception { + Session s = sessions.openSession(); + Serializable id = s.save( new Baz() ); + s.flush(); + s.connection().commit(); + s.close(); + s = sessions.openSession(); + Baz baz = (Baz) s.load(Baz.class, id); + Set foos = baz.getFooSet(); + assertTrue( foos.size()==0 ); + Foo foo = new Foo(); + foos.add(foo); + s.save(foo); + s.flush(); + s.delete(foo); + s.delete(baz); + s.flush(); + s.connection().commit(); + s.close(); + } + public void testNamedParams() throws Exception { Bar bar = new Bar(); |
From: <one...@us...> - 2003-03-13 03:16:21
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca In directory sc8-pr-cvs1:/tmp/cvs-serv27048/sf/hibernate/jca Modified Files: JCASessionImpl.java Log Message: improved handing of proxies in QueryImpl don't initialize proxies in update() or saveOrUpdate() added Session.refresh(Object, LockMode) Index: JCASessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jca/JCASessionImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JCASessionImpl.java 8 Mar 2003 09:53:35 -0000 1.3 --- JCASessionImpl.java 13 Mar 2003 03:16:01 -0000 1.4 *************** *** 249,251 **** --- 249,255 ---- } + public void refresh(Object object, LockMode lockMode) throws HibernateException { + session.refresh(object, lockMode); + } + } |
From: <one...@us...> - 2003-03-13 03:16:21
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy In directory sc8-pr-cvs1:/tmp/cvs-serv27048/sf/hibernate/proxy Modified Files: HibernateProxyHelper.java Log Message: improved handing of proxies in QueryImpl don't initialize proxies in update() or saveOrUpdate() added Session.refresh(Object, LockMode) Index: HibernateProxyHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/HibernateProxyHelper.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HibernateProxyHelper.java 15 Feb 2003 08:00:52 -0000 1.5 --- HibernateProxyHelper.java 13 Mar 2003 03:16:01 -0000 1.6 *************** *** 29,32 **** --- 29,43 ---- } + public static Class getClass(Object object) { + if (object instanceof HibernateProxy) { + HibernateProxy proxy = (HibernateProxy) object; + LazyInitializer li = getLazyInitializer(proxy); + return li.getPersistentClass(); + } + else { + return object.getClass(); + } + } + private HibernateProxyHelper() { //cant instantiate |
From: <one...@us...> - 2003-03-13 03:16:21
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv27048/sf/hibernate Modified Files: Query.java Session.java Log Message: improved handing of proxies in QueryImpl don't initialize proxies in update() or saveOrUpdate() added Session.refresh(Object, LockMode) Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Query.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Query.java 12 Mar 2003 12:28:58 -0000 1.10 --- Query.java 13 Mar 2003 03:15:59 -0000 1.11 *************** *** 253,257 **** * @param val a non-null instance of a persistent class */ ! public Query setEntity(int position, Object val) throws HibernateException; // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. --- 253,257 ---- * @param val a non-null instance of a persistent class */ ! public Query setEntity(int position, Object val); // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. *************** *** 267,271 **** * @param val a non-null instance of a persistent class */ ! public Query setEntity(String name, Object val) throws HibernateException; // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. --- 267,271 ---- * @param val a non-null instance of a persistent class */ ! public Query setEntity(String name, Object val); // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Session.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Session.java 9 Mar 2003 04:04:05 -0000 1.11 --- Session.java 13 Mar 2003 03:16:00 -0000 1.12 *************** *** 445,448 **** --- 445,460 ---- /** + * Re-read the state of the given instance from the underlying database, with + * the given <tt>LockMode</tt>. It is inadvisable to use this to implement + * long-running sessions that span many business tasks. This method is, however, + * useful in certain special circumstances. + * + * @param object a persistent instance + * @param lockMode the lock mode to use + * @throws HibernateException + */ + public void refresh(Object object, LockMode lockMode) throws HibernateException; + + /** * Determine the current lock mode of the given object * |
From: <one...@us...> - 2003-03-13 02:52:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv18853/hibernate/test Modified Files: FooBarTest.java Log Message: better handling of proxies in QueryImpl Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v retrieving revision 1.241 retrieving revision 1.242 diff -C2 -d -r1.241 -r1.242 *** FooBarTest.java 19 Feb 2003 12:43:24 -0000 1.241 --- FooBarTest.java 13 Mar 2003 02:52:20 -0000 1.242 *************** *** 47,50 **** --- 47,71 ---- } + public void testEmptyCollection() throws Exception { + Session s = sessions.openSession(); + Serializable id = s.save( new Baz() ); + s.flush(); + s.connection().commit(); + s.close(); + s = sessions.openSession(); + Baz baz = (Baz) s.load(Baz.class, id); + Set foos = baz.getFooSet(); + assertTrue( foos.size()==0 ); + Foo foo = new Foo(); + foos.add(foo); + s.save(foo); + s.flush(); + s.delete(foo); + s.delete(baz); + s.flush(); + s.connection().commit(); + s.close(); + } + public void testAssociationId() throws Exception { Session s = sessions.openSession(); |
From: <one...@us...> - 2003-03-13 02:52:23
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/proxy In directory sc8-pr-cvs1:/tmp/cvs-serv18853/hibernate/proxy Modified Files: HibernateProxyHelper.java Log Message: better handling of proxies in QueryImpl Index: HibernateProxyHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/proxy/HibernateProxyHelper.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HibernateProxyHelper.java 2 Nov 2002 14:32:13 -0000 1.5 --- HibernateProxyHelper.java 13 Mar 2003 02:52:20 -0000 1.6 *************** *** 27,30 **** --- 27,41 ---- } + public static Class getClass(Object object) { + if (object instanceof HibernateProxy) { + HibernateProxy proxy = (HibernateProxy) object; + LazyInitializer li = getLazyInitializer(proxy); + return li.getPersistentClass(); + } + else { + return object.getClass(); + } + } + public static LazyInitializer getLazyInitializer(HibernateProxy proxy) { return (LazyInitializer) Enhancer.getMethodInterceptor(proxy); |
From: <one...@us...> - 2003-03-13 02:52:22
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv18853/hibernate/impl Modified Files: QueryImpl.java Log Message: better handling of proxies in QueryImpl Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/QueryImpl.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** QueryImpl.java 12 Mar 2003 12:40:52 -0000 1.25 --- QueryImpl.java 13 Mar 2003 02:52:19 -0000 1.26 *************** *** 158,164 **** } ! public void setEntity(int position, Object val) throws HibernateException, SQLException { ! val = HibernateProxyHelper.unproxy(val, session); ! setParameter( position, val, Hibernate.association( val.getClass() ) ); } --- 158,163 ---- } ! public void setEntity(int position, Object val) { ! setParameter( position, val, Hibernate.association( HibernateProxyHelper.getClass(val) ) ); } *************** *** 203,209 **** } ! public void setEntity(String name, Object val) throws HibernateException, SQLException { ! val = HibernateProxyHelper.unproxy(val, session); ! setParameter( name, val, Hibernate.association( val.getClass() ) ); } --- 202,207 ---- } ! public void setEntity(String name, Object val) { ! setParameter( name, val, Hibernate.association( HibernateProxyHelper.getClass(val) ) ); } *************** *** 268,282 **** } ! public void setParameter(int position, Object val) throws HibernateException, SQLException { setParameter( position, val, guessType(val) ); } ! public void setParameter(String name, Object val) throws HibernateException, SQLException { setParameter( name, val, guessType(val) ); } ! private Type guessType(Object param) throws HibernateException, SQLException { ! param = HibernateProxyHelper.unproxy(param, session); ! Class clazz = param.getClass(); return guessType(clazz); } --- 266,279 ---- } ! public void setParameter(int position, Object val) throws HibernateException { setParameter( position, val, guessType(val) ); } ! public void setParameter(String name, Object val) throws HibernateException { setParameter( name, val, guessType(val) ); } ! private Type guessType(Object param) throws HibernateException { ! Class clazz = HibernateProxyHelper.getClass(param); return guessType(clazz); } *************** *** 333,337 **** public void setProperties(Object bean) throws HibernateException, SQLException { - bean = HibernateProxyHelper.unproxy(bean, session); Class clazz = bean.getClass(); Iterator iter = session.getFactory().getNamedParameters(queryString).iterator(); --- 330,333 ---- |
From: <one...@us...> - 2003-03-13 02:52:22
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv18853/hibernate Modified Files: Query.java Log Message: better handling of proxies in QueryImpl Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Query.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Query.java 12 Mar 2003 12:40:52 -0000 1.21 --- Query.java 13 Mar 2003 02:52:19 -0000 1.22 *************** *** 154,158 **** * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(int position, Object val) throws HibernateException, SQLException; /** * Bind a value to a named query parameter, guessing the Hibernate --- 154,158 ---- * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(int position, Object val) throws HibernateException; /** * Bind a value to a named query parameter, guessing the Hibernate *************** *** 162,166 **** * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(String name, Object val) throws HibernateException, SQLException; /** --- 162,166 ---- * @throws cirrus.hibernate.HibernateException if no type could be determined */ ! public void setParameter(String name, Object val) throws HibernateException; /** *************** *** 238,242 **** * @param val a non-null instance of a persistent class */ ! public void setEntity(int position, Object val) throws HibernateException, SQLException; // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. --- 238,242 ---- * @param val a non-null instance of a persistent class */ ! public void setEntity(int position, Object val); // use setParameter for null values /** * Bind an instance of a persistent enumeration class to a JDBC-style query parameter. *************** *** 252,256 **** * @param val a non-null instance of a persistent class */ ! public void setEntity(String name, Object val) throws HibernateException, SQLException; // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. --- 252,256 ---- * @param val a non-null instance of a persistent class */ ! public void setEntity(String name, Object val); // use setParameter for null values /** * Bind an instance of a mapped persistent enumeration class to a named query parameter. |
From: <one...@us...> - 2003-03-12 12:40:56
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv31825/cirrus/hibernate/impl Modified Files: QueryImpl.java Log Message: Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing types) Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/QueryImpl.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** QueryImpl.java 31 Jan 2003 08:50:49 -0000 1.24 --- QueryImpl.java 12 Mar 2003 12:40:52 -0000 1.25 *************** *** 25,28 **** --- 25,30 ---- import cirrus.hibernate.helpers.ReflectHelper; import cirrus.hibernate.helpers.StringHelper; + import cirrus.hibernate.proxy.HibernateProxyHelper; + import cirrus.hibernate.type.SerializableType; import cirrus.hibernate.type.Type; import cirrus.hibernate.type.TypeFactory; *************** *** 156,160 **** } ! public void setEntity(int position, Object val) { setParameter( position, val, Hibernate.association( val.getClass() ) ); } --- 158,163 ---- } ! public void setEntity(int position, Object val) throws HibernateException, SQLException { ! val = HibernateProxyHelper.unproxy(val, session); setParameter( position, val, Hibernate.association( val.getClass() ) ); } *************** *** 200,204 **** } ! public void setEntity(String name, Object val) { setParameter( name, val, Hibernate.association( val.getClass() ) ); } --- 203,208 ---- } ! public void setEntity(String name, Object val) throws HibernateException, SQLException { ! val = HibernateProxyHelper.unproxy(val, session); setParameter( name, val, Hibernate.association( val.getClass() ) ); } *************** *** 264,276 **** } ! public void setParameter(int position, Object val) throws HibernateException { setParameter( position, val, guessType(val) ); } ! public void setParameter(String name, Object val) throws HibernateException { setParameter( name, val, guessType(val) ); } ! private Type guessType(Object param) throws HibernateException { Class clazz = param.getClass(); return guessType(clazz); --- 268,281 ---- } ! public void setParameter(int position, Object val) throws HibernateException, SQLException { setParameter( position, val, guessType(val) ); } ! public void setParameter(String name, Object val) throws HibernateException, SQLException { setParameter( name, val, guessType(val) ); } ! private Type guessType(Object param) throws HibernateException, SQLException { ! param = HibernateProxyHelper.unproxy(param, session); Class clazz = param.getClass(); return guessType(clazz); *************** *** 280,293 **** String typename = clazz.getName(); Type type = TypeFactory.hueristicType(typename); ! if (type==null ) { try { session.getFactory().getPersister(clazz); } catch (MappingException me) { ! throw new HibernateException("Could not determine a type for class: " + typename); } ! type = Hibernate.association(clazz); } - return type; } --- 285,306 ---- String typename = clazz.getName(); Type type = TypeFactory.hueristicType(typename); ! boolean serializable = type!=null && type instanceof SerializableType; ! if (type==null || serializable) { try { session.getFactory().getPersister(clazz); } catch (MappingException me) { ! if (serializable) { ! return type; ! } ! else { ! throw new HibernateException("Could not determine a type for class: " + typename); ! } } ! return Hibernate.association(clazz); ! } ! else { ! return type; } } *************** *** 311,315 **** } ! public void setParameterList(String name, Collection vals) throws HibernateException { setParameterList(name, vals, guessType( vals.iterator().next() ) ); } --- 324,328 ---- } ! public void setParameterList(String name, Collection vals) throws HibernateException, SQLException { setParameterList(name, vals, guessType( vals.iterator().next() ) ); } *************** *** 319,323 **** } ! public void setProperties(Object bean) throws HibernateException { Class clazz = bean.getClass(); Iterator iter = session.getFactory().getNamedParameters(queryString).iterator(); --- 332,337 ---- } ! public void setProperties(Object bean) throws HibernateException, SQLException { ! bean = HibernateProxyHelper.unproxy(bean, session); Class clazz = bean.getClass(); Iterator iter = session.getFactory().getNamedParameters(queryString).iterator(); |
From: <one...@us...> - 2003-03-12 12:40:55
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/odmg In directory sc8-pr-cvs1:/tmp/cvs-serv31825/cirrus/hibernate/odmg Modified Files: OQLQuery.java Log Message: Query.setEntity(), etc, now aware of proxies (also improved hueristics for guessing types) Index: OQLQuery.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/odmg/OQLQuery.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OQLQuery.java 26 Nov 2002 03:35:43 -0000 1.5 --- OQLQuery.java 12 Mar 2003 12:40:52 -0000 1.6 *************** *** 7,11 **** public OQLQuery(Database db) { this.tx = db.currentTransaction(); } /** * Instantiate an <tt>OQLQuery</tt> for the given transaction. */ public OQLQuery(Transaction tx) { this.tx = tx; } /** * Instantiate an <tt>OQLQuery</tt> for the current transaction. */ public OQLQuery() { this.tx = (Transaction) Implementation.getInstance().currentTransaction(); } /** * Get the underlying Hibernate <tt>Query</tt>. */ public Query getQuery() { return query; } /** * Set the HIbernate query string. Scalar return values are not supported. * @see org.odmg.OQLQuery#create(String) */ public void create(String queryString) throws QueryInvalidException { //TODO: the right exception try { this.query = tx.getSession().createQuery(queryString); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } ! /** * Bind a value to the next <tt>?</tt> style parameter. * @see org.odmg.OQLQuery#bind(Object) */ public void bind(Object parameter) throws QueryParameterCountInvalidException, QueryParameterTypeInvalidException { //TODO: the right exception try { query.setParameter(param++, parameter); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } /** * Get the query results as a collection. * @see org.odmg.OQLQuery#execute() */ public Object execute() throws QueryException { //TODO: how are results meant to be returned in ODMG? try { return query.list(); } catch (SQLException sqle) { throw new QueryException( sqle.getMessage() ); } catch (HibernateException he) { throw new QueryException( he.getMessage() ); } } } --- 7,11 ---- public OQLQuery(Database db) { this.tx = db.currentTransaction(); } /** * Instantiate an <tt>OQLQuery</tt> for the given transaction. */ public OQLQuery(Transaction tx) { this.tx = tx; } /** * Instantiate an <tt>OQLQuery</tt> for the current transaction. */ public OQLQuery() { this.tx = (Transaction) Implementation.getInstance().currentTransaction(); } /** * Get the underlying Hibernate <tt>Query</tt>. */ public Query getQuery() { return query; } /** * Set the HIbernate query string. Scalar return values are not supported. * @see org.odmg.OQLQuery#create(String) */ public void create(String queryString) throws QueryInvalidException { //TODO: the right exception try { this.query = tx.getSession().createQuery(queryString); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } ! /** * Bind a value to the next <tt>?</tt> style parameter. * @see org.odmg.OQLQuery#bind(Object) */ public void bind(Object parameter) throws QueryParameterCountInvalidException, QueryParameterTypeInvalidException { //TODO: the right exception try { query.setParameter(param++, parameter); } catch (Exception e) { throw new ODMGRuntimeException( e.getMessage() ); } } /** * Get the query results as a collection. * @see org.odmg.OQLQuery#execute() */ public Object execute() throws QueryException { //TODO: how are results meant to be returned in ODMG? try { return query.list(); } catch (SQLException sqle) { throw new QueryException( sqle.getMessage() ); } catch (HibernateException he) { throw new QueryException( he.getMessage() ); } } } |