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-02-03 12:11:41
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv6186/sf/hibernate/impl Modified Files: SessionFactoryImpl.java Log Message: minor changes and fixed a mistype Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SessionFactoryImpl.java 26 Jan 2003 01:33:35 -0000 1.7 --- SessionFactoryImpl.java 3 Feb 2003 12:11:36 -0000 1.8 *************** *** 114,120 **** private static final Log log = LogFactory.getLog(SessionFactoryImpl.class); ! public SessionFactoryImpl(Configuration datastore, Properties properties, Interceptor interceptor) throws HibernateException { ! log.trace("Instantiating session factory"); this.interceptor = interceptor; --- 114,120 ---- private static final Log log = LogFactory.getLog(SessionFactoryImpl.class); ! public SessionFactoryImpl(Configuration cfg, Properties properties, Interceptor interceptor) throws HibernateException { ! if ( log.isDebugEnabled() ) log.debug("instantiating session factory with properties: " + properties); this.interceptor = interceptor; *************** *** 189,193 **** classPersisters = new HashMap(); classPersistersByName = new HashMap(); ! iter = datastore.getClassMappings(); while ( iter.hasNext() ) { PersistentClass model = (PersistentClass) iter.next(); --- 189,193 ---- classPersisters = new HashMap(); classPersistersByName = new HashMap(); ! iter = cfg.getClassMappings(); while ( iter.hasNext() ) { PersistentClass model = (PersistentClass) iter.next(); *************** *** 208,217 **** collectionPersisters = new HashMap(); ! iter = datastore.getCollectionMappings(); while ( iter.hasNext() ) { Collection map = (Collection) iter.next(); collectionPersisters.put( map.getRole(), ! new CollectionPersister(map, datastore, this) ); } --- 208,217 ---- collectionPersisters = new HashMap(); ! iter = cfg.getCollectionMappings(); while ( iter.hasNext() ) { Collection map = (Collection) iter.next(); collectionPersisters.put( map.getRole(), ! new CollectionPersister(map, cfg, this) ); } *************** *** 276,280 **** // TODO: precompile queries }*/ ! namedQueries = datastore.getNamedQueries(); --- 276,280 ---- // TODO: precompile queries }*/ ! namedQueries = cfg.getNamedQueries(); |
From: <one...@us...> - 2003-02-03 12:11:41
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv6186/sf/hibernate/cfg Modified Files: Configuration.java Environment.java Mappings.java Log Message: minor changes and fixed a mistype Index: Configuration.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Configuration.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Configuration.java 2 Feb 2003 00:29:06 -0000 1.13 --- Configuration.java 3 Feb 2003 12:11:36 -0000 1.14 *************** *** 715,719 **** pc.setCache( createJCSCache( atts.getNamedItem("usage").getNodeValue(), region, pc ) ); } ! else if ( "jcs-ccollection-cache".equals( mapElement.getNodeName() ) ) { String role = atts.getNamedItem("collection").getNodeValue(); Collection c = (Collection) getCollectionMapping(role); --- 715,719 ---- pc.setCache( createJCSCache( atts.getNamedItem("usage").getNodeValue(), region, pc ) ); } ! else if ( "jcs-collection-cache".equals( mapElement.getNodeName() ) ) { String role = atts.getNamedItem("collection").getNodeValue(); Collection c = (Collection) getCollectionMapping(role); Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Environment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Environment.java 2 Feb 2003 06:47:06 -0000 1.2 --- Environment.java 3 Feb 2003 12:11:36 -0000 1.3 *************** *** 38,42 **** public final class Environment { ! private static final String VERSION = "2.0 beta 2"; /** --- 38,42 ---- public final class Environment { ! private static final String VERSION = "2.0 beta 3"; /** Index: Mappings.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Mappings.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Mappings.java 2 Feb 2003 00:29:06 -0000 1.3 --- Mappings.java 3 Feb 2003 12:11:36 -0000 1.4 *************** *** 40,48 **** public void addClass(PersistentClass persistentClass) throws MappingException { Object old = classes.put( persistentClass.getPersistentClass(), persistentClass ); ! if ( old!=null ) throw new MappingException( "duplicate class mapping: " + persistentClass.getPersistentClass().getName() ); } public void addCollection(Collection collection) throws MappingException { Object old = collections.put( collection.getRole(), collection ); ! if ( old!=null ) throw new MappingException( "duplicate collection role: " + collection.getRole() ); } public PersistentClass getClass(Class clazz) { --- 40,48 ---- public void addClass(PersistentClass persistentClass) throws MappingException { Object old = classes.put( persistentClass.getPersistentClass(), persistentClass ); ! if ( old!=null ) log.warn( "duplicate class mapping: " + persistentClass.getPersistentClass().getName() ); } public void addCollection(Collection collection) throws MappingException { Object old = collections.put( collection.getRole(), collection ); ! if ( old!=null ) log.warn( "duplicate collection role: " + collection.getRole() ); } public PersistentClass getClass(Class clazz) { *************** *** 99,103 **** public void addQuery(String name, String query) throws MappingException { Object old = queries.put(name, query); ! if (old!=null) throw new MappingException("duplicate query name: " + name); } --- 99,103 ---- public void addQuery(String name, String query) throws MappingException { Object old = queries.put(name, query); ! if (old!=null) log.warn("duplicate query name: " + name); } |
From: <one...@us...> - 2003-02-03 12:11:41
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv6186/sf/hibernate/test Modified Files: TestCase.java Log Message: minor changes and fixed a mistype Index: TestCase.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/TestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestCase.java 26 Jan 2003 01:33:36 -0000 1.4 --- TestCase.java 3 Feb 2003 12:11:37 -0000 1.5 *************** *** 22,36 **** public static void exportSchema(String[] files) throws Exception { ! Configuration ds = new Configuration(); for (int i=0; i<files.length; i++) { ! ds.addResource( "net/sf/hibernate/test/" + files[i], TestCase.class.getClassLoader() ); } dialect = Dialect.getDialect(); ! new SchemaExport(ds).create(true, true); ! sessions = ds.buildSessionFactory( /*new TestInterceptor()*/ ); } --- 22,36 ---- public static void exportSchema(String[] files) throws Exception { ! Configuration cfg = new Configuration(); for (int i=0; i<files.length; i++) { ! cfg.addResource( "net/sf/hibernate/test/" + files[i], TestCase.class.getClassLoader() ); } dialect = Dialect.getDialect(); ! new SchemaExport(cfg).create(true, true); ! sessions = cfg.buildSessionFactory( /*new TestInterceptor()*/ ); } |
From: <one...@us...> - 2003-02-03 10:28:51
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv20343/hibernate/loader Modified Files: Loader.java Log Message: added warning in custom type made <parent> proxy-aware Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Loader.java 28 Jan 2003 10:22:20 -0000 1.9 --- Loader.java 3 Feb 2003 10:28:47 -0000 1.10 *************** *** 262,269 **** else { // instantiate a new instance ! object = session.instantiate( ! session.getFactory().getPersister(instanceClass), ! key.getIdentifier() ! ); } --- 262,266 ---- else { // instantiate a new instance ! object = session.instantiate( instanceClass, key.getIdentifier() ); } |
From: <one...@us...> - 2003-02-03 10:28:51
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv20343/hibernate/type Modified Files: AbstractComponentType.java ComponentType.java CustomType.java DynaBeanType.java Log Message: added warning in custom type made <parent> proxy-aware Index: AbstractComponentType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/AbstractComponentType.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractComponentType.java 19 Jan 2003 11:47:08 -0000 1.4 --- AbstractComponentType.java 3 Feb 2003 10:28:48 -0000 1.5 *************** *** 15,19 **** public void setPropertyValues(Object component, Object[] values) throws HibernateException; public Object getPropertyValue(Object component, int i) throws HibernateException; ! public Object instantiate(Object parent) throws HibernateException; public Cascades.CascadeStyle cascade(int i); public int enableJoinedFetch(int i); --- 15,19 ---- public void setPropertyValues(Object component, Object[] values) throws HibernateException; public Object getPropertyValue(Object component, int i) throws HibernateException; ! //public Object instantiate(Object parent, SessionImplementor session) throws HibernateException; public Cascades.CascadeStyle cascade(int i); public int enableJoinedFetch(int i); Index: ComponentType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/ComponentType.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ComponentType.java 2 Feb 2003 04:19:52 -0000 1.6 --- ComponentType.java 3 Feb 2003 10:28:48 -0000 1.7 *************** *** 128,132 **** if (notNull) { ! Object result = instantiate(owner); for ( int i=0; i<propertySpan; i++ ) { setters[i].set( result, values[i] ); --- 128,132 ---- if (notNull) { ! Object result = instantiate(owner, session); for ( int i=0; i<propertySpan; i++ ) { setters[i].set( result, values[i] ); *************** *** 201,217 **** values[i] = types[i].deepCopy( values[i] ); } ! Object result = instantiate(null); //TODO: note that this doesn't copy reference to parent. Is that okay?? setPropertyValues(result, values); return result; } ! public Object instantiate(Object parent) throws HibernateException { try { ! Object inst = constructor.newInstance(null); ! if (parentSetter!=null && parent!=null) parentSetter.set(inst, parent); ! return inst; } catch (Exception e) { ! throw new InstantiationException("Could not instantiate component ", componentClass, e); } } --- 201,226 ---- values[i] = types[i].deepCopy( values[i] ); } ! Object result = instantiate(); //TODO: note that this doesn't copy reference to parent. Is that okay?? setPropertyValues(result, values); return result; } ! public Object instantiate() throws HibernateException { try { ! return constructor.newInstance(null); } catch (Exception e) { ! throw new InstantiationException("Could not instantiate component: ", componentClass, e); ! } ! } ! ! public Object instantiate(Object parent, SessionImplementor session) throws HibernateException { ! Object result = instantiate(); ! try { ! if (parentSetter!=null && parent!=null) parentSetter.set( result, session.proxyFor(parent) ); ! return result; ! } ! catch (Exception e) { ! throw new InstantiationException("Could not set component parent for: ", componentClass, e); } } *************** *** 250,254 **** assembled[i] = types[i].assemble( (Serializable) values[i], session, owner ); } ! Object result = instantiate(owner); setPropertyValues(result, assembled); return result; --- 259,263 ---- assembled[i] = types[i].assemble( (Serializable) values[i], session, owner ); } ! Object result = instantiate(); setPropertyValues(result, assembled); return result; Index: CustomType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/CustomType.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CustomType.java 25 Jan 2003 01:26:07 -0000 1.5 --- CustomType.java 3 Feb 2003 10:28:48 -0000 1.6 *************** *** 2,9 **** --- 2,12 ---- package net.sf.hibernate.type; + import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; + import org.apache.commons.logging.LogFactory; + import net.sf.hibernate.HibernateException; import net.sf.hibernate.MappingException; *************** *** 26,30 **** --- 29,35 ---- public CustomType(Class userTypeClass) throws MappingException { + name = userTypeClass.getName(); + try { userType = (UserType) userTypeClass.newInstance(); *************** *** 40,43 **** --- 45,53 ---- } types = userType.sqlTypes(); + + if ( !Serializable.class.isAssignableFrom( userType.returnedClass() ) ) { + LogFactory.getLog(CustomType.class).warn("custom type does not implement Serializable: " + userTypeClass); + } + } Index: DynaBeanType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/DynaBeanType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DynaBeanType.java 2 Feb 2003 04:19:52 -0000 1.2 --- DynaBeanType.java 3 Feb 2003 10:28:48 -0000 1.3 *************** *** 95,99 **** * @see net.sf.hibernate.type.AbstractComponentType#instantiate(java.lang.Object) */ ! public Object instantiate(Object parent) throws HibernateException { try { return clazz.newInstance(); --- 95,99 ---- * @see net.sf.hibernate.type.AbstractComponentType#instantiate(java.lang.Object) */ ! public Object instantiate() throws HibernateException { try { return clazz.newInstance(); *************** *** 125,129 **** values[i] = propertyTypes[i].deepCopy( values[i] ); } ! Object result = instantiate(null); //TODO: note that this doesn't copy reference to parent. Is that okay?? setPropertyValues(result, values); return result; --- 125,129 ---- values[i] = propertyTypes[i].deepCopy( values[i] ); } ! Object result = instantiate(); //TODO: note that this doesn't copy reference to parent. Is that okay?? setPropertyValues(result, values); return result; *************** *** 231,235 **** if (notNull) { ! DynaBean result = (DynaBean) instantiate(owner); for ( int i=0; i<propertySpan; i++ ) { result.set( propertyNames[i], values[i] ); --- 231,235 ---- if (notNull) { ! DynaBean result = (DynaBean) instantiate(); for ( int i=0; i<propertySpan; i++ ) { result.set( propertyNames[i], values[i] ); |
From: <one...@us...> - 2003-02-03 10:28:51
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv20343/hibernate/test Modified Files: FooBarTest.java FooComponent.java Log Message: added warning in custom type made <parent> proxy-aware Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** FooBarTest.java 1 Feb 2003 10:42:29 -0000 1.18 --- FooBarTest.java 3 Feb 2003 10:28:47 -0000 1.19 *************** *** 107,110 **** --- 107,133 ---- } + public void testComponentParent() throws Exception { + Session s = sessions.openSession(); + Transaction t = s.beginTransaction(); + Bar bar = new Bar(); + bar.setBarComponent( new FooComponent() ); + Baz baz = new Baz(); + baz.setComponents( new FooComponent[] { new FooComponent(), new FooComponent() } ); + s.save(bar); + s.save(baz); + t.commit(); + s.close(); + s = sessions.openSession(); + t = s.beginTransaction(); + bar = (Bar) s.load(Bar.class, bar.getKey()); + s.load(baz, baz.getCode()); + assertTrue( bar.getBarComponent().getParent()==bar ); + assertTrue( baz.getComponents()[0].getBaz()==baz && baz.getComponents()[1].getBaz()==baz ); + s.delete(baz); + s.delete(bar); + t.commit(); + s.close(); + } + public void testAssociationId() throws Exception { Session s = sessions.openSession(); Index: FooComponent.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooComponent.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FooComponent.java 5 Jan 2003 02:11:23 -0000 1.4 --- FooComponent.java 3 Feb 2003 10:28:47 -0000 1.5 *************** *** 12,16 **** Fee fee = new Fee(); GlarchProxy glarch; ! private Foo parent; private Baz baz; --- 12,16 ---- Fee fee = new Fee(); GlarchProxy glarch; ! private FooProxy parent; private Baz baz; *************** *** 97,105 **** } ! public Foo getParent() { return parent; } ! public void setParent(Foo parent) { this.parent = parent; } --- 97,106 ---- } ! public FooProxy getParent() { return parent; } ! public void setParent(FooProxy parent) { ! if (parent==null) throw new RuntimeException("null parent set"); this.parent = parent; } |
From: <one...@us...> - 2003-02-03 10:28:50
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv20343/hibernate/engine Modified Files: SessionImplementor.java Log Message: added warning in custom type made <parent> proxy-aware Index: SessionImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionImplementor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SessionImplementor.java 28 Jan 2003 10:22:19 -0000 1.6 --- SessionImplementor.java 3 Feb 2003 10:28:46 -0000 1.7 *************** *** 136,140 **** * Must be called before <tt>postHydrate()</tt>. */ ! public void addUninitializedEntity(Key key, Object object, LockMode lockMode); /** * Register the "hydrated" state of an entity instance, after the first step of 2-phase loading --- 136,140 ---- * Must be called before <tt>postHydrate()</tt>. */ ! public void addUninitializedEntity(Key key, Object object, LockMode lockMode) throws HibernateException; /** * Register the "hydrated" state of an entity instance, after the first step of 2-phase loading *************** *** 155,158 **** --- 155,164 ---- */ public Object proxyFor(ClassPersister persister, Key key, Object impl) throws HibernateException; + /** + * Return the existing proxy associated with the given <tt>Key</tt>, or the + * second argument (the entity associated with the key) if no proxy exists. + * (slower than the form above) + */ + public Object proxyFor(Object impl) throws HibernateException; /** *************** *** 167,171 **** public Serializable getEntityIdentifier(Object obj); ! public Object instantiate(ClassPersister persister, Serializable id) throws HibernateException; } --- 173,177 ---- public Serializable getEntityIdentifier(Object obj); ! public Object instantiate(Class clazz, Serializable id) throws HibernateException; } |
From: <one...@us...> - 2003-02-03 10:28:50
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv20343/hibernate/impl Modified Files: SessionImpl.java Log Message: added warning in custom type made <parent> proxy-aware Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** SessionImpl.java 2 Feb 2003 04:19:51 -0000 1.16 --- SessionImpl.java 3 Feb 2003 10:28:47 -0000 1.17 *************** *** 1351,1354 **** --- 1351,1358 ---- } + public Object instantiate(Class clazz, Serializable id) throws HibernateException { + return instantiate( factory.getPersister(clazz), id ); + } + public Object instantiate(ClassPersister persister, Serializable id) throws HibernateException { Object result = interceptor.instantiate( persister.getMappedClass(), id ); *************** *** 1470,1476 **** } ! public void addUninitializedEntity(Key key, Object object, LockMode lockMode) { addEntity(key, object); ! addEntry( object, LOADING, null, key.getIdentifier(), null, lockMode, true, null ); //temporary } --- 1474,1487 ---- } ! public Object proxyFor(Object impl) throws HibernateException { ! EntityEntry e = getEntry(impl); ! //can't use e.persister since it is null after addUninitializedEntity (when this method is called) ! ClassPersister p = getPersister(impl); ! return proxyFor( p, new Key(e.id, p), impl); ! } ! ! public void addUninitializedEntity(Key key, Object object, LockMode lockMode) throws HibernateException { addEntity(key, object); ! addEntry( object, LOADING, null, key.getIdentifier(), null, lockMode, true, null /*getPersister(object)*/ ); //temporary } *************** *** 1739,1743 **** interceptor.onLoad( object, id, hydratedState, persister.getPropertyNames(), types ); ! for ( int i=0; i<hydratedState.length; i++ ) hydratedState[i] = types[i].resolveIdentifier( hydratedState[i], this ); persister.setPropertyValues(object, hydratedState); TypeFactory.deepCopy(hydratedState, persister.getPropertyTypes(), persister.getPropertyUpdateability(), hydratedState); //after setting values to object --- 1750,1756 ---- interceptor.onLoad( object, id, hydratedState, persister.getPropertyNames(), types ); ! for ( int i=0; i<hydratedState.length; i++ ) { ! hydratedState[i] = types[i].resolveIdentifier( hydratedState[i], this ); ! } persister.setPropertyValues(object, hydratedState); TypeFactory.deepCopy(hydratedState, persister.getPropertyTypes(), persister.getPropertyUpdateability(), hydratedState); //after setting values to object |
From: <max...@us...> - 2003-02-02 17:34:12
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv26669/src/net/sf/hibernate/tool/hbm2java Modified Files: Field.java ClassMapping.java BasicRenderer.java Log Message: toString() now also includes persistent fields from superclass. superclass'es fields comes first, subclasses last. Why ? Because the key is in the superclass, and we like the key first. + small cleanup Index: Field.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/Field.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Field.java 20 Jan 2003 12:48:16 -0000 1.5 --- Field.java 2 Feb 2003 17:34:09 -0000 1.6 *************** *** 62,65 **** --- 62,69 ---- } + public String getGetterType() { + return (getType().toLowerCase().equals("boolean") ) ? " is" : " get"; + } + public String getType() { String type = classType.getFullyQualifiedName(); *************** *** 124,128 **** Collection c= getMeta(attribute); ! if(c==null) { return StringHelper.EMPTY_STRING; } else { --- 128,132 ---- Collection c= getMeta(attribute); ! if(c==null || c.isEmpty()) { return StringHelper.EMPTY_STRING; } else { *************** *** 135,138 **** --- 139,152 ---- } } + + public boolean getMetaAsBool(String attribute) { + Collection c= getMeta(attribute); + + if(c==null || c.isEmpty()) { + return false; + } else { + return Boolean.valueOf(c.iterator().next().toString()).booleanValue(); + } + } /** * Returns the foreignClass. *************** *** 158,161 **** --- 172,183 ---- return foreignKeys; } + + /** + * Method getGetterSignature. + * @return String + */ + public String getGetterSignature() { + return getGetterType() + getAsSuffix() + "()"; + } } Index: ClassMapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/ClassMapping.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ClassMapping.java 2 Feb 2003 11:49:12 -0000 1.10 --- ClassMapping.java 2 Feb 2003 17:34:09 -0000 1.11 *************** *** 425,429 **** return result; } ! public List getAllFieldsForFullConstructor() { List result = getFieldsForSupersFullConstructor(); --- 425,442 ---- return result; } ! ! public List getAllFields() { ! List result = new ArrayList(); ! ! if(getSuperClassMapping()!=null) { ! result.addAll(getSuperClassMapping().getAllFields()); ! } else { ! result.addAll(getFields()); ! } ! return result; ! } ! ! ! public List getAllFieldsForFullConstructor() { List result = getFieldsForSupersFullConstructor(); Index: BasicRenderer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/BasicRenderer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BasicRenderer.java 2 Feb 2003 16:26:07 -0000 1.8 --- BasicRenderer.java 2 Feb 2003 17:34:09 -0000 1.9 *************** *** 118,228 **** writer.println(); ! // fields ! for ( Iterator fields = classMapping.getFields().iterator(); fields.hasNext(); ) { ! Field field = (Field) fields.next(); ! ! String fieldScope = getFieldScope(field, "scope-field", "private"); ! writer.println( ! " /** " + ! ( field.isNullable() && !field.isIdentifier() ? "nullable " : StringHelper.EMPTY_STRING ) + ! ( field.isIdentifier() ? "identifier" : "persistent" ) ! + " field */"); ! writer.println( ! " " + fieldScope + " " + ! shortenType( field.getType(), classMapping.getImports() ) + ! ' ' + ! field.getName() + ! ';' ! ); ! ! writer.println(); ! } ! ! // full constructor ! List allFieldsForFullConstructor = classMapping.getAllFieldsForFullConstructor(); ! ! writer.println(" /** full constructor */"); ! String fullCons = " public " + classMapping.getGeneratedName() + StringHelper.OPEN_PAREN; ! ! ! for(Iterator fields = allFieldsForFullConstructor.iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! fullCons = fullCons + shortenType(getTrueTypeName(field, class2classmap), classMapping.getImports()) + " " + field.getName(); ! if(fields.hasNext()) { ! fullCons = fullCons + ", "; ! } ! } ! ! writer.println(fullCons + ") {"); ! //invoke super to initialize superclass... ! List supersConstructorFields = classMapping.getFieldsForSupersFullConstructor(); ! if (!supersConstructorFields.isEmpty()) { ! writer.print(" super("); ! for (Iterator fields = supersConstructorFields.iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! writer.print(field.getName()); ! if(fields.hasNext()) { ! writer.print(StringHelper.COMMA_SPACE); ! } ! } ! writer.println(");"); ! } ! ! // initialisation of localfields ! for(Iterator fields = classMapping.getLocalFieldsForFullConstructor().iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! writer.println(" this." + field.getName() + " = " + field.getName() + ";"); ! } ! writer.println(" }"); ! writer.println(); ! ! // no args constructor (if fullconstructor had any arguments!) ! if (allFieldsForFullConstructor.size() > 0) { ! writer.println(" /** default constructor */"); ! writer.println(" public " + classMapping.getGeneratedName() + "() {"); ! writer.println(" }"); ! writer.println(); ! } ! ! // minimal constructor (only if the fullconstructor had any arguments) ! if ((allFieldsForFullConstructor.size() > 0) && classMapping.needsMinimalConstructor()) { ! ! List allFieldsForMinimalConstructor = classMapping.getAllFieldsForMinimalConstructor(); ! writer.println(" /** minimal constructor */"); ! ! String minCons = " public " + classMapping.getGeneratedName() + StringHelper.OPEN_PAREN; ! for (Iterator fields = allFieldsForMinimalConstructor.iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! minCons = minCons + shortenType(getTrueTypeName(field, class2classmap), classMapping.getImports()) + " " + field.getName(); ! if (fields.hasNext()) { ! minCons = minCons + ", "; ! } ! } ! ! writer.println(minCons + ") {"); ! // invoke super to initialize superclass... ! List supersMinConstructorFields = classMapping.getFieldsForSupersMinimalConstructor(); ! if (!supersMinConstructorFields.isEmpty()) { ! writer.print(" super("); ! for (Iterator fields = supersMinConstructorFields.iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! writer.print(field.getName()); ! if(fields.hasNext()) { ! writer.print(StringHelper.COMMA_SPACE); ! } ! } ! writer.println(");"); ! } ! // initialisation of localfields ! for (Iterator fields = classMapping.getLocalFieldsForMinimalConstructor().iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! writer.println(" this." + field.getName() + " = " + field.getName() + ";"); ! } ! writer.println(" }"); ! writer.println(); ! } ! ! doFieldAccessors(classMapping, class2classmap, writer); --- 118,125 ---- writer.println(); ! doFields(classMapping, writer); ! doConstructors(classMapping, class2classmap, writer); ! doFieldAccessors(classMapping, class2classmap, writer); *************** *** 241,244 **** --- 138,251 ---- } + public void doConstructors(ClassMapping classMapping, Map class2classmap, PrintWriter writer) { + // full constructor + List allFieldsForFullConstructor = classMapping.getAllFieldsForFullConstructor(); + + writer.println(" /** full constructor */"); + String fullCons = " public " + classMapping.getGeneratedName() + StringHelper.OPEN_PAREN; + + + for(Iterator fields = allFieldsForFullConstructor.iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + fullCons = fullCons + shortenType(getTrueTypeName(field, class2classmap), classMapping.getImports()) + " " + field.getName(); + if(fields.hasNext()) { + fullCons = fullCons + ", "; + } + } + + writer.println(fullCons + ") {"); + //invoke super to initialize superclass... + List supersConstructorFields = classMapping.getFieldsForSupersFullConstructor(); + if (!supersConstructorFields.isEmpty()) { + writer.print(" super("); + for (Iterator fields = supersConstructorFields.iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + writer.print(field.getName()); + if(fields.hasNext()) { + writer.print(StringHelper.COMMA_SPACE); + } + } + writer.println(");"); + } + + // initialisation of localfields + for(Iterator fields = classMapping.getLocalFieldsForFullConstructor().iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + writer.println(" this." + field.getName() + " = " + field.getName() + ";"); + } + writer.println(" }"); + writer.println(); + + // no args constructor (if fullconstructor had any arguments!) + if (allFieldsForFullConstructor.size() > 0) { + writer.println(" /** default constructor */"); + writer.println(" public " + classMapping.getGeneratedName() + "() {"); + writer.println(" }"); + writer.println(); + } + + // minimal constructor (only if the fullconstructor had any arguments) + if ((allFieldsForFullConstructor.size() > 0) && classMapping.needsMinimalConstructor()) { + + List allFieldsForMinimalConstructor = classMapping.getAllFieldsForMinimalConstructor(); + writer.println(" /** minimal constructor */"); + + String minCons = " public " + classMapping.getGeneratedName() + StringHelper.OPEN_PAREN; + for (Iterator fields = allFieldsForMinimalConstructor.iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + minCons = minCons + shortenType(getTrueTypeName(field, class2classmap), classMapping.getImports()) + " " + field.getName(); + if (fields.hasNext()) { + minCons = minCons + ", "; + } + } + + writer.println(minCons + ") {"); + // invoke super to initialize superclass... + List supersMinConstructorFields = classMapping.getFieldsForSupersMinimalConstructor(); + if (!supersMinConstructorFields.isEmpty()) { + writer.print(" super("); + for (Iterator fields = supersMinConstructorFields.iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + writer.print(field.getName()); + if(fields.hasNext()) { + writer.print(StringHelper.COMMA_SPACE); + } + } + writer.println(");"); + } + + // initialisation of localfields + for (Iterator fields = classMapping.getLocalFieldsForMinimalConstructor().iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + writer.println(" this." + field.getName() + " = " + field.getName() + ";"); + } + writer.println(" }"); + writer.println(); + } + } + + public void doFields(ClassMapping classMapping, PrintWriter writer) { + // fields + for ( Iterator fields = classMapping.getFields().iterator(); fields.hasNext(); ) { + Field field = (Field) fields.next(); + + String fieldScope = getFieldScope(field, "scope-field", "private"); + writer.println( + " /** " + + ( field.isNullable() && !field.isIdentifier() ? "nullable " : StringHelper.EMPTY_STRING ) + + ( field.isIdentifier() ? "identifier" : "persistent" ) + + " field */"); + writer.println( + " " + fieldScope + " " + + shortenType( field.getType(), classMapping.getImports() ) + + ' ' + + field.getName() + + ';' + ); + + writer.println(); + } + } + public void doEqualsAndHashCode(ClassMapping classMapping, PrintWriter writer) { if ( classMapping.mustImplementEquals() ) { *************** *** 275,282 **** writer.println(" public String toString() {"); writer.println(" return new ToStringBuilder(this)"); ! for (Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) { Field field = (Field) fields.next(); if (field.isIdentifier() || field.getMetaAsBool("use-in-tostring")) { ! writer.println(" .append(\"" + field.getName() + "\"," + field.getName() + ")"); } } --- 282,289 ---- writer.println(" public String toString() {"); writer.println(" return new ToStringBuilder(this)"); ! for (Iterator fields = classMapping.getAllFields().iterator(); fields.hasNext();) { Field field = (Field) fields.next(); if (field.isIdentifier() || field.getMetaAsBool("use-in-tostring")) { ! writer.println(" .append(\"" + field.getName() + "\", " + field.getGetterSignature() + ")"); } } *************** *** 294,303 **** // getter String getAccessScope = getFieldScope(field, "scope-get", "public"); ! String getterType = ( field.getType().toLowerCase().equals("boolean") ) ? " is" : " get"; if(field.getMeta("description")!=null) { writer.println(" /** \n" + toJavaDoc(field.getMetaAsString("description"), 4) + " */"); } ! writer.println(" " + getAccessScope + " " + getTrueTypeName(field, class2classmap) + getterType + field.getAsSuffix() + "() {"); writer.println(" return this." + field.getName() + ";"); writer.println(" }"); --- 301,310 ---- // getter String getAccessScope = getFieldScope(field, "scope-get", "public"); ! if(field.getMeta("description")!=null) { writer.println(" /** \n" + toJavaDoc(field.getMetaAsString("description"), 4) + " */"); } ! writer.println(" " + getAccessScope + " " + getTrueTypeName(field, class2classmap) + field.getGetterSignature() + " {"); writer.println(" return this." + field.getName() + ";"); writer.println(" }"); |
From: <max...@us...> - 2003-02-02 16:26:10
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv21450/src/net/sf/hibernate/tool/hbm2java Modified Files: BasicRenderer.java Log Message: Changed toString() generation to avoid possible stackoverflow in recursive models. hbm2java now only includes the primary key in the toString generation. If one wishes to include a certain property in the toString generation one can add <meta attribute="use-in-tostring">true</meta> to the field or set etc. Note: because of <meta> tag inheritance you can have all properties included by inserting the <meta> in the top of the mapping file instead of adding the tag to all properties. Note2: Current implementation does not include fields from the super class. Index: BasicRenderer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/BasicRenderer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BasicRenderer.java 1 Feb 2003 13:25:08 -0000 1.7 --- BasicRenderer.java 2 Feb 2003 16:26:07 -0000 1.8 *************** *** 227,264 **** doFieldAccessors(classMapping, class2classmap, writer); ! writer.println(); ! writer.println(" public String toString() {"); ! //easier to use reflectionToString() than worry about superclasses ! writer.println(" return ToStringBuilder.reflectionToString(this);"); ! writer.println(" }"); ! writer.println(); ! if ( classMapping.mustImplementEquals() ) { ! writer.println(" public boolean equals(Object other) {"); ! writer.println(" if ( !(other instanceof " + classMapping.getGeneratedName() + ") ) return false;"); ! writer.println(" " + classMapping.getGeneratedName() + " castOther = (" + classMapping.getGeneratedName() + ") other;"); ! writer.println(" return new EqualsBuilder()"); ! for (Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! if ( field.isIdentifier() ) { ! writer.println(" .append(this." + field.getName() + ", castOther." + field.getName() + StringHelper.CLOSE_PAREN); ! } ! } ! writer.println(" .isEquals();"); ! writer.println(" }"); ! writer.println(); ! ! writer.println(" public int hashCode() {"); ! writer.println(" return new HashCodeBuilder()"); ! for (Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) { ! Field field = (Field) fields.next(); ! if ( field.isIdentifier() ) { ! writer.println(" .append(" + field.getName() + StringHelper.CLOSE_PAREN); ! } ! } ! writer.println(" .toHashCode();"); ! writer.println(" }"); ! writer.println(); ! } writer.println("}"); --- 227,233 ---- doFieldAccessors(classMapping, class2classmap, writer); ! doToString(classMapping, writer); ! doEqualsAndHashCode(classMapping, writer); writer.println("}"); *************** *** 271,274 **** --- 240,289 ---- } + + public void doEqualsAndHashCode(ClassMapping classMapping, PrintWriter writer) { + if ( classMapping.mustImplementEquals() ) { + writer.println(" public boolean equals(Object other) {"); + writer.println(" if ( !(other instanceof " + classMapping.getGeneratedName() + ") ) return false;"); + writer.println(" " + classMapping.getGeneratedName() + " castOther = (" + classMapping.getGeneratedName() + ") other;"); + writer.println(" return new EqualsBuilder()"); + for (Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + if ( field.isIdentifier() ) { + writer.println(" .append(this." + field.getName() + ", castOther." + field.getName() + StringHelper.CLOSE_PAREN); + } + } + writer.println(" .isEquals();"); + writer.println(" }"); + writer.println(); + + writer.println(" public int hashCode() {"); + writer.println(" return new HashCodeBuilder()"); + for (Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + if ( field.isIdentifier() ) { + writer.println(" .append(" + field.getName() + StringHelper.CLOSE_PAREN); + } + } + writer.println(" .toHashCode();"); + writer.println(" }"); + writer.println(); + } + } + + public void doToString(ClassMapping classMapping, PrintWriter writer) { + + writer.println(" public String toString() {"); + writer.println(" return new ToStringBuilder(this)"); + for (Iterator fields = classMapping.getFields().iterator(); fields.hasNext();) { + Field field = (Field) fields.next(); + if (field.isIdentifier() || field.getMetaAsBool("use-in-tostring")) { + writer.println(" .append(\"" + field.getName() + "\"," + field.getName() + ")"); + } + } + writer.println(" .toString();"); + writer.println(" }"); + writer.println(); + + } public void doFieldAccessors(ClassMapping classMapping, Map class2classmap, PrintWriter writer) { |
From: <max...@us...> - 2003-02-02 11:49:15
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv10459/src/net/sf/hibernate/tool/hbm2java Modified Files: ClassMapping.java Log Message: hbm2java now check if a type is an UserType and uses the value of returnedClass() property instead of the acutal UserType name. (if it fails a warning is printed and it just uses the name of the UserType directly) Index: ClassMapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/ClassMapping.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ClassMapping.java 2 Feb 2003 04:48:27 -0000 1.9 --- ClassMapping.java 2 Feb 2003 11:49:12 -0000 1.10 *************** *** 12,18 **** --- 12,20 ---- import java.util.TreeSet; + import net.sf.hibernate.UserType; import net.sf.hibernate.type.TypeFactory; import net.sf.hibernate.type.PrimitiveType; import net.sf.hibernate.type.Type; + import net.sf.hibernate.util.ReflectHelper; import net.sf.hibernate.util.StringHelper; *************** *** 587,590 **** --- 589,594 ---- } else { + // check and resolve correct type if it is an usertype + hibernateType = getTypeForUserType(hibernateType); ClassName classType = new ClassName(); classType.setFullyQualifiedName(hibernateType); *************** *** 596,599 **** --- 600,641 ---- } + /** Returns name of returnedclass if type is an UserType **/ + private String getTypeForUserType(String type) { + Class clazz = null; + try { + clazz = ReflectHelper.classForName(type); + + if (UserType.class.isAssignableFrom(clazz)) { + UserType ut = (UserType) clazz.newInstance(); + log.debug("Resolved usertype: " + type + " to " + ut.returnedClass().getName()); + String t= clazzToName(ut.returnedClass()); + return t; + } + + } catch (ClassNotFoundException e) { + log.warn("Could not find UserType: " + type + ". Using the type '" + type + "' directly instead. (" + e.toString() +")"); + } catch (IllegalAccessException iae) { + log.warn("Error while trying to resolve UserType. Using the type '" + type + "' directly instead. (" + iae.toString() + ")"); + } catch (InstantiationException e) { + log.warn("Error while trying to resolve UserType. Using the type '" + type + "' directly instead. (" + e.toString() + ")"); + } + + return type; + + } + + private String clazzToName(Class cl) { + String s = null; + + if(cl.isArray()) { + s = clazzToName(cl.getComponentType()) + "[]"; + } else { + s = cl.getName(); + } + + return s; + + + } |
From: <one...@us...> - 2003-02-02 07:02:34
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/html In directory sc8-pr-cvs1:/tmp/cvs-serv31456/reference/html Modified Files: session-configuration.html Log Message: fixed dialect class names Index: session-configuration.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/session-configuration.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** session-configuration.html 28 Jan 2003 13:25:09 -0000 1.2 --- session-configuration.html 2 Feb 2003 07:02:31 -0000 1.3 *************** *** 6,10 **** relational database. These mappings are compiled from various XML mapping files. You may obtain a <tt>Configuration</tt> instance by ! instantiating it directly. Heres an example of setting up a datastore from mappings defined in two XML configuration files: </p><pre class="programlisting">Configuration cfg = new Configuration() --- 6,10 ---- relational database. These mappings are compiled from various XML mapping files. You may obtain a <tt>Configuration</tt> instance by ! instantiating it directly. Heres an example of setting up a datastore from mappings defined in two XML configuration files: </p><pre class="programlisting">Configuration cfg = new Configuration() *************** *** 36,42 **** using more than one database. </p><pre class="programlisting">SessionFactory sessions = cfg.buildSessionFactory();</pre></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s3"></a>User provided JDBC connection</h2></div></div><p> ! A <tt>SessionFactory</tt> may open a <tt>Session</tt> on ! a user-provided JDBC connection. This design choice frees the application to ! obtain JDBC connections wherever it pleases. The application must be careful not to open two concurrent sessions on the same connection. </p><pre class="programlisting">java.sql.Connection conn = datasource.getConnection(); --- 36,42 ---- using more than one database. </p><pre class="programlisting">SessionFactory sessions = cfg.buildSessionFactory();</pre></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s3"></a>User provided JDBC connection</h2></div></div><p> ! A <tt>SessionFactory</tt> may open a <tt>Session</tt> on ! a user-provided JDBC connection. This design choice frees the application to ! obtain JDBC connections wherever it pleases. The application must be careful not to open two concurrent sessions on the same connection. </p><pre class="programlisting">java.sql.Connection conn = datasource.getConnection(); *************** *** 68,72 **** <tt>hibernate.cfg.xml</tt> (see below). </p></li></ol></div><p> ! Hibernate will obtain (and pool) connections using <tt>java.sql.DriverManager</tt> if you set the following properties: </p><div class="itemizedlist"><ul type="disc"><li><p> --- 68,72 ---- <tt>hibernate.cfg.xml</tt> (see below). </p></li></ol></div><p> ! Hibernate will obtain (and pool) connections using <tt>java.sql.DriverManager</tt> if you set the following properties: </p><div class="itemizedlist"><ul type="disc"><li><p> *************** *** 89,93 **** level (optional)</i></span> </p></li><li><p> ! <tt>hibernate.connection.xxxx</tt> = <span class="emphasis"><i>pass the JDBC property <tt>xxxx</tt> to <tt>DriverManager.getConnection()</tt></i></span> </p></li></ul></div><p> --- 89,93 ---- level (optional)</i></span> </p></li><li><p> ! <tt>hibernate.connection.xxxx</tt> = <span class="emphasis"><i>pass the JDBC property <tt>xxxx</tt> to <tt>DriverManager.getConnection()</tt></i></span> </p></li></ul></div><p> *************** *** 123,134 **** </p><p> There is also built-in support for Apache DBCP connection pooling. You must set the ! properties <tt>hibernate.dbcp.*</tt> (DBCP connection pool properties) and ! <tt>hibernate.dbcp.ps.*</tt> (DBCP statement cache properties) to enable ! <tt>DBCPConnectionProvider</tt>. Please refer the the Apache commons-pool documentation for the interpretation of these properties. All Hibernate property names are defined on the class <tt>net.sf.hibernate.Environment</tt>. </p><p> For use inside an application server, Hibernate may obtain connections from a ! <tt>javax.sql.Datasource</tt> registered in JNDI. Set the following properties: </p><div class="itemizedlist"><ul type="disc"><li><p> --- 123,134 ---- </p><p> There is also built-in support for Apache DBCP connection pooling. You must set the ! properties <tt>hibernate.dbcp.*</tt> (DBCP connection pool properties) and ! <tt>hibernate.dbcp.ps.*</tt> (DBCP statement cache properties) to enable ! <tt>DBCPConnectionProvider</tt>. Please refer the the Apache commons-pool documentation for the interpretation of these properties. All Hibernate property names are defined on the class <tt>net.sf.hibernate.Environment</tt>. </p><p> For use inside an application server, Hibernate may obtain connections from a ! <tt>javax.sql.Datasource</tt> registered in JNDI. Set the following properties: </p><div class="itemizedlist"><ul type="disc"><li><p> *************** *** 160,174 **** This property is only necessary when using user supplied connections. Hibernate uses connection metadata otherwise.</td></tr><tr><td><tt>hibernate.jdbc.use_streams_for_binary</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>use streams when writing / reading <tt>binary</tt> ! or <tt>serializable</tt> types to / from JDBC</td></tr><tr><td><tt>hibernate.connection.provider_class</tt></td><td><tt>full.classname.of.ConnectionProvider</tt></td><td>classname of a custom <tt>ConnectionProvider</tt></td></tr><tr><td><tt>hibernate.transaction.factory_class</tt></td><td><tt>full.classname.of.TransactionFactory</tt></td><td>classname of a <tt>TransactionFactory</tt> to use with ! Hibernate Transaction API</td></tr><tr><td><tt>jta.UserTransaction</tt></td><td><tt>jndi/composite/name</tt></td><td>A JNDI name used by <tt>JTATransactionFactory</tt> to obtain the JTA <tt>UserTransaction</tt></td></tr><tr><td><tt>hibernate.transaction.manager_lookup_class</tt></td><td><tt>full.classname.of.TransactionManagerLookup</tt></td><td>classname of a <tt>TransactionManagerLookup</tt> - needed when JVM-level caching is enabled in a JTA environment</td></tr><tr><td><tt>hibernate.query.imports</tt></td><td><tt>package.name, other.package.name</tt></td><td>A list of packages containing persistent classes. If the package is ! listed here, your Hibernate queries need not specify the full class name of a persistent class. (You can use <tt>from foo in class Foo</tt> as an alternative to <tt>from foo in class eg.foo.Foo</tt>.)</td></tr><tr><td><tt>hibernate.query.substitutions</tt></td><td><tt>hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC</tt></td><td>mapping from tokens in Hibernate queries to SQL tokens ( tokens might be function or literal names, for example )</td></tr><tr><td><tt>hibernate.show_sql</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>write all SQL statements to console ( as an alternative to use of the logging functionality )</td></tr></tbody></table></div><p> ! You should always set the <tt>hibernate.dialect</tt> property to the correct ! <tt>net.sf.hibernate.sql.Dialect</tt> subclass for your database. This is not strictly essential unless you wish to use <tt>native</tt> or <tt>sequence</tt> primary key generation or pessimistic locking ( --- 160,174 ---- This property is only necessary when using user supplied connections. Hibernate uses connection metadata otherwise.</td></tr><tr><td><tt>hibernate.jdbc.use_streams_for_binary</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>use streams when writing / reading <tt>binary</tt> ! or <tt>serializable</tt> types to / from JDBC</td></tr><tr><td><tt>hibernate.connection.provider_class</tt></td><td><tt>full.classname.of.ConnectionProvider</tt></td><td>classname of a custom <tt>ConnectionProvider</tt></td></tr><tr><td><tt>hibernate.transaction.factory_class</tt></td><td><tt>full.classname.of.TransactionFactory</tt></td><td>classname of a <tt>TransactionFactory</tt> to use with ! Hibernate Transaction API</td></tr><tr><td><tt>jta.UserTransaction</tt></td><td><tt>jndi/composite/name</tt></td><td>A JNDI name used by <tt>JTATransactionFactory</tt> to obtain the JTA <tt>UserTransaction</tt></td></tr><tr><td><tt>hibernate.transaction.manager_lookup_class</tt></td><td><tt>full.classname.of.TransactionManagerLookup</tt></td><td>classname of a <tt>TransactionManagerLookup</tt> - needed when JVM-level caching is enabled in a JTA environment</td></tr><tr><td><tt>hibernate.query.imports</tt></td><td><tt>package.name, other.package.name</tt></td><td>A list of packages containing persistent classes. If the package is ! listed here, your Hibernate queries need not specify the full class name of a persistent class. (You can use <tt>from foo in class Foo</tt> as an alternative to <tt>from foo in class eg.foo.Foo</tt>.)</td></tr><tr><td><tt>hibernate.query.substitutions</tt></td><td><tt>hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC</tt></td><td>mapping from tokens in Hibernate queries to SQL tokens ( tokens might be function or literal names, for example )</td></tr><tr><td><tt>hibernate.show_sql</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>write all SQL statements to console ( as an alternative to use of the logging functionality )</td></tr></tbody></table></div><p> ! You should always set the <tt>hibernate.dialect</tt> property to the correct ! <tt>net.sf.hibernate.dialect.Dialect</tt> subclass for your database. This is not strictly essential unless you wish to use <tt>native</tt> or <tt>sequence</tt> primary key generation or pessimistic locking ( *************** *** 178,182 **** </p><p> The following table displays possible values for <tt>hibernate.dialect</tt>. ! </p><table class="simplelist" border="0" summary="Simple list"><tr><td>DB2</td><td><tt>net.sf.hibernate.sql.DB2Dialect</tt></td></tr><tr><td>MySQL</td><td><tt>net.sf.hibernate.sql.MySQLDialect</tt></td></tr><tr><td>SAP DB</td><td><tt>net.sf.hibernate.sql.SAPDBDialect</tt></td></tr><tr><td>Oracle</td><td><tt>net.sf.hibernate.sql.OracleDialect</tt></td></tr><tr><td>Sybase</td><td><tt>net.sf.hibernate.sql.SybaseDialect</tt></td></tr><tr><td>Progress</td><td><tt>net.sf.hibernate.sql.ProgressDialect</tt></td></tr><tr><td>Mckoi SQL</td><td><tt>net.sf.hibernate.sql.McKoiDialect</tt></td></tr><tr><td>Interbase</td><td><tt>net.sf.hibernate.sql.InterbaseDialect</tt></td></tr><tr><td>Pointbase</td><td><tt>net.sf.hibernate.sql.PointbaseDialect</tt></td></tr><tr><td>PostgreSQL</td><td><tt>net.sf.hibernate.sql.PostgreSQLDialect</tt></td></tr><tr><td>HypersonicSQL</td><td><tt>net.sf.hibernate.sql.HSQLDialect</tt></td></tr><tr><td>Microsoft SQL Server</td><td><tt>net.sf.hibernate.sql.SybaseDialect</tt></td></tr></table><p> If your database supports ANSI or Oracle style outerjoins, <span class="emphasis"><i>outer join fetching</i></span> might increase performance by limiting the number of round --- 178,182 ---- </p><p> The following table displays possible values for <tt>hibernate.dialect</tt>. ! </p><table class="simplelist" border="0" summary="Simple list"><tr><td>DB2</td><td><tt>net.sf.hibernate.dialect.DB2Dialect</tt></td></tr><tr><td>MySQL</td><td><tt>net.sf.hibernate.dialect.MySQLDialect</tt></td></tr><tr><td>SAP DB</td><td><tt>net.sf.hibernate.dialect.SAPDBDialect</tt></td></tr><tr><td>Oracle</td><td><tt>net.sf.hibernate.dialect.OracleDialect</tt></td></tr><tr><td>Sybase</td><td><tt>net.sf.hibernate.dialect.SybaseDialect</tt></td></tr><tr><td>Progress</td><td><tt>net.sf.hibernate.dialect.ProgressDialect</tt></td></tr><tr><td>Mckoi SQL</td><td><tt>net.sf.hibernate.dialect.McKoiDialect</tt></td></tr><tr><td>Interbase</td><td><tt>net.sf.hibernate.dialect.InterbaseDialect</tt></td></tr><tr><td>Pointbase</td><td><tt>net.sf.hibernate.dialect.PointbaseDialect</tt></td></tr><tr><td>PostgreSQL</td><td><tt>net.sf.hibernate.dialect.PostgreSQLDialect</tt></td></tr><tr><td>HypersonicSQL</td><td><tt>net.sf.hibernate.dialect.HSQLDialect</tt></td></tr><tr><td>Microsoft SQL Server</td><td><tt>net.sf.hibernate.dialect.SybaseDialect</tt></td></tr></table><p> If your database supports ANSI or Oracle style outerjoins, <span class="emphasis"><i>outer join fetching</i></span> might increase performance by limiting the number of round *************** *** 190,201 **** Oracle limits the size of <tt>byte</tt> arrays that may be passed to/from its JDBC driver. If you wish to use large instances of ! <tt>binary</tt> or <tt>serializable</tt> type, you should enable <tt>hibernate.jdbc.use_streams_for_binary</tt>. <span class="emphasis"><i>This is a JVM-level setting only.</i></span> </p><p> ! <tt>hibernate.show_sql</tt> forces Hibernate to write SQL statements to the console. This is provided as an easy alternative to enabling logging. </p><p> ! You may define your own plugin strategy for obtaining JDBC connections by implementing the interface <tt>net.sf.hibernate.connection.ConnectionProvider</tt>. --- 190,201 ---- Oracle limits the size of <tt>byte</tt> arrays that may be passed to/from its JDBC driver. If you wish to use large instances of ! <tt>binary</tt> or <tt>serializable</tt> type, you should enable <tt>hibernate.jdbc.use_streams_for_binary</tt>. <span class="emphasis"><i>This is a JVM-level setting only.</i></span> </p><p> ! <tt>hibernate.show_sql</tt> forces Hibernate to write SQL statements to the console. This is provided as an easy alternative to enabling logging. </p><p> ! You may define your own plugin strategy for obtaining JDBC connections by implementing the interface <tt>net.sf.hibernate.connection.ConnectionProvider</tt>. *************** *** 203,209 **** <tt>hibernate.connection.provider_class</tt>. </p><p> ! If you wish to use the Hibernate <tt>Transaction</tt> API, you must specify a factory class for <tt>Transaction</tt> instances by ! setting the property <tt>hibernate.transaction.factory_class</tt>. There are two standard (built-in) choices: </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>net.sf.hibernate.transaction.JDBCTransactionFactory</tt></td><td>delegates to database (JDBC) transactions</td></tr><tr><td><tt>net.sf.hibernate.transaction.JTATransactionFactory</tt></td><td>delegates to JTA (if an existing transaction is underway, the <tt>Session</tt> --- 203,209 ---- <tt>hibernate.connection.provider_class</tt>. </p><p> ! If you wish to use the Hibernate <tt>Transaction</tt> API, you must specify a factory class for <tt>Transaction</tt> instances by ! setting the property <tt>hibernate.transaction.factory_class</tt>. There are two standard (built-in) choices: </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>net.sf.hibernate.transaction.JDBCTransactionFactory</tt></td><td>delegates to database (JDBC) transactions</td></tr><tr><td><tt>net.sf.hibernate.transaction.JTATransactionFactory</tt></td><td>delegates to JTA (if an existing transaction is underway, the <tt>Session</tt> *************** *** 214,234 **** a strategy for obtaining the JTA <tt>TransactionManager</tt>. </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>net.sf.hibernate.transaction.JBossTransactionManagerLookup</tt></td><td>for JBoss</td></tr><tr><td><tt>net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</tt></td><td>for Weblogic</td></tr><tr><td><tt>net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</tt></td><td>for WebSphere</td></tr><tr><td><tt>net.sf.hibernate.transaction.OrionTransactionManagerLookup</tt></td><td>for Orion</td></tr><tr><td><tt>net.sf.hibernate.transaction.ResinTransactionManagerLookup</tt></td><td>for Resin</td></tr></table><p> ! If you wish to have the <tt>SessionFactory</tt> bound to a JNDI namespace, specify ! a name (eg. <tt>hibernate/session_factory</tt>) as using the property ! <tt>hibernate.session_factory_name</tt>. Then EJBs, for example, may obtain the <tt>SessionFactory</tt> using a JNDI lookup. Hibernate will use ! <tt>hibernate.jndi.url</tt>, <tt>hibernate.jndi.class</tt> to instantiate an initial context. </p><p> You may define new Hibernate query tokens using <tt>hibernate.query.substitutions</tt>. ! For example: ! <pre class="programlisting">hibernate.query.substitutions true=1, false=0</pre> ! would cause the tokens <tt>true</tt> and <tt>false</tt> to be translated to ! integer literals in the generated SQL. <pre class="programlisting">hibernate.query.substitutions toLowercase=LOWER</pre> would allow you to rename the SQL <tt>lower</tt> function. </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s6"></a>XML Configuration File</h2></div></div><p> An alternative approach is to specify a full configuration in a file named ! <tt>hibernate.cfg.xml</tt>. The configuration file is expected to be in the root of your |CLASSPATH|. </p><pre class="programlisting"><?xml version='1.0' encoding='utf-8'?> --- 214,234 ---- a strategy for obtaining the JTA <tt>TransactionManager</tt>. </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt>net.sf.hibernate.transaction.JBossTransactionManagerLookup</tt></td><td>for JBoss</td></tr><tr><td><tt>net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</tt></td><td>for Weblogic</td></tr><tr><td><tt>net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</tt></td><td>for WebSphere</td></tr><tr><td><tt>net.sf.hibernate.transaction.OrionTransactionManagerLookup</tt></td><td>for Orion</td></tr><tr><td><tt>net.sf.hibernate.transaction.ResinTransactionManagerLookup</tt></td><td>for Resin</td></tr></table><p> ! If you wish to have the <tt>SessionFactory</tt> bound to a JNDI namespace, specify ! a name (eg. <tt>hibernate/session_factory</tt>) as using the property ! <tt>hibernate.session_factory_name</tt>. Then EJBs, for example, may obtain the <tt>SessionFactory</tt> using a JNDI lookup. Hibernate will use ! <tt>hibernate.jndi.url</tt>, <tt>hibernate.jndi.class</tt> to instantiate an initial context. </p><p> You may define new Hibernate query tokens using <tt>hibernate.query.substitutions</tt>. ! For example: ! <pre class="programlisting">hibernate.query.substitutions true=1, false=0</pre> ! would cause the tokens <tt>true</tt> and <tt>false</tt> to be translated to ! integer literals in the generated SQL. <pre class="programlisting">hibernate.query.substitutions toLowercase=LOWER</pre> would allow you to rename the SQL <tt>lower</tt> function. </p></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="session-configuration-s6"></a>XML Configuration File</h2></div></div><p> An alternative approach is to specify a full configuration in a file named ! <tt>hibernate.cfg.xml</tt>. The configuration file is expected to be in the root of your |CLASSPATH|. </p><pre class="programlisting"><?xml version='1.0' encoding='utf-8'?> *************** *** 245,249 **** <!-- properties --> <property name="connection.datasource">my/first/datasource</property> ! <property name="dialect">net.sf.hibernate.sql.MySQLDialect</property> <property name="show_sql">false</property> <property name="use_outer_join">true</property> --- 245,249 ---- <!-- properties --> <property name="connection.datasource">my/first/datasource</property> ! <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property> <property name="show_sql">false</property> <property name="use_outer_join">true</property> |
From: <one...@us...> - 2003-02-02 07:02:34
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv31456/reference/src Modified Files: session_configuration.xml Log Message: fixed dialect class names Index: session_configuration.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/session_configuration.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** session_configuration.xml 1 Feb 2003 12:22:34 -0000 1.5 --- session_configuration.xml 2 Feb 2003 07:02:31 -0000 1.6 *************** *** 407,411 **** <para> You should always set the <literal>hibernate.dialect</literal> property to the correct ! <literal>net.sf.hibernate.sql.Dialect</literal> subclass for your database. This is not strictly essential unless you wish to use <literal>native</literal> or <literal>sequence</literal> primary key generation or pessimistic locking ( --- 407,411 ---- <para> You should always set the <literal>hibernate.dialect</literal> property to the correct ! <literal>net.sf.hibernate.dialect.Dialect</literal> subclass for your database. This is not strictly essential unless you wish to use <literal>native</literal> or <literal>sequence</literal> primary key generation or pessimistic locking ( *************** *** 548,552 **** <!-- properties --> <property name="connection.datasource">my/first/datasource</property> ! <property name="dialect">net.sf.hibernate.sql.MySQLDialect</property> <property name="show_sql">false</property> <property name="use_outer_join">true</property> --- 548,552 ---- <!-- properties --> <property name="connection.datasource">my/first/datasource</property> ! <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property> <property name="show_sql">false</property> <property name="use_outer_join">true</property> |
From: <one...@us...> - 2003-02-02 07:02:34
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/html_single In directory sc8-pr-cvs1:/tmp/cvs-serv31456/reference/html_single Modified Files: index.html Log Message: fixed dialect class names Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html_single/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.html 28 Jan 2003 13:25:10 -0000 1.2 --- index.html 2 Feb 2003 07:02:31 -0000 1.3 *************** *** 75,86 **** <tt>foo==bar</tt> </td></tr></table><p> ! Then for objects returned by a <span class="emphasis"><i>particular</i></span> <tt>Session</tt>, ! the two notions are equivalent. However, while the application might concurrently access the "same" (persistent identity) business object in two different sessions, the two instances will actually be "different" (JVM identity). </p><p> ! This approach leaves Hibernate and the database to worry about concurrency (the application never needs to synchronize on any business object, as long as it sticks to a ! single thread per <tt>Session</tt>) or object identity (within a session the [...2864 lines suppressed...] ! particular transaction. </p></dd><dt><span class="term">In a three tiered architecture, consider using <tt>saveOrUpdate()</tt>.</span></dt><dd><p> When using a servlet / session bean architecture, you could pass persistent objects loaded in ! the session bean to and from the servlet / JSP layer. Use a new session to service each request. ! Use <tt>Session.update()</tt> or <tt>Session.saveOrUpdate()</tt> to update the persistent state of an object. </p></dd><dt><span class="term">In a two tiered architecture, consider using session disconnection.</span></dt><dd><p> *************** *** 3312,3316 **** remember to disconnect the session before returning control to the client. </p></dd><dt><span class="term">Don't treat exceptions as recoverable.</span></dt><dd><p> ! This is more of a necessary paractice than a "best" practice. When an exception occurs, roll back the <tt>Transaction</tt> and close the <tt>Session</tt>. If you don't, Hibernate can't guarantee that in-memory state accurately represents persistent state --- 3312,3316 ---- remember to disconnect the session before returning control to the client. </p></dd><dt><span class="term">Don't treat exceptions as recoverable.</span></dt><dd><p> ! This is more of a necessary paractice than a "best" practice. When an exception occurs, roll back the <tt>Transaction</tt> and close the <tt>Session</tt>. If you don't, Hibernate can't guarantee that in-memory state accurately represents persistent state |
From: <one...@us...> - 2003-02-02 06:47:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv27790a/src/net/sf/hibernate/cfg Modified Files: Environment.java Log Message: 2.0 beta 2 Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Environment.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Environment.java 26 Jan 2003 01:33:34 -0000 1.1 --- Environment.java 2 Feb 2003 06:47:06 -0000 1.2 *************** *** 36,43 **** * @see SessionFactory */ - public final class Environment { ! private static final String VERSION = "2.0 beta 1"; /** --- 36,42 ---- * @see SessionFactory */ public final class Environment { ! private static final String VERSION = "2.0 beta 2"; /** |
From: <one...@us...> - 2003-02-02 06:47:09
|
Update of /cvsroot/hibernate/Hibernate2/src In directory sc8-pr-cvs1:/tmp/cvs-serv27790a/src Modified Files: hibernate.properties Log Message: 2.0 beta 2 Index: hibernate.properties =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/hibernate.properties,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** hibernate.properties 1 Feb 2003 12:22:34 -0000 1.13 --- hibernate.properties 2 Feb 2003 06:47:06 -0000 1.14 *************** *** 36,54 **** ## DB2 ! #hibernate.dialect net.sf.hibernate.dialect.DB2Dialect ! #hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver ! #hibernate.connection.url jdbc:db2:test ! #hibernate.connection.username db2 ! #hibernate.connection.password db2 ## MySQL ! hibernate.dialect net.sf.hibernate.dialect.MySQLDialect ! hibernate.connection.driver_class org.gjt.mm.mysql.Driver ! hibernate.connection.driver_class com.mysql.jdbc.Driver ! hibernate.connection.url jdbc:mysql:///test ! hibernate.connection.username root ! hibernate.connection.password --- 36,54 ---- ## DB2 ! hibernate.dialect net.sf.hibernate.dialect.DB2Dialect ! hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver ! hibernate.connection.url jdbc:db2:test ! hibernate.connection.username db2 ! hibernate.connection.password db2 ## MySQL ! #hibernate.dialect net.sf.hibernate.dialect.MySQLDialect ! #hibernate.connection.driver_class org.gjt.mm.mysql.Driver ! #hibernate.connection.driver_class com.mysql.jdbc.Driver ! #hibernate.connection.url jdbc:mysql:///test ! #hibernate.connection.username root ! #hibernate.connection.password |
From: <one...@us...> - 2003-02-02 06:47:08
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv27790a Modified Files: changelog.txt readme.txt Log Message: 2.0 beta 2 Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** changelog.txt 28 Jan 2003 13:05:28 -0000 1.5 --- changelog.txt 2 Feb 2003 06:47:05 -0000 1.6 *************** *** 1,4 **** --- 1,20 ---- Hibernate Changelog =================== + Changes in version 2.0 beta 2 (2.2.2003) + ---------------------------------------- + * property column names may now be of any length (Mark Woon) + * fixed problem where CodeGenerator created private get/set pairs (Max Andersen) + * fixed all silly bugs in Configuration.configure() + * efficient collection updates from Session.update() + * added <jcs-class-cache> and <jcs-collection-cache> elements to hibernate-configuration.dtd + * support for normalized mappings for databases with DECODE instead of CASE (Simon Harris) + * added Oracle9Dialect + * added JRun4TransactionManagerLookup (Joseph Bissen) + * fixed JDBCException to keep reference to underlying SQLException + * fixed a bug loading many-to-many associations with a repeated column name + * fixed a bug in ShortType + * added IngresDialect (Ian Booth) + * added --config option to SchemaExport + Changed in version 2.0 beta 1 (28.1.2003) ----------------------------------------- Index: readme.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/readme.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** readme.txt 28 Jan 2003 13:06:56 -0000 1.2 --- readme.txt 2 Feb 2003 06:47:05 -0000 1.3 *************** *** 1,5 **** Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 2.0 beta 1 28 January 2003 Instructions --- 1,5 ---- Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 2.0 beta 2 2 February 2003 Instructions |
From: <one...@us...> - 2003-02-02 06:41:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv25866/hibernate/sql Modified Files: SimpleSelect.java Log Message: applied Mark Woon's new patch for long column names Index: SimpleSelect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql/SimpleSelect.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleSelect.java 20 Jan 2003 18:45:18 -0000 1.1 --- SimpleSelect.java 2 Feb 2003 06:41:05 -0000 1.2 *************** *** 3,8 **** --- 3,10 ---- import java.util.ArrayList; + import java.util.HashMap; import java.util.Iterator; import java.util.List; + import java.util.Map; import net.sf.hibernate.util.StringHelper; *************** *** 17,22 **** --- 19,32 ---- private List columns = new ArrayList(); + private Map aliases = new HashMap(); private List whereTokens = new ArrayList(); + public SimpleSelect addColumns(String[] columnNames, String[] aliases) { + for ( int i=0; i<columnNames.length; i++ ) { + addColumn( columnNames[i], aliases[i] ); + } + return this; + } + public SimpleSelect addColumns(String[] columnNames) { for ( int i=0; i<columnNames.length; i++ ) { *************** *** 30,33 **** --- 40,49 ---- } + public SimpleSelect addColumn(String columnName, String alias) { + columns.add(columnName); + aliases.put(columnName, alias); + return this; + } + public SimpleSelect setTableName(String tableName) { this.tableName = tableName; *************** *** 71,75 **** Iterator iter = columns.iterator(); while ( iter.hasNext() ) { ! buf.append( iter.next() ); if ( iter.hasNext() ) buf.append(StringHelper.COMMA_SPACE); } --- 87,97 ---- Iterator iter = columns.iterator(); while ( iter.hasNext() ) { ! String col = (String) iter.next(); ! buf.append(col); ! String alias = (String) aliases.get(col); ! if ( alias!=null && !alias.equals(col) ) { ! buf.append(" as ") ! .append(alias); ! } if ( iter.hasNext() ) buf.append(StringHelper.COMMA_SPACE); } |
From: <one...@us...> - 2003-02-02 06:41:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv25866/hibernate/persister Modified Files: EntityPersister.java NormalizedEntityPersister.java Log Message: applied Mark Woon's new patch for long column names Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/EntityPersister.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EntityPersister.java 28 Jan 2003 10:22:20 -0000 1.14 --- EntityPersister.java 2 Feb 2003 06:41:05 -0000 1.15 *************** *** 71,78 **** --- 71,80 ---- private transient final boolean[] definedOnSubclass; private transient final String[][] propertyColumnNames; + private transient final String[][] propertyColumnAliases; private transient final String[][] subclassPropertyColumnNameClosure; private transient final String discriminatorColumnName; private transient final String[] subclassColumnClosure; + private transient final String[] subclassColumnAliasClosure; private transient final Type[] subclassPropertyTypeClosure; private transient final Class[] subclassClosure; *************** *** 162,172 **** } - /** - * Return an array of all column names used by all subclasses - * of the persistent class - */ - public String[] getSubclassColumnClosure() { - return subclassColumnClosure; - } public Type getSubclassPropertyType(int i) { return subclassPropertyTypeClosure[i]; --- 164,167 ---- *************** *** 185,189 **** public String[] getPropertyColumnNames(int i) { ! return propertyColumnNames[i]; } --- 180,184 ---- public String[] getPropertyColumnNames(int i) { ! return propertyColumnAliases[i]; } *************** *** 295,302 **** .setTableName( getTableName() ) .addColumns( getIdentifierColumnNames() ) ! .addColumns( getSubclassColumnClosure() ); ! if ( hasSubclasses() ) { ! select.addColumn( getDiscriminatorColumnName() ); ! } return select.addCondition( getIdentifierColumnNames(), "=?" ).toStatementString(); } --- 290,295 ---- .setTableName( getTableName() ) .addColumns( getIdentifierColumnNames() ) ! .addColumns( subclassColumnClosure, subclassColumnAliasClosure ); ! if ( hasSubclasses() ) select.addColumn( getDiscriminatorColumnName() ); return select.addCondition( getIdentifierColumnNames(), "=?" ).toStatementString(); } *************** *** 644,649 **** propertyColumnNames = new String[hydrateSpan][]; propertyColumnSpans = new int[hydrateSpan]; - ArrayList columns = new ArrayList(); HashSet thisClassProperties = new HashSet(); --- 637,642 ---- propertyColumnNames = new String[hydrateSpan][]; + propertyColumnAliases = new String[hydrateSpan][]; propertyColumnSpans = new int[hydrateSpan]; HashSet thisClassProperties = new HashSet(); *************** *** 651,668 **** int i=0; while( iter.hasNext() ) { Property prop = (Property) iter.next(); ! propertyColumnSpans[i] = prop.getColumnSpan(); thisClassProperties.add(prop); ! String[] colNames = new String[ propertyColumnSpans[i] ]; Iterator colIter = prop.getColumnIterator(); int j=0; while ( colIter.hasNext() ) { ! String colname = ( (Column) colIter.next() ).getName(); ! colNames[j++] = colname; ! columns.add(colname); } propertyColumnNames[i] = colNames; initPropertyPaths(prop, StringHelper.EMPTY_STRING); --- 644,667 ---- int i=0; + boolean foundColumn = false; while( iter.hasNext() ) { Property prop = (Property) iter.next(); ! int span = prop.getColumnSpan(); ! propertyColumnSpans[i] = span; thisClassProperties.add(prop); ! String[] colNames = new String[span]; ! String[] colAliases = new String[span]; Iterator colIter = prop.getColumnIterator(); int j=0; while ( colIter.hasNext() ) { ! Column col = (Column) colIter.next(); ! colAliases[j] = col.getAlias(); ! colNames[j] = col.getName(); ! j++; ! foundColumn=true; } propertyColumnNames[i] = colNames; + propertyColumnAliases[i] = colAliases; initPropertyPaths(prop, StringHelper.EMPTY_STRING); *************** *** 674,682 **** } ! hasColumns = columns.size()!=0; ! columns.clear(); ArrayList types = new ArrayList(); ArrayList propColumns = new ArrayList(); ArrayList joinedFetchesList = new ArrayList(); ArrayList definedBySubclass = new ArrayList(); --- 673,682 ---- } ! hasColumns = foundColumn; ! ArrayList columns = new ArrayList(); ArrayList types = new ArrayList(); ArrayList propColumns = new ArrayList(); + ArrayList aliases = new ArrayList(); ArrayList joinedFetchesList = new ArrayList(); ArrayList definedBySubclass = new ArrayList(); *************** *** 693,697 **** Column col = (Column) colIter.next(); columns.add( col.getName() ); ! cols[l++]=col.getName(); } propColumns.add(cols); --- 693,698 ---- Column col = (Column) colIter.next(); columns.add( col.getName() ); ! aliases.add( col.getAlias() ); ! cols[l++] = col.getName(); } propColumns.add(cols); *************** *** 703,706 **** --- 704,708 ---- subclassPropertyTypeClosure = (Type[]) types.toArray(TYPE_ARRAY); subclassPropertyColumnNameClosure = (String[][]) propColumns.toArray( new String[ propColumns.size() ][] ); + subclassColumnAliasClosure = (String[]) aliases.toArray(STRING_ARRAY); joinedFetch = new int[ joinedFetchesList.size() ]; *************** *** 843,847 **** .setSuffix(suffix); if ( hasSubclasses() ) frag.addColumn( name, getDiscriminatorColumnName() ); ! return frag.addColumns( name, getSubclassColumnClosure() ) .toFragmentString(); } --- 845,849 ---- .setSuffix(suffix); if ( hasSubclasses() ) frag.addColumn( name, getDiscriminatorColumnName() ); ! return frag.addColumns( name, subclassColumnClosure, subclassColumnAliasClosure ) .toFragmentString(); } Index: NormalizedEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/NormalizedEntityPersister.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NormalizedEntityPersister.java 1 Feb 2003 12:22:35 -0000 1.7 --- NormalizedEntityPersister.java 2 Feb 2003 06:41:05 -0000 1.8 *************** *** 168,174 **** } - public String[] getSubclassColumnClosure() { - return subclassColumnClosure; - } public Type getSubclassPropertyType(int i) { return subclassPropertyTypeClosure[i]; --- 168,171 ---- *************** *** 766,770 **** String colname = col.getName(); propCols[j] = colname; ! propAliases[j] = col.getName() + tab.getUniqueInteger() + StringHelper.UNDERSCORE; j++; } --- 763,767 ---- String colname = col.getName(); propCols[j] = colname; ! propAliases[j] = col.getAlias() + tab.getUniqueInteger() + StringHelper.UNDERSCORE; j++; } *************** *** 806,810 **** coltables.add(tabnum); cols[l++]=col.getName(); ! aliases.add( col.getName() + tab.getUniqueInteger() + StringHelper.UNDERSCORE ); } propColumns.add(cols); --- 803,807 ---- coltables.add(tabnum); cols[l++]=col.getName(); ! aliases.add( col.getAlias() + tab.getUniqueInteger() + StringHelper.UNDERSCORE ); } propColumns.add(cols); *************** *** 1000,1004 **** public String propertySelectFragment(String alias, String suffix) { ! String[] cols = getSubclassColumnClosure(); SelectFragment frag = new SelectFragment() .setSuffix(suffix); --- 997,1001 ---- public String propertySelectFragment(String alias, String suffix) { ! String[] cols = subclassColumnClosure; SelectFragment frag = new SelectFragment() .setSuffix(suffix); |
From: <one...@us...> - 2003-02-02 06:41:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv25866/hibernate/util Modified Files: StringHelper.java Log Message: applied Mark Woon's new patch for long column names Index: StringHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/StringHelper.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StringHelper.java 20 Jan 2003 12:48:17 -0000 1.6 --- StringHelper.java 2 Feb 2003 06:41:06 -0000 1.7 *************** *** 118,126 **** } - /*if (nameBuffer.length() > 15) { - nameBuffer.delete(0, nameBuffer.length()-15); - if ( !Character.isLetter( nameBuffer.charAt(0) ) ) nameBuffer.setCharAt(0, 'x'); - }*/ - if (nameEscaped) { nameBuffer.insert(0, quote); --- 118,121 ---- |
From: <one...@us...> - 2003-02-02 06:41:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv25866/hibernate/test Modified Files: FooBar.hbm.xml Glarch.hbm.xml Log Message: applied Mark Woon's new patch for long column names Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBar.hbm.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FooBar.hbm.xml 2 Feb 2003 00:29:06 -0000 1.6 --- FooBar.hbm.xml 2 Feb 2003 06:41:05 -0000 1.7 *************** *** 60,64 **** <property name="status" column="status_"/> <property name="binary" column="bin_"/> ! <property name="locale" column="locale_"/> <property name="custom" type="net.sf.hibernate.test.DoubleStringType"> <column name="first_name" length="66"/> --- 60,64 ---- <property name="status" column="status_"/> <property name="binary" column="bin_"/> ! <property name="locale" column="localeayzabc123"/> <property name="custom" type="net.sf.hibernate.test.DoubleStringType"> <column name="first_name" length="66"/> *************** *** 118,128 **** <property name="count" column="bar_count"/> <property name="name" length="64"/> ! ! <array name ="importantDates"> ! <key column="id" /> ! <index column="i"/> ! <element column="date_" type="date"/> ! </array> ! </component> </subclass> --- 118,126 ---- <property name="count" column="bar_count"/> <property name="name" length="64"/> ! <array name ="importantDates"> ! <key column="id" /> ! <index column="i"/> ! <element column="date_" type="date"/> ! </array> </component> </subclass> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Glarch.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Glarch.hbm.xml 28 Jan 2003 10:22:21 -0000 1.4 --- Glarch.hbm.xml 2 Feb 2003 06:41:06 -0000 1.5 *************** *** 9,13 **** </id> <version name="version"/> ! <property name="name"/> <!-- <property name="currency"/> --> <many-to-one name="next" column="next_" class="net.sf.hibernate.test.Glarch"/> --- 9,13 ---- </id> <version name="version"/> ! <property name="name" column="namecvbnmasdf"/> <!-- <property name="currency"/> --> <many-to-one name="next" column="next_" class="net.sf.hibernate.test.Glarch"/> |
From: <one...@us...> - 2003-02-02 06:41:09
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv25866/hibernate/mapping Modified Files: Column.java Table.java Log Message: applied Mark Woon's new patch for long column names Index: Column.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Column.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Column.java 27 Jan 2003 12:51:50 -0000 1.6 --- Column.java 2 Feb 2003 06:41:05 -0000 1.7 *************** *** 7,10 **** --- 7,11 ---- import net.sf.hibernate.engine.Mapping; import net.sf.hibernate.type.Type; + import net.sf.hibernate.util.StringHelper; import net.sf.hibernate.util.Stringable; *************** *** 20,23 **** --- 21,25 ---- private boolean unique=false; private String sqlType; + int uniqueInteger; public int getLength() { *************** *** 38,41 **** --- 40,53 ---- public void setName(String name) { this.name = name; + } + + public String getAlias() { + //TODO: handle quoted identifiers! + if ( name.length() < 11 ) { + return name; + } + else { + return name.substring(0, 10) + uniqueInteger + StringHelper.UNDERSCORE; + } } Index: Table.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Table.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Table.java 27 Jan 2003 12:51:50 -0000 1.6 --- Table.java 2 Feb 2003 06:41:05 -0000 1.7 *************** *** 57,62 **** } public void addColumn(Column column) { ! if ( columns.get( column.getName() )==null ) { columns.put( column.getName(), column ); } } --- 57,67 ---- } public void addColumn(Column column) { ! Column old = (Column) columns.get( column.getName() ); ! if ( old==null ) { columns.put( column.getName(), column ); + column.uniqueInteger = columns.size(); + } + else { + column.uniqueInteger = old.uniqueInteger; } } |
From: <one...@us...> - 2003-02-02 04:50:12
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect In directory sc8-pr-cvs1:/tmp/cvs-serv3730/hibernate/tools/reflect Modified Files: MappingByReflection.java Log Message: fixed MappingByReflection for 1.1 dtd Index: MappingByReflection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect/MappingByReflection.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MappingByReflection.java 26 Nov 2002 03:35:45 -0000 1.16 --- MappingByReflection.java 2 Feb 2003 04:50:09 -0000 1.17 *************** *** 306,310 **** .append("<!DOCTYPE hibernate-mapping PUBLIC\n") .append("\t\"-//Hibernate/Hibernate Mapping DTD//EN\"\n") ! .append("\t\"http://hibernate.sourceforge.net/hibernate-mapping.dtd\">\n"); } --- 306,310 ---- .append("<!DOCTYPE hibernate-mapping PUBLIC\n") .append("\t\"-//Hibernate/Hibernate Mapping DTD//EN\"\n") ! .append("\t\"http://hibernate.sourceforge.net/hibernate-mapping-1.1.dtd\">\n"); } |
From: <one...@us...> - 2003-02-02 04:48:31
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm In directory sc8-pr-cvs1:/tmp/cvs-serv3395/sf/hibernate/tool/class2hbm Modified Files: MapGenerator.java ReflectedProperty.java Log Message: fixed MappingByReflection for 2.0 dtd Index: MapGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/MapGenerator.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MapGenerator.java 20 Jan 2003 12:48:15 -0000 1.4 --- MapGenerator.java 2 Feb 2003 04:48:27 -0000 1.5 *************** *** 2,17 **** package net.sf.hibernate.tool.class2hbm; - import java.lang.reflect.*; - import java.util.Hashtable; - import java.util.Vector; - import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.Reader; import java.io.StreamTokenizer; - import java.io.FileWriter; import java.io.Writer; ! import net.sf.hibernate.*; ! import net.sf.hibernate.type.*; import net.sf.hibernate.util.StringHelper; --- 2,18 ---- package net.sf.hibernate.tool.class2hbm; import java.io.BufferedReader; + import java.io.FileWriter; + import java.io.InputStreamReader; import java.io.Reader; import java.io.StreamTokenizer; import java.io.Writer; + import java.lang.reflect.Constructor; + import java.util.Hashtable; + import java.util.Vector; ! import net.sf.hibernate.PersistentEnum; ! import net.sf.hibernate.type.Type; ! import net.sf.hibernate.type.TypeFactory; import net.sf.hibernate.util.StringHelper; *************** *** 308,312 **** .append("<!DOCTYPE hibernate-mapping PUBLIC\n") .append("\t\"-//Hibernate/Hibernate Mapping DTD//EN\"\n") ! .append("\t\"http://hibernate.sourceforge.net/hibernate-mapping.dtd\">\n"); } --- 309,313 ---- .append("<!DOCTYPE hibernate-mapping PUBLIC\n") .append("\t\"-//Hibernate/Hibernate Mapping DTD//EN\"\n") ! .append("\t\"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd\">\n"); } Index: ReflectedProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedProperty.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReflectedProperty.java 5 Jan 2003 02:11:23 -0000 1.3 --- ReflectedProperty.java 2 Feb 2003 04:48:27 -0000 1.4 *************** *** 152,156 **** buf.append("<") .append(collection) ! .append(" role=\"" ) .append(name) .append("\" table=\"") --- 152,156 ---- buf.append("<") .append(collection) ! .append(" name=\"" ) .append(name) .append("\" table=\"") |
From: <one...@us...> - 2003-02-02 04:48:30
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv3395/sf/hibernate/tool/hbm2java Modified Files: ClassMapping.java Log Message: fixed MappingByReflection for 2.0 dtd Index: ClassMapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/ClassMapping.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ClassMapping.java 24 Jan 2003 13:30:19 -0000 1.8 --- ClassMapping.java 2 Feb 2003 04:48:27 -0000 1.9 *************** *** 484,489 **** Element collection = (Element) collections.next(); MultiMap metaForCollection = MetaAttributeHelper.loadAndMergeMetaMap(collection, inheritedMeta); ! String name = collection.getAttributeValue("role"); ! if (name==null) name = collection.getAttributeValue("name"); // add an import and field for this collection --- 484,488 ---- Element collection = (Element) collections.next(); MultiMap metaForCollection = MetaAttributeHelper.loadAndMergeMetaMap(collection, inheritedMeta); ! String name = collection.getAttributeValue("name"); // add an import and field for this collection *************** *** 536,541 **** Element array = (Element) arrays.next(); MultiMap metaForArray = MetaAttributeHelper.loadAndMergeMetaMap(array,inheritedMeta); ! String role = array.getAttributeValue("role"); ! if (role==null) role = array.getAttributeValue("name"); String elementClass = array.getAttributeValue("element-class"); if (elementClass==null) { --- 535,539 ---- Element array = (Element) arrays.next(); MultiMap metaForArray = MetaAttributeHelper.loadAndMergeMetaMap(array,inheritedMeta); ! String role = array.getAttributeValue("name"); String elementClass = array.getAttributeValue("element-class"); if (elementClass==null) { |