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-04-15 04:19:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv25173/hibernate/test Modified Files: Circular.hbm.xml FooBarTest.java Glarch.hbm.xml Glarch.java GlarchProxy.java Multiplicity.java MultiplicityType.java ParentChildTest.java Added Files: Super.java Log Message: fixed 2 problems with proxies * interface proxies were not being used properly * some method invocations were not being properly proxied --- NEW FILE: Super.java --- package net.sf.hibernate.test; public class Super { protected String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } Index: Circular.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Circular.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Circular.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 --- Circular.hbm.xml 15 Apr 2003 04:19:17 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping default-cascade="save-update"> ! <class name="net.sf.hibernate.test.Circular"> <id name="id" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> --- 3,7 ---- <hibernate-mapping default-cascade="save-update"> ! <class name="net.sf.hibernate.test.Circular" dynamic-update="true"> <id name="id" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex"/> Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** FooBarTest.java 8 Apr 2003 14:07:09 -0000 1.52 --- FooBarTest.java 15 Apr 2003 04:19:17 -0000 1.53 *************** *** 124,131 **** public void testCustom() throws Exception { ! Glarch g = new Glarch(); Multiplicity m = new Multiplicity(); m.count = 12; ! m.glarch = g; g.setMultiple(m); Session s = sessions.openSession(); --- 124,131 ---- public void testCustom() throws Exception { ! GlarchProxy g = new Glarch(); Multiplicity m = new Multiplicity(); m.count = 12; ! m.glarch = (Glarch) g; g.setMultiple(m); Session s = sessions.openSession(); *************** *** 145,149 **** s = sessions.openSession(); ! g = (Glarch) s.load(Glarch.class, gid); assertTrue( g.getMultiple()!=null ); assertEquals( g.getMultiple().count, 12 ); --- 145,149 ---- s = sessions.openSession(); ! g = (GlarchProxy) s.load(Glarch.class, gid); assertTrue( g.getMultiple()!=null ); assertEquals( g.getMultiple().count, 12 ); *************** *** 203,206 **** --- 203,207 ---- Session s = sessions.openSession(); GlarchProxy g = new Glarch(); + g.setName("G"); Serializable id = s.save(g); s.flush(); *************** *** 210,214 **** --- 211,217 ---- s = sessions.openSession(); g = (GlarchProxy) s.load(Glarch.class, id); + assertTrue( ( (Super) g ).getName().equals("G") ); assertTrue( g.getDynaBean().get("foo").equals("foo") && g.getDynaBean().get("bar").equals( new Integer(66) ) ); + //assertTrue( ! (g instanceof Glarch) ); g.getDynaBean().set("foo", "bar"); s.flush(); *************** *** 328,332 **** Session s = sessions.openSession(); Transaction t = s.beginTransaction(); ! Bar bar = new Bar(); bar.setBarComponent( new FooComponent() ); Baz baz = new Baz(); --- 331,335 ---- Session s = sessions.openSession(); Transaction t = s.beginTransaction(); ! BarProxy bar = new Bar(); bar.setBarComponent( new FooComponent() ); Baz baz = new Baz(); *************** *** 338,342 **** s = sessions.openSession(); t = s.beginTransaction(); ! bar = (Bar) s.load(Bar.class, bar.getKey()); s.load(baz, baz.getCode()); assertTrue( bar.getBarComponent().getParent()==bar ); --- 341,345 ---- s = sessions.openSession(); t = s.beginTransaction(); ! bar = (BarProxy) s.load(Bar.class, bar.getKey()); s.load(baz, baz.getCode()); assertTrue( bar.getBarComponent().getParent()==bar ); *************** *** 2844,2848 **** err=false; try { ! ( (Foo) s.load(Foo.class, id) ).getBool(); } catch (LazyInitializationException onfe) { --- 2847,2851 ---- err=false; try { ! ( (FooProxy) s.load(Foo.class, id) ).getBool(); } catch (LazyInitializationException onfe) { *************** *** 2878,2882 **** public void testObjectType() throws Exception { Session s = sessions.openSession(); ! Glarch g = new Glarch(); Foo foo = new Foo(); g.setAny(foo); --- 2881,2885 ---- public void testObjectType() throws Exception { Session s = sessions.openSession(); ! GlarchProxy g = new Glarch(); Foo foo = new Foo(); g.setAny(foo); *************** *** 2887,2892 **** s.close(); s = sessions.openSession(); ! g = (Glarch) s.load(Glarch.class, gid); ! assertTrue( g.getAny()!=null && g.getAny() instanceof Foo ); s.delete( g.getAny() ); s.delete(g); --- 2890,2895 ---- s.close(); s = sessions.openSession(); ! g = (GlarchProxy) s.load(Glarch.class, gid); ! assertTrue( g.getAny()!=null && g.getAny() instanceof FooProxy ); s.delete( g.getAny() ); s.delete(g); Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Glarch.hbm.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Glarch.hbm.xml 6 Apr 2003 10:11:11 -0000 1.12 --- Glarch.hbm.xml 15 Apr 2003 04:19:17 -0000 1.13 *************** *** 5,9 **** <class name="net.sf.hibernate.test.Glarch" table="glarchez" ! proxy="net.sf.hibernate.test.GlarchProxy" dynamic-update="true"> <!--<jcs-cache usage="read-write"/>--> --- 5,9 ---- <class name="net.sf.hibernate.test.Glarch" table="glarchez" ! proxy="net.sf.hibernate.test.Glarch" dynamic-update="true"> <!--<jcs-cache usage="read-write"/>--> Index: Glarch.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Glarch.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Glarch.java 6 Apr 2003 10:11:11 -0000 1.9 --- Glarch.java 15 Apr 2003 04:19:17 -0000 1.10 *************** *** 17,24 **** import org.apache.commons.beanutils.BasicDynaClass; ! public class Glarch implements GlarchProxy, Lifecycle, Named, Serializable { private int version; - private String name; private GlarchProxy next; private short order; --- 17,23 ---- import org.apache.commons.beanutils.BasicDynaClass; ! public class Glarch extends Super implements GlarchProxy, Lifecycle, Named, Serializable { private int version; private GlarchProxy next; private short order; *************** *** 49,59 **** public void setVersion(int version) { this.version = version; - } - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; } --- 48,51 ---- Index: GlarchProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/GlarchProxy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GlarchProxy.java 28 Jan 2003 10:22:21 -0000 1.5 --- GlarchProxy.java 15 Apr 2003 04:19:17 -0000 1.6 *************** *** 39,42 **** --- 39,48 ---- public Set getProxySet(); public void setProxySet(Set proxySet); + + public Multiplicity getMultiple(); + public void setMultiple(Multiplicity m); + + public Object getAny(); + public void setAny(Object any); } Index: Multiplicity.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Multiplicity.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Multiplicity.java 6 Apr 2003 10:16:49 -0000 1.1 --- Multiplicity.java 15 Apr 2003 04:19:17 -0000 1.2 *************** *** 5,8 **** public class Multiplicity implements Serializable { public int count; ! public Glarch glarch; } --- 5,8 ---- public class Multiplicity implements Serializable { public int count; ! public GlarchProxy glarch; } Index: MultiplicityType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MultiplicityType.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MultiplicityType.java 6 Apr 2003 10:16:50 -0000 1.1 --- MultiplicityType.java 15 Apr 2003 04:19:17 -0000 1.2 *************** *** 73,77 **** Integer c = (Integer) Hibernate.INTEGER.nullSafeGet( rs, names[0] ); ! Glarch g = (Glarch) Hibernate.association(Glarch.class).nullSafeGet(rs, names[1], session, owner); Multiplicity m = new Multiplicity(); m.count = c==null ? 0 : c.intValue(); --- 73,77 ---- Integer c = (Integer) Hibernate.INTEGER.nullSafeGet( rs, names[0] ); ! GlarchProxy g = (GlarchProxy) Hibernate.association(Glarch.class).nullSafeGet(rs, names[1], session, owner); Multiplicity m = new Multiplicity(); m.count = c==null ? 0 : c.intValue(); *************** *** 84,88 **** Multiplicity o = (Multiplicity) value; ! Glarch g; Integer c; if (o==null) { --- 84,88 ---- Multiplicity o = (Multiplicity) value; ! GlarchProxy g; Integer c; if (o==null) { Index: ParentChildTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ParentChildTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ParentChildTest.java 2 Apr 2003 13:10:39 -0000 1.9 --- ParentChildTest.java 15 Apr 2003 04:19:17 -0000 1.10 *************** *** 606,610 **** s = sessions.openSession(); g = (Parent) s.load( Parent.class, new Long( g.getId() ) ); ! assertTrue( g.getAny()!=null && g.getAny() instanceof Foo ); s.delete( g.getAny() ); s.delete(g); --- 606,610 ---- s = sessions.openSession(); g = (Parent) s.load( Parent.class, new Long( g.getId() ) ); ! assertTrue( g.getAny()!=null && g.getAny() instanceof FooProxy ); s.delete( g.getAny() ); s.delete(g); |
From: <one...@us...> - 2003-04-15 04:19:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy In directory sc8-pr-cvs1:/tmp/cvs-serv25173/hibernate/proxy Modified Files: CGLIBLazyInitializer.java Log Message: fixed 2 problems with proxies * interface proxies were not being used properly * some method invocations were not being properly proxied Index: CGLIBLazyInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/CGLIBLazyInitializer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CGLIBLazyInitializer.java 5 Apr 2003 07:48:45 -0000 1.5 --- CGLIBLazyInitializer.java 15 Apr 2003 04:19:17 -0000 1.6 *************** *** 25,29 **** try { return (HibernateProxy) Enhancer.enhance( ! persistentClass, interfaces, new CGLIBLazyInitializer(persistentClass, interfaces, id, getIdentifierMethod, session), --- 25,31 ---- try { return (HibernateProxy) Enhancer.enhance( ! (interfaces.length==1) ? ! persistentClass : ! null, interfaces, new CGLIBLazyInitializer(persistentClass, interfaces, id, getIdentifierMethod, session), |
From: <one...@us...> - 2003-04-15 04:19:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv25173/hibernate/persister Modified Files: AbstractEntityPersister.java Log Message: fixed 2 problems with proxies * interface proxies were not being used properly * some method invocations were not being properly proxied Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AbstractEntityPersister.java 10 Apr 2003 09:49:17 -0000 1.20 --- AbstractEntityPersister.java 15 Apr 2003 04:19:16 -0000 1.21 *************** *** 445,453 **** Method proxyGetter = identifierGetter.getMethod(); try { ! proxyGetter = ReflectHelper.getGetter( ! // model.getProxyInterface(), //we used this for old dynamic proxies ! mappedClass, //we use this for new CGLIB proxies ! identifierPropertyName ! ).getMethod(); } catch (Exception e) {} --- 445,450 ---- Method proxyGetter = identifierGetter.getMethod(); try { ! Class prox = model.getProxyInterface(); ! if (prox!=null) proxyGetter = ReflectHelper.getGetter(prox, identifierPropertyName).getMethod(); } catch (Exception e) {} |
From: <max...@us...> - 2003-04-12 14:58:37
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv19542/src/net/sf/hibernate/tool/hbm2java Modified Files: FinderRenderer.java Log Message: changed sessionMethod metatag to session-method to be more "compliant" to the other meta attribute names. Index: FinderRenderer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/FinderRenderer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FinderRenderer.java 5 Apr 2003 16:18:02 -0000 1.1 --- FinderRenderer.java 12 Apr 2003 14:58:34 -0000 1.2 *************** *** 37,41 **** * An optional parameter is meta tag at the class level of the format: * ! * <meta attribute="sessionMethod">com.whatever.SessionTable.getSessionTable().getSession();</meta> * * Which would be the way in which you get sessions if you use the Thread Local Session pattern --- 37,41 ---- * An optional parameter is meta tag at the class level of the format: * ! * <meta attribute="session-method">com.whatever.SessionTable.getSessionTable().getSession();</meta> * * Which would be the way in which you get sessions if you use the Thread Local Session pattern *************** *** 115,119 **** public void doFinders(ClassMapping classMapping, Map class2classmap, PrintWriter writer) { // Find out of there is a system wide way to get sessions defined ! String sessionMethod = classMapping.getMetaAsString("sessionMethod").trim(); // fields --- 115,119 ---- public void doFinders(ClassMapping classMapping, Map class2classmap, PrintWriter writer) { // Find out of there is a system wide way to get sessions defined ! String sessionMethod = classMapping.getMetaAsString("session-method").trim(); // fields |
From: <max...@us...> - 2003-04-12 14:47:39
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/test In directory sc8-pr-cvs1:/tmp/cvs-serv15836/src/net/sf/hibernate/tool/hbm2java/test Modified Files: Test.hbm.xml Log Message: Added support for <any> to hbm2java changed description meta-tag to class-description and field-description to avoid having inherited class-descriptions in properties. Index: Test.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/test/Test.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Test.hbm.xml 24 Jan 2003 13:30:20 -0000 1.3 --- Test.hbm.xml 12 Apr 2003 14:47:36 -0000 1.4 *************** *** 8,12 **** <class name="codegen.test.BasicPrincipal" table="tblPrincipal"> ! <meta attribute="description"> BasicPrinicpal is just a basic principal. And it got some javadoc too! @see Guest --- 8,13 ---- <class name="codegen.test.BasicPrincipal" table="tblPrincipal"> ! <meta attribute="beans-property-type">bound</meta> ! <meta attribute="class-description"> BasicPrinicpal is just a basic principal. And it got some javadoc too! @see Guest *************** *** 20,27 **** <property name="name" type="java.lang.String"> ! <meta attribute="description">An ordinary field with some more javadoc :)</meta> </property> <property name="count" ! type="int"/> <property name="initial" type="character"/> --- 21,31 ---- <property name="name" type="java.lang.String"> ! <meta attribute="field-description">An ordinary field with some more javadoc :)</meta> ! <meta attribute="finder">findByName</meta> </property> <property name="count" ! type="int"> ! <meta attribute="finder">findByCount</meta> ! </property> <property name="initial" type="character"/> *************** *** 98,102 **** <meta attribute="implements">codegen.test.IAuditable</meta> <meta attribute="generated-class">codegen.test.AutoPerson</meta> ! <meta attribute="description"> AutoPerson is a simple class, which illustrates the possibilities of the Hibernate meta tag. @author Zim Zala Bim --- 102,106 ---- <meta attribute="implements">codegen.test.IAuditable</meta> <meta attribute="generated-class">codegen.test.AutoPerson</meta> ! <meta attribute="class-description"> AutoPerson is a simple class, which illustrates the possibilities of the Hibernate meta tag. @author Zim Zala Bim *************** *** 108,115 **** <meta attribute="scope-get">public</meta> <meta attribute="scope">protected</meta> ! <meta attribute="description">A javadoc comment for the field name...</meta> </property> <property name="aDate" type="date"> </property> </class> --- 112,124 ---- <meta attribute="scope-get">public</meta> <meta attribute="scope">protected</meta> ! <meta attribute="field-description">A javadoc comment for the field name...</meta> </property> <property name="aDate" type="date"> </property> + + <any name="something" id-type="long" cascade="all"> + <column name="clazz" length="100"/> + <column name="gen_id"/> + </any> </class> |
From: <max...@us...> - 2003-04-12 14:47:39
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv15836/src/net/sf/hibernate/tool/hbm2java Modified Files: BasicRenderer.java ClassMapping.java Log Message: Added support for <any> to hbm2java changed description meta-tag to class-description and field-description to avoid having inherited class-descriptions in properties. Index: BasicRenderer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/BasicRenderer.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** BasicRenderer.java 5 Apr 2003 16:18:01 -0000 1.14 --- BasicRenderer.java 12 Apr 2003 14:47:36 -0000 1.15 *************** *** 41,48 **** // class declaration ! if(classMapping.getMeta("description")==null) { writer.println("/** @author Hibernate CodeGenerator */"); } else { ! writer.println("/** \n" + toJavaDoc(classMapping.getMetaAsString("description"),0) + "*/"); } --- 41,48 ---- // class declaration ! if(classMapping.getMeta("class-description")==null) { writer.println("/** @author Hibernate CodeGenerator */"); } else { ! writer.println("/** \n" + toJavaDoc(classMapping.getMetaAsString("class-description"),0) + "*/"); } *************** *** 373,378 **** ! if(field.getMeta("description")!=null) { ! writer.println(" /** \n" + toJavaDoc(field.getMetaAsString("description"), 4) + " */"); } writer.println(" " + getAccessScope + " " + getTrueTypeName(field, class2classmap) + " " + field.getGetterSignature() + " {"); --- 373,378 ---- ! if(field.getMeta("field-description")!=null) { ! writer.println(" /** \n" + toJavaDoc(field.getMetaAsString("field-description"), 4) + " */"); } writer.println(" " + getAccessScope + " " + getTrueTypeName(field, class2classmap) + " " + field.getGetterSignature() + " {"); Index: ClassMapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/ClassMapping.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ClassMapping.java 1 Mar 2003 12:15:28 -0000 1.13 --- ClassMapping.java 12 Apr 2003 14:47:36 -0000 1.14 *************** *** 110,113 **** --- 110,114 ---- propertyList.addAll( classElement.getChildren("timestamp") ); propertyList.addAll( classElement.getChildren("key-property") ); + propertyList.addAll( classElement.getChildren("any")); // get all many-to-one associations defined for the class *************** *** 170,173 **** --- 171,178 ---- if("timestamp".equals(property.getName())){ type = "java.util.Date"; + } + + if("any".equals(property.getName())) { + type = "java.lang.Object"; } |
From: <one...@us...> - 2003-04-12 10:06:24
|
Update of /cvsroot/hibernate/Hibernate2/lib In directory sc8-pr-cvs1:/tmp/cvs-serv31500 Modified Files: commons-logging.jar dom4j.jar Log Message: latest commons-logging and dom4j Index: commons-logging.jar =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/lib/commons-logging.jar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsflaV0g and /tmp/cvswCu0yn differ Index: dom4j.jar =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/lib/dom4j.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsiLu7wj and /tmp/cvstsaosn differ |
From: <one...@us...> - 2003-04-12 03:14:20
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv27882/reference/src Modified Files: manipulating_data.xml session_configuration.xml toolset_guide.xml Log Message: documented extra Dialects + mentioned setParameterList() Index: manipulating_data.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/manipulating_data.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** manipulating_data.xml 3 Mar 2003 06:39:11 -0000 1.5 --- manipulating_data.xml 12 Apr 2003 03:14:11 -0000 1.6 *************** *** 291,302 **** </itemizedlist> ! <programlisting><![CDATA[Query q = sess.createQuery("from eg.DomesticCat cat where cat.name = :name"); q.setString("name", "Fritz"); Iterator cats = q.iterate();]]></programlisting> ! <programlisting><![CDATA[Query q = sess.createQuery("from eg.DomesticCat cat where cat.name = ?"); ! q.setString(0, "PK"); Iterator cats = q.iterate();]]></programlisting> </sect2> --- 291,312 ---- </itemizedlist> ! <programlisting><![CDATA[//named parameter (preferred) ! Query q = sess.createQuery("from eg.DomesticCat cat where cat.name = :name"); q.setString("name", "Fritz"); Iterator cats = q.iterate();]]></programlisting> ! <programlisting><![CDATA[//positional parameter ! Query q = sess.createQuery("from eg.DomesticCat cat where cat.name = ?"); ! q.setString(0, "Izi"); Iterator cats = q.iterate();]]></programlisting> + <programlisting><![CDATA[//named parameter list + List names = new ArrayList(); + names.add("Izi"); + names.add("Fritz"); + Query q = sess.createQuery("from eg.DomesticCat cat where cat.name in (:namesList)"); + q.setParameterList("namesList", names); + List cats = q.list();]]></programlisting> + </sect2> *************** *** 989,992 **** --- 999,1006 ---- creates=0; } + + ...... + ...... + }]]></programlisting> Index: session_configuration.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/session_configuration.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** session_configuration.xml 29 Mar 2003 09:51:27 -0000 1.8 --- session_configuration.xml 12 Apr 2003 03:14:11 -0000 1.9 *************** *** 539,542 **** --- 539,545 ---- </row> <row> + <entry>Sybase Anywhere</entry> <entry><literal>net.sf.hibernate.dialect.SybaseAnywhereDialect</literal></entry> + </row> + <row> <entry>Progress</entry> <entry><literal>net.sf.hibernate.dialect.ProgressDialect</literal></entry> </row> *************** *** 561,564 **** --- 564,570 ---- <row> <entry>Ingres</entry> <entry><literal>net.sf.hibernate.dialect.IngresDialect</literal></entry> + </row> + <row> + <entry>Informix</entry> <entry><literal>net.sf.hibernate.dialect.InformixDialect</literal></entry> </row> <row> Index: toolset_guide.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/toolset_guide.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** toolset_guide.xml 4 Apr 2003 16:43:16 -0000 1.2 --- toolset_guide.xml 12 Apr 2003 03:14:11 -0000 1.3 *************** *** 75,78 **** --- 75,81 ---- </row> <row> + <entry>Sybase Anywhere</entry> <entry><literal>net.sf.hibernate.dialect.SybaseAnywhereDialect</literal></entry> + </row> + <row> <entry>Progress</entry> <entry><literal>net.sf.hibernate.dialect.ProgressDialect</literal></entry> </row> *************** *** 97,100 **** --- 100,106 ---- <row> <entry>Ingres</entry> <entry><literal>net.sf.hibernate.dialect.IngresDialect</literal></entry> + </row> + <row> + <entry>Informix</entry> <entry><literal>net.sf.hibernate.dialect.InformixDialect</literal></entry> </row> <row> |
From: <one...@us...> - 2003-04-12 02:09:46
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv12940 Modified Files: FrontBaseDialect.java Added Files: InformixDialect.java Log Message: * added InformixDialect (Steve Molitor) * FrontBase does not suport FOR UPDATE (Ron Lussier) --- NEW FILE: InformixDialect.java --- package net.sf.hibernate.dialect; import java.sql.Types; import net.sf.hibernate.MappingException; /** * Informix dialect. This class is required in order to use Hibernate with * Informix. * * Seems to work with Informix Dynamic Server Version 7.31.UD3, * Informix JDBC driver version 2.21JC3. */ public class InformixDialect extends Dialect { /** * Creates new <code>InformixDialect</code> instance. Sets up the JDBC / * Informix type mappings. */ public InformixDialect() { super(); register(Types.BIGINT, "INT8"); register(Types.BINARY, "BYTE"); register(Types.BIT, "SMALLINT"); // Informix doesn't have a bit type register(Types.CHAR, "CHAR($l)"); register(Types.DATE, "DATE"); register(Types.DECIMAL, "DECIMAL"); register(Types.DOUBLE, "DOUBLE"); register(Types.FLOAT, "FLOAT"); register(Types.INTEGER, "INTEGER"); register(Types.LONGVARBINARY, "BLOB"); // or BYTE register(Types.LONGVARCHAR, "CLOB"); // or TEXT? register(Types.NUMERIC, "DECIMAL"); // or MONEY register(Types.REAL, "SMALLFLOAT"); register(Types.SMALLINT, "SMALLINT"); register(Types.TIME, "DATETIME YEAR TO FRACTION(5)"); register(Types.TIMESTAMP, "DATETIME HOUR TO SECOND"); register(Types.TINYINT, "SMALLINT"); register(Types.VARBINARY, "BYTE"); register(Types.VARCHAR, "VARCHAR($l)"); } /** * @see net.sf.hibernate.dialect.Dialect#getAddColumnString() * @deprecated */ public String getAddColumnString() { return "add"; } /** * @see net.sf.hibernate.dialect.Dialect#supportsIdentityColumns() */ public boolean supportsIdentityColumns() { return true; } /** * @see net.sf.hibernate.dialect.Dialect#getIdentitySelectString() */ public String getIdentitySelectString() throws MappingException { return "select first 1 dbinfo('sqlca.sqlerrd1') from systables"; } /** * @see net.sf.hibernate.dialect.Dialect#getIdentityColumnString() */ public String getIdentityColumnString() throws MappingException { return "SERIAL NOT NULL"; } } Index: FrontBaseDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/FrontBaseDialect.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FrontBaseDialect.java 1 Mar 2003 21:27:29 -0000 1.1 --- FrontBaseDialect.java 12 Apr 2003 02:09:43 -0000 1.2 *************** *** 4,8 **** /** ! * An SQL Dialect for Frontbase. * * @author ron lussier - rlu...@le... --- 4,19 ---- /** ! * An SQL Dialect for Frontbase. Assumes you're using the latest version ! * of the FrontBase JDBC driver, available from <tt>http://frontbase.com/</tt> ! * <p> ! * <b>NOTE</b>: The latest JDBC driver is not always included with the ! * latest release of FrontBase. Download the driver separately, and enjoy ! * the informative release notes. ! * <p> ! * This dialect was tested with JDBC driver version 2.3.1. This driver ! * contains a bug that causes batches of updates to fail. (The bug should be ! * fixed in the next release of the JDBC driver.) If you are using JDBC driver ! * 2.3.1, you can work-around this problem by setting the following in your ! * <tt>hibernate.properties</tt> file: <tt>hibernate.jdbc.batch_size=15</tt> * * @author ron lussier - rlu...@le... *************** *** 38,40 **** --- 49,63 ---- return " cascade"; } + + /** + * Does this dialect support the <tt>FOR UPDATE</tt> syntax? No! + * + * @return false always. FrontBase doesn't support this syntax, + * which was dropped with SQL92 + */ + public boolean supportsForUpdate() + { + return false; + } + } |
From: <one...@us...> - 2003-04-11 07:16:25
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv12292/hibernate Modified Files: Hibernate.java hibernate-mapping-2.0.dtd Log Message: added meta-type to <any> mappings Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Hibernate.java 6 Apr 2003 02:28:55 -0000 1.10 --- Hibernate.java 11 Apr 2003 07:15:50 -0000 1.11 *************** *** 184,191 **** /** * A Hibernate <tt>any</tt> type * @param identifierType the entity identifier type */ ! public static Type any(Type identifierType) { ! return new ObjectType(identifierType); } /** --- 184,192 ---- /** * A Hibernate <tt>any</tt> type + * @param metaType a type mapping <tt>java.lang.Class</tt> to a single column * @param identifierType the entity identifier type */ ! public static Type any(Type metaType, Type identifierType) { ! return new ObjectType(metaType, identifierType); } /** Index: hibernate-mapping-2.0.dtd =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hibernate-mapping-2.0.dtd,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** hibernate-mapping-2.0.dtd 8 Apr 2003 09:49:26 -0000 1.22 --- hibernate-mapping-2.0.dtd 11 Apr 2003 07:15:51 -0000 1.23 *************** *** 182,185 **** --- 182,186 ---- <!ELEMENT any (column, column+)> <!ATTLIST any id-type CDATA #REQUIRED> + <!ATTLIST any meta-type CDATA #IMPLIED> <!--- default: Hibernate.CLASS --> <!ATTLIST any name CDATA #REQUIRED> <!ATTLIST any cascade (none|save-update|all) "none"> *************** *** 378,384 **** --- 379,387 ---- <!ELEMENT many-to-any (column, column+)> <!ATTLIST many-to-any id-type CDATA #REQUIRED> + <!ATTLIST many-to-any meta-type CDATA #IMPLIED> <!--- default: Hibernate.CLASS --> <!ELEMENT index-many-to-any (column, column+)> <!ATTLIST index-many-to-any id-type CDATA #REQUIRED> + <!ATTLIST index-many-to-any meta-type CDATA #IMPLIED> <!--- default: Hibernate.CLASS --> <!-- Generators generate unique identifiers. The class attribute specifies a Java class |
From: <one...@us...> - 2003-04-11 07:15:58
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv12292/hibernate/type Modified Files: ObjectType.java Log Message: added meta-type to <any> mappings Index: ObjectType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/ObjectType.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ObjectType.java 8 Apr 2003 09:49:35 -0000 1.9 --- ObjectType.java 11 Apr 2003 07:15:54 -0000 1.10 *************** *** 21,32 **** public class ObjectType extends AbstractType implements AbstractComponentType, AssociationType { ! private Type identifierType; ! public ObjectType(Type identifierType) { ! this.identifierType = identifierType; } public ObjectType() { ! this(Hibernate.SERIALIZABLE); } --- 21,34 ---- public class ObjectType extends AbstractType implements AbstractComponentType, AssociationType { ! private final Type identifierType; ! private final Type metaType; ! public ObjectType(Type metaType, Type identifierType) { ! this.identifierType = identifierType; ! this.metaType = metaType; } public ObjectType() { ! this(Hibernate.CLASS, Hibernate.SERIALIZABLE); } *************** *** 92,96 **** //if ( names.length!=2 ) throw new HibernateException("object type mapping must specify exactly two columns"); ! Class clazz = (Class) Hibernate.CLASS.nullSafeGet( rs, names[0] ); Serializable id = (Serializable) identifierType.nullSafeGet(rs, names[1], session, owner); if (clazz==null || id==null) { --- 94,98 ---- //if ( names.length!=2 ) throw new HibernateException("object type mapping must specify exactly two columns"); ! Class clazz = (Class) metaType.nullSafeGet(rs, names[0], session, owner); Serializable id = (Serializable) identifierType.nullSafeGet(rs, names[1], session, owner); if (clazz==null || id==null) { *************** *** 119,124 **** } ! Hibernate.CLASS.nullSafeSet(st, clazz, index, session); ! identifierType.nullSafeSet(st, id, index+1, session); } --- 121,126 ---- } ! metaType.nullSafeSet(st, clazz, index, session); ! identifierType.nullSafeSet(st, id, index+1, session); // metaType must be single-column type } *************** *** 137,141 **** public int[] sqlTypes(Mapping mapping) throws MappingException { return ArrayHelper.join( ! Hibernate.CLASS.sqlTypes(mapping), identifierType.sqlTypes(mapping) ); --- 139,143 ---- public int[] sqlTypes(Mapping mapping) throws MappingException { return ArrayHelper.join( ! metaType.sqlTypes(mapping), identifierType.sqlTypes(mapping) ); *************** *** 230,234 **** public Type[] getSubtypes() { ! return new Type[] { Hibernate.CLASS, identifierType }; } --- 232,236 ---- public Type[] getSubtypes() { ! return new Type[] { metaType, identifierType }; } |
From: <one...@us...> - 2003-04-11 07:15:58
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv12292/hibernate/mapping Modified Files: Any.java Log Message: added meta-type to <any> mappings Index: Any.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Any.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Any.java 8 Apr 2003 09:49:30 -0000 1.2 --- Any.java 11 Apr 2003 07:15:53 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- package net.sf.hibernate.mapping; + import net.sf.hibernate.Hibernate; import net.sf.hibernate.type.ObjectType; import net.sf.hibernate.type.Type; *************** *** 8,11 **** --- 9,13 ---- private Type identifierType; + private Type metaType = Hibernate.CLASS; public boolean isAny() { *************** *** 32,36 **** public Type getType() { ! return new ObjectType(identifierType); } --- 34,38 ---- public Type getType() { ! return new ObjectType(metaType, identifierType); } *************** *** 40,43 **** --- 42,53 ---- public void setTypeByReflection(Class propertyClass, String propertyName) {} + + public Type getMetaType() { + return metaType; + } + + public void setMetaType(Type type) { + metaType = type; + } } |
From: <one...@us...> - 2003-04-11 07:15:58
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv12292/hibernate/cfg Modified Files: Binder.java Log Message: added meta-type to <any> mappings Index: Binder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Binder.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Binder.java 6 Apr 2003 02:28:56 -0000 1.13 --- Binder.java 11 Apr 2003 07:15:52 -0000 1.14 *************** *** 200,204 **** if (propertyName==null) { bindValue(subnode, id, false, RootClass.DEFAULT_IDENTIFIER_COLUMN_NAME); ! if (id.getType()==null) throw new MappingException( "must specify an identifier type: " + model.getPersistentClass().getName() ); model.setIdentifierProperty(null); } --- 200,206 ---- if (propertyName==null) { bindValue(subnode, id, false, RootClass.DEFAULT_IDENTIFIER_COLUMN_NAME); ! if (id.getType()==null) throw new MappingException( ! "must specify an identifier type: " + model.getPersistentClass().getName() ! ); model.setIdentifierProperty(null); } *************** *** 225,229 **** else { Class reflectedClass = ReflectHelper.getGetter( model.getPersistentClass(), propertyName ).getReturnType(); ! bindComponent(subnode, id, reflectedClass, model.getName() + StringHelper.DOT + propertyName, false, mappings); Property prop = new Property(id); bindProperty(subnode, prop, mappings); --- 227,238 ---- else { Class reflectedClass = ReflectHelper.getGetter( model.getPersistentClass(), propertyName ).getReturnType(); ! bindComponent( ! subnode, ! id, ! reflectedClass, ! model.getName() + StringHelper.DOT + propertyName, ! false, ! mappings ! ); Property prop = new Property(id); bindProperty(subnode, prop, mappings); *************** *** 332,336 **** model.setName( getPropertyName(node) ); Type type = model.getValue().getType(); ! if (type==null) throw new MappingException( "Could not determine a property type for: " + model.getName() ); Attribute cascadeNode = node.attribute("cascade"); model.setCascade( (cascadeNode==null) ? --- 341,347 ---- model.setName( getPropertyName(node) ); Type type = model.getValue().getType(); ! if (type==null) throw new MappingException( ! "Could not determine a property type for: " + model.getName() ! ); Attribute cascadeNode = node.attribute("cascade"); model.setCascade( (cascadeNode==null) ? *************** *** 467,470 **** --- 478,487 ---- public static void bindAny(Element node, Any model, boolean isNullable) throws MappingException { model.setIdentifierType( getTypeFromXML(node) ); + Attribute metaAttribute = node.attribute("meta-type"); + if (metaAttribute!=null) { + Type metaType = TypeFactory.hueristicType( metaAttribute.getValue() ); + if ( metaType==null ) throw new MappingException("could not interpret meta-type"); + model.setMetaType(metaType); + } bindColumns(node, model, isNullable, false, null); } *************** *** 478,482 **** model.setConstrained(constrained); ! model.setForeignKeyType(constrained ? AssociationType.FOREIGN_KEY_FROM_PARENT : AssociationType.FOREIGN_KEY_TO_PARENT); Attribute typeNode = node.attribute("class"); --- 495,503 ---- model.setConstrained(constrained); ! model.setForeignKeyType( ! constrained ? ! AssociationType.FOREIGN_KEY_FROM_PARENT : ! AssociationType.FOREIGN_KEY_TO_PARENT ! ); Attribute typeNode = node.attribute("class"); *************** *** 484,488 **** try { model.setType( ! TypeFactory.oneToOne( ReflectHelper.classForName( typeNode.getValue() ), model.getForeignKeyType() ) ); } --- 505,512 ---- try { model.setType( ! TypeFactory.oneToOne( ! ReflectHelper.classForName( typeNode.getValue() ), ! model.getForeignKeyType() ! ) ); } *************** *** 549,553 **** ); } ! else if ( "one-to-many".equals(name) || "many-to-many".equals(name) || "composite-element".equals(name) ) { try { model.setElementClass( --- 573,581 ---- ); } ! else if ( ! "one-to-many".equals(name) || ! "many-to-many".equals(name) || ! "composite-element".equals(name) ! ) { try { model.setElementClass( *************** *** 609,613 **** Value value = null; if (collectType!=null) { ! Collection collection = collectType.create( subnode, path, model.getOwner(), mappings ); mappings.addCollection(collection); value = new Value( model.getTable() ); --- 637,641 ---- Value value = null; if (collectType!=null) { ! Collection collection = collectType.create(subnode, path, model.getOwner(), mappings); mappings.addCollection(collection); value = new Value( model.getTable() ); *************** *** 631,635 **** bindValue(subnode, value, isNullable, propertyName); } ! else if ( "component".equals(name) || "dynabean".equals(name) || "nested-composite-element".equals(name) ) { Class subreflectedClass = (model.getComponentClass()==null) ? null : --- 659,667 ---- bindValue(subnode, value, isNullable, propertyName); } ! else if ( ! "component".equals(name) || ! "dynabean".equals(name) || ! "nested-composite-element".equals(name) ! ) { Class subreflectedClass = (model.getComponentClass()==null) ? null : *************** *** 677,681 **** ( model.getComponentClass()==null ) ? (Type) new DynaBeanType(model.getDynaClass(), names, types, joinedFetch, cascade) : ! (Type) new ComponentType( model.getComponentClass(), names, types, joinedFetch, cascade, model.getParentProperty(), model.isEmbedded() ) ); } --- 709,721 ---- ( model.getComponentClass()==null ) ? (Type) new DynaBeanType(model.getDynaClass(), names, types, joinedFetch, cascade) : ! (Type) new ComponentType( ! model.getComponentClass(), ! names, ! types, ! joinedFetch, ! cascade, ! model.getParentProperty(), ! model.isEmbedded() ! ) ); } |
From: <one...@us...> - 2003-04-11 07:12:26
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv10161/reference/src Modified Files: advanced_or_mapping.xml basic_or_mapping.xml query_language.xml Log Message: documented <any> and fixed doco bugs Index: advanced_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/advanced_or_mapping.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** advanced_or_mapping.xml 6 Apr 2003 11:03:12 -0000 1.14 --- advanced_or_mapping.xml 11 Apr 2003 07:12:21 -0000 1.15 *************** *** 500,504 **** ! <sect2 id="adv-or-mapping-s1-11"> <title>Ternary Associations</title> <para> --- 500,504 ---- ! <sect2 id="adv-or-mapping-s1-11a"> <title>Ternary Associations</title> <para> *************** *** 521,524 **** --- 521,534 ---- </sect2> + + <sect2 id="adv-or-mapping-s1-11b"> + <title>Heterogeneous Associations</title> + <para> + The <literal><many-to-any></literal> and <literal><index-many-to-any></literal> + elements provide for true heterogeneous associations. These mapping elements work in the + same way as the <literal><any></literal> element - and should also be used + rarely, if ever. + </para> + </sect2> <sect2 id="adv-or-mapping-s1-12"> *************** *** 1029,1033 **** </sect2> ! <sect2 id="adv-or-mapping-s3-3"> <title>Nonstrict Read / Write Cache</title> --- 1039,1043 ---- </sect2> ! <sect2 id="adv-or-mapping-s3-4"> <title>Nonstrict Read / Write Cache</title> Index: basic_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/basic_or_mapping.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** basic_or_mapping.xml 6 Apr 2003 10:41:43 -0000 1.13 --- basic_or_mapping.xml 11 Apr 2003 07:12:21 -0000 1.14 *************** *** 744,748 **** <callout arearefs="property1"> <para> ! <literal>name</literal> the name of the property, with an initial lowercase letter. </para> --- 744,748 ---- <callout arearefs="property1"> <para> ! <literal>name</literal>: the name of the property, with an initial lowercase letter. </para> *************** *** 750,754 **** <callout arearefs="property2"> <para> ! <literal>column</literal> (optional - defaults to the property name) the name of the mapped database table column. </para> --- 750,754 ---- <callout arearefs="property2"> <para> ! <literal>column</literal> (optional - defaults to the property name): the name of the mapped database table column. </para> *************** *** 756,765 **** <callout arearefs="property3"> <para> ! <literal>type</literal> (optional) a name that indicates the Hibernate type. </para> </callout> <callout arearefs="property4-5"> <para> ! <literal>update, insert</literal> (optional - defaults to <literal>true</literal>) specifies that the mapped columns should be included in SQL <literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. Setting both to <literal>false</literal> --- 756,765 ---- <callout arearefs="property3"> <para> ! <literal>type</literal> (optional): a name that indicates the Hibernate type. </para> </callout> <callout arearefs="property4-5"> <para> ! <literal>update, insert</literal> (optional - defaults to <literal>true</literal>) : specifies that the mapped columns should be included in SQL <literal>UPDATE</literal> and/or <literal>INSERT</literal> statements. Setting both to <literal>false</literal> *************** *** 1499,1503 **** There is one further type of property mapping. The <literal><any></literal> mapping element defines a polymorphic association to classes from multiple tables. This type of mapping always ! requires more than one column. The first column holds the class name of the associated entity. The remaining columns hold the identifier. It is impossible to specify a foreign key constraint for this kind of association, so this is most certainly not meant as the usual way of mapping --- 1499,1503 ---- There is one further type of property mapping. The <literal><any></literal> mapping element defines a polymorphic association to classes from multiple tables. This type of mapping always ! requires more than one column. The first column holds the type of the associated entity. The remaining columns hold the identifier. It is impossible to specify a foreign key constraint for this kind of association, so this is most certainly not meant as the usual way of mapping *************** *** 1506,1520 **** </para> ! <programlisting><![CDATA[<any name="anyEntity" id-type="long"> ! <column name="class_name"/> <column name="id"/> </any>]]></programlisting> <para> The old <literal>object</literal> type that filled a similar role in Hibernate 1.2 is still supported, but is now semi-deprecated. </para> ! </sect2> </sect1> --- 1506,1569 ---- </para> ! <programlisting><![CDATA[<any name="anyEntity" id-type="long" meta-type="eg.custom.Class2TablenameType"> ! <column name="table_name"/> <column name="id"/> </any>]]></programlisting> <para> + The <literal>meta-type</literal> attribute lets the application specify a custom type that maps + database column values to persistent classes which have identifier properties of the type + specified by <literal>id-type</literal>. + </para> + + <programlistingco> + <areaspec> + <area id="any1" coords="2 42"/> + <area id="any2" coords="3 42"/> + <area id="any3" coords="4 42"/> + <area id="any4" coords="5 42"/> + </areaspec> + <programlisting><![CDATA[<any + name="propertyName" + id-type="idtypename" + meta-type="metatypename" + cascade="none|all|save-update" + > + <column .... /> + <column .... /> + ..... + </any>]]></programlisting> + <calloutlist> + <callout arearefs="any1"> + <para> + <literal>name</literal>: the property name. + </para> + </callout> + <callout arearefs="any2"> + <para> + <literal>id-type</literal>: the identifier type. + </para> + </callout> + <callout arearefs="any3"> + <para> + <literal>meta-type</literal> (optional - defaults to <literal>class</literal>): + a type that maps <literal>java.lang.Class</literal> to a single database column. + </para> + </callout> + <callout arearefs="any4"> + <para> + <literal>cascade</literal> (optional- defaults to <literal>none</literal>): + the cascade style. + </para> + </callout> + </calloutlist> + </programlistingco> + + <para> The old <literal>object</literal> type that filled a similar role in Hibernate 1.2 is still supported, but is now semi-deprecated. </para> ! </sect2> </sect1> Index: query_language.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/query_language.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** query_language.xml 31 Mar 2003 06:35:28 -0000 1.9 --- query_language.xml 11 Apr 2003 07:12:21 -0000 1.10 *************** *** 325,333 **** <programlisting><![CDATA[from eg.Cat cat where cat.class = eg.DomesticCat]]></programlisting> ! <para> ! You may also specify properties of components (and of components of components). ! Never try to use a path-expression that ends in a property of component type ! (as opposed to a property of a component). For example, if <literal>store.owner</literal> is an entity with a component <literal>address</literal> </para> --- 325,333 ---- <programlisting><![CDATA[from eg.Cat cat where cat.class = eg.DomesticCat]]></programlisting> ! <para> ! You may also specify properties of components or composite user types (and of components ! of components, etc). Never try to use a path-expression that ends in a property of component ! type (as opposed to a property of a component). For example, if <literal>store.owner</literal> is an entity with a component <literal>address</literal> </para> *************** *** 336,339 **** --- 336,353 ---- store.owner.address //error!]]></programlisting> + <para> + An "any" type has the special properties <literal>id</literal> and <literal>class</literal>, + allowing us to express a join in the following way (where <literal>AuditLog.item</literal> + is a property mapped with <literal><any></literal>). + </para> + + <programlisting><![CDATA[from eg.AuditLog log, eg.Payment payment + where log.item.class = 'eg.Payment' and log.item.id = payment.id]]></programlisting> + + <para> + Notice that <literal>log.item.class</literal> and <literal>payment.class</literal> + would refer to the values of completely different database columns in the above query. + </para> + </sect1> |
From: <one...@us...> - 2003-04-10 09:53:47
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv6773/impl Modified Files: SessionFactoryImpl.java Log Message: fixed bug in Filter cache Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionFactoryImpl.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** SessionFactoryImpl.java 4 Mar 2003 10:43:06 -0000 1.64 --- SessionFactoryImpl.java 10 Apr 2003 09:53:40 -0000 1.65 *************** *** 314,318 **** public FilterTranslator getFilter(String query, String collectionRole, boolean scalar) throws QueryException, MappingException { ! String cacheKey = (scalar?'#':'*') + query; //a but expedient, i know.... FilterTranslator q = (FilterTranslator) queryCache.get(cacheKey); --- 314,318 ---- public FilterTranslator getFilter(String query, String collectionRole, boolean scalar) throws QueryException, MappingException { ! String cacheKey = collectionRole + (scalar?'#':'*') + query; //a but expedient, i know.... FilterTranslator q = (FilterTranslator) queryCache.get(cacheKey); |
From: <one...@us...> - 2003-04-10 09:49:49
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/engine Modified Files: SessionFactoryImplementor.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: SessionFactoryImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionFactoryImplementor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SessionFactoryImplementor.java 8 Apr 2003 14:26:40 -0000 1.7 --- SessionFactoryImplementor.java 10 Apr 2003 09:49:16 -0000 1.8 *************** *** 35,43 **** */ public CollectionPersister getCollectionPersister(String role) throws MappingException; ! ! /** ! * Is the reflection optimizer enabled? ! */ ! public boolean useReflectionOptimizer(); /** * Is outerjoin fetching enabled? --- 35,39 ---- */ public CollectionPersister getCollectionPersister(String role) throws MappingException; ! /** * Is outerjoin fetching enabled? |
From: <one...@us...> - 2003-04-10 09:49:49
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/cfg Modified Files: Environment.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Environment.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Environment.java 8 Apr 2003 14:26:37 -0000 1.8 --- Environment.java 10 Apr 2003 09:49:15 -0000 1.9 *************** *** 26,36 **** * determined by the <tt>Environment</tt> properties. * </ul> ! * The only system-level property is * <ul> * <li><tt>hibernate.jdbc.use_streams_for_binary</tt> * </ul> * <tt>Environment</tt> properties are populated by calling <tt>System.getProperties()</tt> * and then from a resource named <tt>/hibernate.properties</tt> if it exists. System ! * properties override properties specified in <tt>hibernate.properties</tt>. * * @see SessionFactory --- 26,128 ---- * determined by the <tt>Environment</tt> properties. * </ul> ! * The only system-level properties are * <ul> * <li><tt>hibernate.jdbc.use_streams_for_binary</tt> + * <li><tt>hibernate.cglib.use_reflection_optimizer</tt> * </ul> * <tt>Environment</tt> properties are populated by calling <tt>System.getProperties()</tt> * and then from a resource named <tt>/hibernate.properties</tt> if it exists. System ! * properties override properties specified in <tt>hibernate.properties</tt>.<br> ! * <br> ! * The <tt>SessionFactory</tt> is controlled by the following properties. ! * Properties may be either be <tt>System</tt> properties, properties ! * defined in a resource named <tt>/hibernate.properties</tt> an instance of ! * <tt>java.util.Properties</tt> passed to ! * <tt>Configuration.buildSessionFactory()</tt><br> ! * <br> ! * <table> ! * <tr><td><b>property</b></td><td><b>meaning</b></td></tr> ! * <tr> ! * <td><tt>hibernate.dialect</tt></td> ! * <td>classname of <tt>net.sf.hibernate.sql.Dialect</tt> subclass</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.provider_class</tt></td> ! * <td>classname of <tt>net.sf.hibernate.connection.ConnectionProvider</tt> ! * subclass (if not specified hueristics are used)</td> ! * </tr> ! * <tr><td><tt>hibernate.connection.username</tt></td><td>database username</td></tr> ! * <tr><td><tt>hibernate.connection.password</tt></td><td>database password</td></tr> ! * <tr> ! * <td><tt>hibernate.connection.url</tt></td> ! * <td>JDBC URL (when using <tt>java.sql.DriverManager</tt>)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.driver_class</tt></td> ! * <td>classname of JDBC driver</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.isolation</tt></td> ! * <td>JDBC transaction isolation level (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <td><tt>hibernate.connection.pool_size</tt></td> ! * <td>the maximum size of the connection pool (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.statement_cache.size</tt></td> ! * <td>the maximum size of the prepared statement cache (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.datasource</tt></td> ! * <td>databasource JNDI name (when using <tt>javax.sql.Datasource</tt>)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jndi.url</tt></td><td>JNDI <tt>InitialContext</tt> URL</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jndi.class</tt></td><td>JNDI <tt>InitialContext</tt> classname</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.use_outer_join</tt></td> ! * <td>enable outer join fetching</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.batch_size</tt></td> ! * <td>enable use of JDBC2 batch API for drivers which support it</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.fetch_size</tt></td> ! * <td>set the JDBC fetch size</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.use_scrollable_resultset</tt></td> ! * <td>enable use of JDBC2 scrollable resultsets (you only need this specify ! * this property when using user supplied connections)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.default_schema</tt></td> ! * <td>use given schema name for unqualified tables (always optional)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.session_factory_name</tt></td> ! * <td>If set, the factory attempts to bind this name to itself in the ! * JNDI context. This name is also used to support cross JVM <tt> ! * Session</tt> (de)serialization.</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.transaction.factory_class</tt></td> ! * <td>the factory to use for instantiating <tt>Transaction</tt>s. ! * (Defaults to <tt>JDBCTransactionFactory</tt>.)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.query.imports</tt></td><td>query language package imports</td> ! * </tr> ! * </table> * * @see SessionFactory *************** *** 260,263 **** --- 352,356 ---- private static final boolean jvmSupportsProxies; private static final boolean useStreamsForBinary; + private static final boolean useReflectionOptimizer; private static final boolean jvmSupportsLinkedHashCollections; *************** *** 307,310 **** --- 400,404 ---- properties = new Properties(); + properties.setProperty( USE_REFLECTION_OPTIMIZER, Boolean.TRUE.toString() ); InputStream stream = Environment.class.getResourceAsStream("/hibernate.properties"); *************** *** 327,332 **** --- 421,428 ---- useStreamsForBinary = PropertiesHelper.getBoolean(USE_STREAMS_FOR_BINARY, properties); + useReflectionOptimizer = PropertiesHelper.getBoolean(USE_REFLECTION_OPTIMIZER, properties); if (useStreamsForBinary) log.info("using java.io streams to persist binary types"); + if (useReflectionOptimizer) log.info("using CGLIB reflection optimizer"); boolean proxySupport; *************** *** 373,376 **** --- 469,473 ---- * Should we use streams to bind binary types to JDBC IN parameters? * Property <tt>hibernate.jdbc.use_streams_for_binary</tt>. + * @see USE_STREAMS_FOR_BINARY */ public static boolean useStreamsForBinary() { *************** *** 378,381 **** --- 475,487 ---- } + /** + * Should we use CGLIB reflection optimizer? + * Property <tt>hibernate.jdbc.use_refection_optimizer</tt>. + * @see USE_REFLECTION_OPTIMIZER + */ + public static boolean useReflectionOptimizer() { + return useReflectionOptimizer; + } + private Environment() { throw new UnsupportedOperationException(); } *************** *** 396,400 **** * @see java.sql.Connection * @param isolation as defined by <tt>java.sql.Connection</tt> ! * @return String */ public static String isolationLevelToString(int isolation) { --- 502,506 ---- * @see java.sql.Connection * @param isolation as defined by <tt>java.sql.Connection</tt> ! * @return a human-readable name */ public static String isolationLevelToString(int isolation) { |
From: <one...@us...> - 2003-04-10 09:49:48
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/cache Modified Files: NonstrictReadWriteCache.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: NonstrictReadWriteCache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/NonstrictReadWriteCache.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NonstrictReadWriteCache.java 4 Apr 2003 13:51:59 -0000 1.1 --- NonstrictReadWriteCache.java 10 Apr 2003 09:49:15 -0000 1.2 *************** *** 7,10 **** --- 7,12 ---- public class NonstrictReadWriteCache implements CacheConcurrencyStrategy { + private static final long TIMEOUT = 10000; + private final Cache cache; *************** *** 25,29 **** public void lock(Object key) throws CacheException { ! //cache.put(key, null); } --- 27,32 ---- public void lock(Object key) throws CacheException { ! // in case the server crashes, we need the lock to timeout ! cache.put( key, new Long( TIMEOUT + Timestamper.next() / Timestamper.ONE_MS ) ); } *************** *** 54,57 **** --- 57,61 ---- public void release(Object key) throws CacheException { if ( log.isDebugEnabled() ) log.debug("Invalidating: " + key); + // remove the lock (any later transaction can recache) cache.put( key, new Long( Timestamper.next() / Timestamper.ONE_MS ) ); } |
From: <one...@us...> - 2003-04-10 09:49:48
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate Modified Files: SessionFactory.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: SessionFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/SessionFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SessionFactory.java 22 Feb 2003 06:42:06 -0000 1.7 --- SessionFactory.java 10 Apr 2003 09:49:15 -0000 1.8 *************** *** 12,116 **** /** ! * Creates <tt>Session</tt>s. Usually an application has a single ! * <tt>SessionFactory</tt>. Threads servicing client requests obtain ! * <tt>Session</tt>s from the factory.<br> * <br> * Implementors must be threadsafe.<br> * <br> ! * The <tt>SessionFactory</tt> is controlled by the following properties. ! * Properties may be either be <tt>System</tt> properties, properties ! * defined in a resource named <tt>/hibernate.properties</tt> in ! * the classpath or a <tt>java.util.Properties</tt> passed to ! * <tt>Configuration.buildSessionFactory()</tt><br> ! * <br> ! * <table> ! * <tr><td><b>property</b></td><td><b>meaning</b></td></tr> ! * <tr> ! * <td><tt>hibernate.dialect</tt></td> ! * <td>classname of <tt>net.sf.hibernate.sql.Dialect</tt> subclass</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.provider_class</tt></td> ! * <td>classname of <tt>net.sf.hibernate.connection.ConnectionProvider</tt> ! * subclass (if not specified hueristics are used)</td> ! * </tr> ! * <tr><td><tt>hibernate.connection.username</tt></td><td>database username</td></tr> ! * <tr><td><tt>hibernate.connection.password</tt></td><td>database password</td></tr> ! * <tr> ! * <td><tt>hibernate.connection.url</tt></td> ! * <td>JDBC URL (when using <tt>java.sql.DriverManager</tt>)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.driver_class</tt></td> ! * <td>classname of JDBC driver</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.isolation</tt></td> ! * <td>JDBC transaction isolation level (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <td><tt>hibernate.connection.pool_size</tt></td> ! * <td>the maximum size of the connection pool (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.statement_cache.size</tt></td> ! * <td>the maximum size of the prepared statement cache (only when using ! * <tt>java.sql.DriverManager</tt>) ! * </td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.connection.datasource</tt></td> ! * <td>databasource JNDI name (when using <tt>javax.sql.Datasource</tt>)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jndi.url</tt></td><td>JNDI <tt>InitialContext</tt> URL</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jndi.class</tt></td><td>JNDI <tt>InitialContext</tt> classname</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.use_outer_join</tt></td> ! * <td>enable outer join fetching</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.batch_size</tt></td> ! * <td>enable use of JDBC2 batch API for drivers which support it</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.fetch_size</tt></td> ! * <td>set the JDBC fetch size</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.jdbc.use_scrollable_resultset</tt></td> ! * <td>enable use of JDBC2 scrollable resultsets (you only need this specify ! * this property when using user supplied connections)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.default_schema</tt></td> ! * <td>use given schema name for unqualified tables (always optional)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.session_factory_name</tt></td> ! * <td>If set, the factory attempts to bind this name to itself in the ! * JNDI context. This name is also used to support cross JVM <tt> ! * Session</tt> (de)serialization.</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.transaction.factory_class</tt></td> ! * <td>the factory to use for instantiating <tt>Transaction</tt>s. ! * (Defaults to <tt>JDBCTransactionFactory</tt>.)</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.query.imports</tt></td><td>query language package imports</td> ! * </tr> ! * <tr> ! * <td><tt>hibernate.query.substitutions</tt></td><td>query language token substitutions</td> ! * </tr> ! * </table> ! * * @see Session * @see net.sf.hibernate.cfg.Configuration * @see net.sf.hibernate.connection.ConnectionProvider --- 12,26 ---- /** ! * Creates <tt>Session</tt>s. Usually an application has a single <tt>SessionFactory</tt>. ! * Threads servicing client requests obtain <tt>Session</tt>s from the factory.<br> * <br> * Implementors must be threadsafe.<br> * <br> ! * <tt>SessionFactory</tt>s are immutable. The behaviour of a <tt>SessionFactory</tt> is ! * controlled by properties supplied at configuration time. These properties are defined ! * on <tt>Environment</tt>. ! * * @see Session + * @see net.sf.hibernate.cfg.Environment * @see net.sf.hibernate.cfg.Configuration * @see net.sf.hibernate.connection.ConnectionProvider |
From: <one...@us...> - 2003-04-10 09:49:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/type Modified Files: ComponentType.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: ComponentType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/ComponentType.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ComponentType.java 6 Apr 2003 10:11:12 -0000 1.12 --- ComponentType.java 10 Apr 2003 09:49:18 -0000 1.13 *************** *** 17,20 **** --- 17,21 ---- import net.sf.hibernate.MappingException; import net.sf.hibernate.PropertyAccessException; + import net.sf.hibernate.cfg.Environment; import net.sf.hibernate.engine.Cascades; import net.sf.hibernate.engine.Mapping; *************** *** 39,43 **** private final String parentProperty; private final ReflectHelper.Setter parentSetter; ! private MetaClass optimizer; public int[] sqlTypes(Mapping mapping) throws MappingException { --- 40,44 ---- private final String parentProperty; private final ReflectHelper.Setter parentSetter; ! private final MetaClass optimizer; public int[] sqlTypes(Mapping mapping) throws MappingException { *************** *** 93,97 **** this.joinedFetch = joinedFetch; constructor = ReflectHelper.getDefaultConstructor(componentClass); ! optimizer = ReflectHelper.getMetaClass(componentClass, getterNames, setterNames, propTypes); } --- 94,100 ---- this.joinedFetch = joinedFetch; constructor = ReflectHelper.getDefaultConstructor(componentClass); ! optimizer = Environment.useReflectionOptimizer() ? ! ReflectHelper.getMetaClass(componentClass, getterNames, setterNames, propTypes) : ! null; } |
From: <one...@us...> - 2003-04-10 09:49:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/persister Modified Files: AbstractEntityPersister.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AbstractEntityPersister.java 8 Apr 2003 14:26:41 -0000 1.19 --- AbstractEntityPersister.java 10 Apr 2003 09:49:17 -0000 1.20 *************** *** 577,581 **** } ! optimizer = factory.useReflectionOptimizer() ? ReflectHelper.getMetaClass(mappedClass, getterNames, setterNames, types) : null; --- 577,581 ---- } ! optimizer = Environment.useReflectionOptimizer() ? ReflectHelper.getMetaClass(mappedClass, getterNames, setterNames, types) : null; |
From: <one...@us...> - 2003-04-10 09:49:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/impl Modified Files: SessionFactoryImpl.java Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryImpl.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** SessionFactoryImpl.java 8 Apr 2003 14:26:40 -0000 1.17 --- SessionFactoryImpl.java 10 Apr 2003 09:49:16 -0000 1.18 *************** *** 97,101 **** private transient final boolean showSql; private transient final boolean useOuterJoin; - private transient final boolean useReflectionOptimizer; private transient final boolean supportsLocking; private transient final Templates templates; --- 97,100 ---- *************** *** 133,137 **** //temp.putAll( Environment.getProperties() ); temp.putAll( dl.getDefaultProperties() ); - temp.put(Environment.USE_REFLECTION_OPTIMIZER, Boolean.TRUE); temp.putAll(properties); properties = temp; // add the dialects default properties --- 132,135 ---- *************** *** 155,160 **** log.info("Use outer join fetching: " + useOuterJoin); - useReflectionOptimizer = PropertiesHelper.getBoolean(Environment.USE_REFLECTION_OPTIMIZER, properties); - boolean usrs = PropertiesHelper.getBoolean(Environment.USE_SCROLLABLE_RESULTSET, properties); int batchSize = PropertiesHelper.getInt(Environment.STATEMENT_BATCH_SIZE, properties, 0); --- 153,156 ---- *************** *** 294,298 **** // Emulates constant time LRU/MRU algorithms for cache // It is better to hold strong refernces on some (LRU/MRU) queries ! private transient final int MAX_STRONG_REF_COUNT = 128; //TODO: configurable? private transient final Object strongRefs[] = new Object[MAX_STRONG_REF_COUNT]; //strong reference to MRU queries private transient int strongRefIndex = 0; --- 290,294 ---- // Emulates constant time LRU/MRU algorithms for cache // It is better to hold strong refernces on some (LRU/MRU) queries ! private static transient final int MAX_STRONG_REF_COUNT = 128; //TODO: configurable? private transient final Object strongRefs[] = new Object[MAX_STRONG_REF_COUNT]; //strong reference to MRU queries private transient int strongRefIndex = 0; *************** *** 300,313 **** // both keys and values may be soft since value keeps a hard ref to the key (and there is a hard ref to MRU values) - private static QueryCacheKeyFactory keyFactory = (QueryCacheKeyFactory) KeyFactory.create( - QueryCacheKeyFactory.class, QueryCacheKeyFactory.class.getClassLoader() - ); - //returns generated class instance ! interface QueryCacheKeyFactory { //Will not recalculate hashKey for constant queries Object newInstance(String query, boolean scalar); } //TODO: this stuff can be implemented in separate class to reuse soft MRU/LRU caching private synchronized Object get(Object key) { --- 296,321 ---- // both keys and values may be soft since value keeps a hard ref to the key (and there is a hard ref to MRU values) //returns generated class instance ! private static final QueryCacheKeyFactory QUERY_KEY_FACTORY; ! private static final FilterCacheKeyFactory FILTER_KEY_FACTORY; ! static { ! QUERY_KEY_FACTORY = (QueryCacheKeyFactory) KeyFactory.create( ! QueryCacheKeyFactory.class, QueryCacheKeyFactory.class.getClassLoader() ! ); ! FILTER_KEY_FACTORY = (FilterCacheKeyFactory) KeyFactory.create( ! FilterCacheKeyFactory.class, FilterCacheKeyFactory.class.getClassLoader() ! ); ! } ! ! static interface QueryCacheKeyFactory { //Will not recalculate hashKey for constant queries Object newInstance(String query, boolean scalar); } + static interface FilterCacheKeyFactory { + //Will not recalculate hashKey for constant queries + Object newInstance(String role, String query, boolean scalar); + } + //TODO: this stuff can be implemented in separate class to reuse soft MRU/LRU caching private synchronized Object get(Object key) { *************** *** 335,339 **** private QueryTranslator getQuery(String query, boolean shallow) throws QueryException, MappingException { ! Object cacheKey = keyFactory.newInstance(query, shallow); // have to be careful to ensure that if the JVM does out-of-order execution --- 343,347 ---- private QueryTranslator getQuery(String query, boolean shallow) throws QueryException, MappingException { ! Object cacheKey = QUERY_KEY_FACTORY.newInstance(query, shallow); // have to be careful to ensure that if the JVM does out-of-order execution *************** *** 355,359 **** public FilterTranslator getFilter(String query, String collectionRole, boolean scalar) throws QueryException, MappingException { ! Object cacheKey = keyFactory.newInstance(query, scalar); FilterTranslator q = (FilterTranslator) get(cacheKey); --- 363,367 ---- public FilterTranslator getFilter(String query, String collectionRole, boolean scalar) throws QueryException, MappingException { ! Object cacheKey = FILTER_KEY_FACTORY.newInstance(collectionRole, query, scalar); FilterTranslator q = (FilterTranslator) get(cacheKey); *************** *** 697,704 **** if (statementCache!=null) statementCache.close(); connections.close(); - } - - public boolean useReflectionOptimizer() { - return useReflectionOptimizer; } --- 705,708 ---- |
From: <one...@us...> - 2003-04-10 09:49:22
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv4460/hibernate/test Modified Files: FooBar.hbm.xml Log Message: improvements to: * USE_REFLECTION_OPTIMIZER * Nonstrict cache * javadoc fixed bug in collection filter cache Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBar.hbm.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FooBar.hbm.xml 8 Apr 2003 09:49:32 -0000 1.13 --- FooBar.hbm.xml 10 Apr 2003 09:49:17 -0000 1.14 *************** *** 10,14 **** table="foos" proxy="net.sf.hibernate.test.FooProxy" ! discriminator-value="F"> <jcs-cache usage="read-write"/> --- 10,15 ---- table="foos" proxy="net.sf.hibernate.test.FooProxy" ! discriminator-value="F" ! dynamic-update="true"> <jcs-cache usage="read-write"/> |
From: <one...@us...> - 2003-04-08 14:27:11
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv31984/cfg Modified Files: Environment.java Log Message: added option to disable reflection optimizer Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Environment.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Environment.java 29 Mar 2003 04:08:46 -0000 1.7 --- Environment.java 8 Apr 2003 14:26:37 -0000 1.8 *************** *** 115,119 **** * Enable deep fetching using outerjoins */ ! public static final String OUTER_JOIN ="hibernate.use_outer_join"; /** * Use <tt>java.io</tt> streams to read / write binary data from / to JDBC --- 115,119 ---- * Enable deep fetching using outerjoins */ ! public static final String USE_OUTER_JOIN ="hibernate.use_outer_join"; /** * Use <tt>java.io</tt> streams to read / write binary data from / to JDBC *************** *** 219,222 **** --- 219,227 ---- */ public static final String USER_TRANSACTION = "jta.UserTransaction"; + + /** + * Use CGLIB <tt>MetaClass</tt> to optimize property access + */ + public static final String USE_REFLECTION_OPTIMIZER = "hibernate.cglib.use_reflection_optimizer"; /** |
From: <one...@us...> - 2003-04-08 14:26:46
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv31984/persister Modified Files: AbstractEntityPersister.java Log Message: added option to disable reflection optimizer Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AbstractEntityPersister.java 6 Apr 2003 02:28:57 -0000 1.18 --- AbstractEntityPersister.java 8 Apr 2003 14:26:41 -0000 1.19 *************** *** 577,581 **** } ! optimizer=ReflectHelper.getMetaClass(mappedClass, getterNames, setterNames, types); hasCascades = foundCascade; --- 577,583 ---- } ! optimizer = factory.useReflectionOptimizer() ? ! ReflectHelper.getMetaClass(mappedClass, getterNames, setterNames, types) : ! null; hasCascades = foundCascade; |