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
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/transaction
Modified Files:
JDBCTransaction.java JDBCTransactionFactory.java
JTATransaction.java JTATransactionFactory.java
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: JDBCTransaction.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JDBCTransaction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** JDBCTransaction.java 5 Jan 2003 02:11:24 -0000 1.3
--- JDBCTransaction.java 9 Jan 2003 12:24:52 -0000 1.4
***************
*** 23,26 ****
--- 23,27 ----
private boolean rolledBack;
private boolean committed;
+ private boolean begun;
private static final Log log = LogFactory.getLog(JDBCTransaction.class);
***************
*** 28,35 ****
public JDBCTransaction(SessionImplementor session) throws HibernateException {
this.session = session;
- begin();
}
! private void begin() throws HibernateException {
log.debug("begin");
--- 29,35 ----
public JDBCTransaction(SessionImplementor session) throws HibernateException {
this.session = session;
}
! public void begin() throws HibernateException {
log.debug("begin");
***************
*** 43,50 ****
--- 43,54 ----
throw new TransactionException("Begin failed with SQL exception: ", e);
}
+
+ begun = true;
}
public void commit() throws HibernateException, SQLException {
+ if (!begun) throw new TransactionException("Transaction not successfully started");
+
log.debug("commit");
***************
*** 68,71 ****
--- 72,77 ----
public void rollback() throws HibernateException {
+ if (!begun) throw new TransactionException("Transaction not successfully started");
+
log.debug("rollback");
***************
*** 101,104 ****
--- 107,111 ----
return committed;
}
+
}
Index: JDBCTransactionFactory.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JDBCTransactionFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** JDBCTransactionFactory.java 5 Jan 2003 02:11:24 -0000 1.3
--- JDBCTransactionFactory.java 9 Jan 2003 12:24:52 -0000 1.4
***************
*** 18,22 ****
public Transaction beginTransaction(SessionImplementor session) throws HibernateException {
! return new JDBCTransaction(session);
}
public void configure(Properties props) throws HibernateException {}
--- 18,24 ----
public Transaction beginTransaction(SessionImplementor session) throws HibernateException {
! JDBCTransaction tx = new JDBCTransaction(session);
! tx.begin();
! return tx;
}
public void configure(Properties props) throws HibernateException {}
Index: JTATransaction.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JTATransaction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** JTATransaction.java 5 Jan 2003 02:11:24 -0000 1.3
--- JTATransaction.java 9 Jan 2003 12:24:52 -0000 1.4
***************
*** 37,43 ****
private final SessionImplementor session;
! private final UserTransaction ut;
! private final boolean newTransaction;
! private final boolean synchronization;
static final Log log = LogFactory.getLog(JTATransaction.class);
--- 37,44 ----
private final SessionImplementor session;
! private UserTransaction ut;
! private boolean newTransaction;
! private boolean synchronization;
! private boolean begun;
static final Log log = LogFactory.getLog(JTATransaction.class);
***************
*** 45,48 ****
--- 46,51 ----
public void commit() throws HibernateException, SQLException {
+ if (!begun) throw new TransactionException("Transaction not successfully started");
+
log.debug("commit");
***************
*** 64,67 ****
--- 67,72 ----
public void rollback() throws HibernateException {
+ if (!begun) throw new TransactionException("Transaction not successfully started");
+
log.debug("rollback");
***************
*** 83,89 ****
}
! public JTATransaction(SessionImplementor session, InitialContext context, String utName, TransactionManager transactionManager) throws HibernateException {
this.session = session;
!
log.debug("Looking for UserTransaction under: " + utName);
try {
--- 88,96 ----
}
! public JTATransaction(SessionImplementor session) {
this.session = session;
! }
!
! public void begin(InitialContext context, String utName, TransactionManager transactionManager) throws HibernateException {
log.debug("Looking for UserTransaction under: " + utName);
try {
***************
*** 125,131 ****
--- 132,143 ----
synchronization = true;
}
+
+ begun = true;
}
public boolean wasRolledBack() throws TransactionException {
+
+ if (!begun) return false;
+
final int status;
try {
***************
*** 137,141 ****
}
if (status==Status.STATUS_UNKNOWN) {
! throw new TransactionException("Could not determine transaction status", null);
}
else {
--- 149,153 ----
}
if (status==Status.STATUS_UNKNOWN) {
! throw new TransactionException("Could not determine transaction status");
}
else {
***************
*** 147,150 ****
--- 159,165 ----
public boolean wasCommitted() throws TransactionException {
+
+ if (!begun) return false;
+
final int status;
try {
***************
*** 156,160 ****
}
if (status==Status.STATUS_UNKNOWN) {
! throw new TransactionException("Could not determine transaction status", null);
}
else {
--- 171,175 ----
}
if (status==Status.STATUS_UNKNOWN) {
! throw new TransactionException("Could not determine transaction status");
}
else {
Index: JTATransactionFactory.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JTATransactionFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** JTATransactionFactory.java 5 Jan 2003 02:11:24 -0000 1.3
--- JTATransactionFactory.java 9 Jan 2003 12:24:52 -0000 1.4
***************
*** 76,80 ****
public Transaction beginTransaction(SessionImplementor session) throws HibernateException {
! return new JTATransaction(session, context, utName, transactionManager);
}
--- 76,82 ----
public Transaction beginTransaction(SessionImplementor session) throws HibernateException {
! JTATransaction tx = new JTATransaction(session);
! tx.begin(context, utName, transactionManager);
! return tx;
}
|
|
From: <one...@us...> - 2003-01-09 12:24:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/test
Modified Files:
ABC.hbm.xml ABCProxy.hbm.xml Baz.hbm.xml Custom.hbm.xml
CustomPersister.java Fee.hbm.xml FooBar.hbm.xml
FooBarTest.java Many.hbm.xml One.hbm.xml ParentChild.hbm.xml
Qux.hbm.xml
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: ABC.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABC.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ABC.hbm.xml 1 Jan 2003 13:56:43 -0000 1.1.1.1
--- ABC.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 5,9 ****
<class name="net.sf.hibernate.test.A" discriminator-value="0">
<id name = "id" unsaved-value = "null">
! <generator class="vm.long"/>
</id>
<discriminator column="clazz" type="integer"/>
--- 5,9 ----
<class name="net.sf.hibernate.test.A" discriminator-value="0">
<id name = "id" unsaved-value = "null">
! <generator class="vm"/>
</id>
<discriminator column="clazz" type="integer"/>
Index: ABCProxy.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCProxy.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ABCProxy.hbm.xml 1 Jan 2003 13:56:43 -0000 1.1.1.1
--- ABCProxy.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 5,9 ****
<class name="net.sf.hibernate.test.A" discriminator-value="0" proxy="net.sf.hibernate.test.A">
<id name = "id" unsaved-value = "null">
! <generator class="vm.long"/>
</id>
<discriminator column="clazz" type="integer"/>
--- 5,9 ----
<class name="net.sf.hibernate.test.A" discriminator-value="0" proxy="net.sf.hibernate.test.A">
<id name = "id" unsaved-value = "null">
! <generator class="vm"/>
</id>
<discriminator column="clazz" type="integer"/>
Index: Baz.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.hbm.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Baz.hbm.xml 3 Jan 2003 13:36:01 -0000 1.3
--- Baz.hbm.xml 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 5,10 ****
<class name="net.sf.hibernate.test.Baz">
<id name="code" type="string">
! <column name="idcode" length="16"/>
! <generator class="hilo.hex"/>
</id>
<property name="count" column="count_count"/>
--- 5,10 ----
<class name="net.sf.hibernate.test.Baz">
<id name="code" type="string">
! <column name="idcode" length="32"/>
! <generator class="uuid.hex"/>
</id>
<property name="count" column="count_count"/>
Index: Custom.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Custom.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Custom.hbm.xml 1 Jan 2003 13:56:49 -0000 1.1.1.1
--- Custom.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 5,9 ****
<class name="net.sf.hibernate.test.Custom" persister="net.sf.hibernate.test.CustomPersister">
<id type="string" name="key" column="id_" length="64" unsaved-value="null">
! <generator class="vm.hex"/>
</id>
</class>
--- 5,9 ----
<class name="net.sf.hibernate.test.Custom" persister="net.sf.hibernate.test.CustomPersister">
<id type="string" name="key" column="id_" length="64" unsaved-value="null">
! <generator class="uuid.hex"/>
</id>
</class>
Index: CustomPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/CustomPersister.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CustomPersister.java 5 Jan 2003 02:11:23 -0000 1.3
--- CustomPersister.java 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 19,23 ****
import net.sf.hibernate.engine.SessionImplementor;
import net.sf.hibernate.id.IdentifierGenerator;
! import net.sf.hibernate.id.LongGenerator;
import net.sf.hibernate.mapping.PersistentClass;
import net.sf.hibernate.metadata.ClassMetadata;
--- 19,23 ----
import net.sf.hibernate.engine.SessionImplementor;
import net.sf.hibernate.id.IdentifierGenerator;
! import net.sf.hibernate.id.CounterGenerator;
import net.sf.hibernate.mapping.PersistentClass;
import net.sf.hibernate.metadata.ClassMetadata;
***************
*** 29,33 ****
private static final Hashtable instances = new Hashtable();
! private static final IdentifierGenerator idgen = new LongGenerator();
public CustomPersister(PersistentClass model, SessionFactoryImplementor factory) {}
--- 29,33 ----
private static final Hashtable instances = new Hashtable();
! private static final IdentifierGenerator idgen = new CounterGenerator();
public CustomPersister(PersistentClass model, SessionFactoryImplementor factory) {}
Index: Fee.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Fee.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Fee.hbm.xml 1 Jan 2003 13:56:52 -0000 1.1.1.1
--- Fee.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 5,9 ****
<class name="net.sf.hibernate.test.Fee">
<id type="string" name="key" column="id_" length="64" unsaved-value="null">
! <generator class="vm.hex"/>
</id>
<property name="fi"/>
--- 5,9 ----
<class name="net.sf.hibernate.test.Fee">
<id type="string" name="key" column="id_" length="64" unsaved-value="null">
! <generator class="uuid.hex"/>
</id>
<property name="fi"/>
Index: FooBar.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBar.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** FooBar.hbm.xml 1 Jan 2003 13:56:54 -0000 1.1.1.1
--- FooBar.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 1,4 ****
<?xml version="1.0"?>
! <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping.dtd">
<hibernate-mapping>
--- 1,4 ----
<?xml version="1.0"?>
! <!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
***************
*** 15,19 ****
<column name="foo_id" length="36"/>
<generator class="uuid.hex">
! <param>:</param>
</generator>
</id>
--- 15,19 ----
<column name="foo_id" length="36"/>
<generator class="uuid.hex">
! <param name="seperator">:</param>
</generator>
</id>
***************
*** 35,39 ****
<property name="double" column="double_"/>
! <primitive-array role="bytes" table="foobytes">
<key column="id"/>
<index column="i"/>
--- 35,39 ----
<property name="double" column="double_"/>
! <primitive-array name="bytes" table="foobytes">
<key column="id"/>
<index column="i"/>
***************
*** 76,80 ****
<property name="count" column="subcount"/>
<property name="name" column="subname"/>
! <array role="ImportantDates" table="foo_times">
<key column="foo_id"/>
<index column="i"/>
--- 76,80 ----
<property name="count" column="subcount"/>
<property name="name" column="subname"/>
! <array name="ImportantDates" table="foo_times">
<key column="foo_id"/>
<index column="i"/>
***************
*** 83,87 ****
<many-to-one name="fee" column="fee_sub" cascade="all" class="net.sf.hibernate.test.Fee" outer-join="false"/>
</component>
! <array role="importantDates" table="foo_dates">
<key column="foo_id"/>
<index column="i"/>
--- 83,87 ----
<many-to-one name="fee" column="fee_sub" cascade="all" class="net.sf.hibernate.test.Fee" outer-join="false"/>
</component>
! <array name="importantDates" table="foo_dates">
<key column="foo_id"/>
<index column="i"/>
***************
*** 100,104 ****
proxy="net.sf.hibernate.test.AbstractProxy"
discriminator-value="A">
! <set role="abstracts">
<key column="abstract_id"/>
<one-to-many class="net.sf.hibernate.test.Abstract"/>
--- 100,104 ----
proxy="net.sf.hibernate.test.AbstractProxy"
discriminator-value="A">
! <set name="abstracts">
<key column="abstract_id"/>
<one-to-many class="net.sf.hibernate.test.Abstract"/>
***************
*** 119,123 ****
<property name="name" length="64"/>
! <array role="importantDates">
<key column="id" />
<index column="i"/>
--- 119,123 ----
<property name="name" length="64"/>
! <array name ="importantDates">
<key column="id" />
<index column="i"/>
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FooBarTest.java 5 Jan 2003 02:11:23 -0000 1.5
--- FooBarTest.java 9 Jan 2003 12:24:51 -0000 1.6
***************
*** 233,236 ****
--- 233,239 ----
public void testPersistCollections() throws Exception {
+
+ if ( dialect instanceof SybaseDialect ) return;
+
Session s = sessions.openSession();
Index: Many.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Many.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Many.hbm.xml 1 Jan 2003 13:57:08 -0000 1.1.1.1
--- Many.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 6,10 ****
<class name="net.sf.hibernate.test.Many" table="many">
<id name="key" column="many_key">
! <generator class="hilo.long" />
</id>
<many-to-one name="one" column="one_key" class="net.sf.hibernate.test.One"/>
--- 6,10 ----
<class name="net.sf.hibernate.test.Many" table="many">
<id name="key" column="many_key">
! <generator class="hilo" />
</id>
<many-to-one name="one" column="one_key" class="net.sf.hibernate.test.One"/>
Index: One.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/One.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** One.hbm.xml 1 Jan 2003 13:57:13 -0000 1.1.1.1
--- One.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 6,10 ****
<class name="net.sf.hibernate.test.One" table="one">
<id name="key" column="one_key">
! <generator class="hilo.long" />
</id>
<property column="one_value" name="value"/>
--- 6,10 ----
<class name="net.sf.hibernate.test.One" table="one">
<id name="key" column="one_key">
! <generator class="hilo" />
</id>
<property column="one_value" name="value"/>
Index: ParentChild.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ParentChild.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ParentChild.hbm.xml 1 Jan 2003 13:57:13 -0000 1.1.1.1
--- ParentChild.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 5,9 ****
<class name="net.sf.hibernate.test.Parent">
<id name="id" type="long">
! <generator class="native"> <!--seqhilo.long-->
<!--<param>foo_seq</param>-->
</generator>
--- 5,9 ----
<class name="net.sf.hibernate.test.Parent">
<id name="id" type="long">
! <generator class="native"> <!--seqhilo-->
<!--<param>foo_seq</param>-->
</generator>
Index: Qux.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Qux.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Qux.hbm.xml 1 Jan 2003 13:57:17 -0000 1.1.1.1
--- Qux.hbm.xml 9 Jan 2003 12:24:51 -0000 1.2
***************
*** 5,9 ****
<class name="net.sf.hibernate.test.Qux" table="quux" proxy="net.sf.hibernate.test.Qux"> <!---->
<id name="key" column="qux_key" unsaved-value="0">
! <generator class="hilo.long"/>
</id>
<many-to-one name="foo" class="net.sf.hibernate.test.Foo">
--- 5,9 ----
<class name="net.sf.hibernate.test.Qux" table="quux" proxy="net.sf.hibernate.test.Qux"> <!---->
<id name="key" column="qux_key" unsaved-value="0">
! <generator class="hilo"/>
</id>
<many-to-one name="foo" class="net.sf.hibernate.test.Foo">
|
|
From: <one...@us...> - 2003-01-09 12:24:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/test
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/tool/hbm2java/test
Modified Files:
Test2.hbm.xml
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: Test2.hbm.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/test/Test2.hbm.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Test2.hbm.xml 1 Jan 2003 13:57:52 -0000 1.1.1.1
--- Test2.hbm.xml 9 Jan 2003 12:24:52 -0000 1.2
***************
*** 7,11 ****
<class name="codegen.test.ObjIdNoMin">
<id name="id" type="long" unsaved-value="null">
! <generator class="vm.long"/>
</id>
<property name="one" type="string" not-null="true"/>
--- 7,11 ----
<class name="codegen.test.ObjIdNoMin">
<id name="id" type="long" unsaved-value="null">
! <generator class="vm"/>
</id>
<property name="one" type="string" not-null="true"/>
|
|
From: <one...@us...> - 2003-01-09 12:24:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2ddl
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/tool/hbm2ddl
Modified Files:
JdbcDatabaseInfo.java
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: JdbcDatabaseInfo.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2ddl/JdbcDatabaseInfo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** JdbcDatabaseInfo.java 5 Jan 2003 02:11:23 -0000 1.3
--- JdbcDatabaseInfo.java 9 Jan 2003 12:24:52 -0000 1.4
***************
*** 121,124 ****
--- 121,129 ----
return key instanceof String && _sequences.contains(((String)key).toUpperCase());
}
+
+ public boolean isTable(Object key)
+ {
+ return key instanceof String && _tables.containsKey(((String)key).toUpperCase());
+ }
}
|
|
From: <one...@us...> - 2003-01-09 12:24:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/persister
Modified Files:
AbstractEntityPersister.java EntityPersister.java
MultiTableEntityPersister.java
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: AbstractEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** AbstractEntityPersister.java 5 Jan 2003 02:11:22 -0000 1.3
--- AbstractEntityPersister.java 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 27,31 ****
import net.sf.hibernate.util.StringHelper;
import net.sf.hibernate.id.IdentifierGenerator;
! import net.sf.hibernate.id.NativeGenerator;
import net.sf.hibernate.mapping.Column;
import net.sf.hibernate.mapping.PersistentClass;
--- 27,31 ----
import net.sf.hibernate.util.StringHelper;
import net.sf.hibernate.id.IdentifierGenerator;
! import net.sf.hibernate.id.IdentityGenerator;
import net.sf.hibernate.mapping.Column;
import net.sf.hibernate.mapping.PersistentClass;
***************
*** 131,135 ****
.append( cols[i] )
.append(" as ")
! .append( aliasColumn(cols[i], suffix) );
if (i!=cols.length-1) buf.append(", ");
}
--- 131,135 ----
.append( cols[i] )
.append(" as ")
! .append( StringHelper.suffix(cols[i], suffix) );
if (i!=cols.length-1) buf.append(", ");
}
***************
*** 480,484 ****
hasEmbeddedIdentifier = model.hasEmbeddedIdentifier();
identifierPropertyName = model.hasIdentifierProperty() ? model.getIdentifierProperty().getName() : null;
- idgen = model.getIdentifier().getIdentifierGenerator();
Value idValue = model.getIdentifier();
identifierType = idValue.getType();
--- 480,483 ----
***************
*** 550,556 ****
}
! IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator();
! useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator );
identitySelectString = (useIdentityColumn) ? dialect.getIdentitySelectString() : null;
--- 549,556 ----
}
+ // GENERATOR
! idgen = model.getIdentifier().createIdentifierGenerator(dialect);
! useIdentityColumn = idgen instanceof IdentityGenerator;
identitySelectString = (useIdentityColumn) ? dialect.getIdentitySelectString() : null;
***************
*** 687,709 ****
return concreteProxyClass;
}
-
- //TODO: refactor! this is a duplicate of a method in the Loader heirarchy
- protected static String aliasColumn(String name, String suffix) {
-
- char quote = name.charAt(0);
- boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
-
- if (nameEscaped) name = name.substring(1, name.length()-1);
-
- StringBuffer aliasBuilder = new StringBuffer(name.length());
-
- if (nameEscaped) aliasBuilder.append(quote);
- aliasBuilder.append(name);
- aliasBuilder.append(suffix);
- if (nameEscaped) aliasBuilder.append(quote);
- return aliasBuilder.toString();
- }
-
public Class getMappedSuperclass() {
return superclass;
--- 687,691 ----
Index: EntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/EntityPersister.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** EntityPersister.java 5 Jan 2003 02:11:22 -0000 1.3
--- EntityPersister.java 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 36,39 ****
--- 36,40 ----
import net.sf.hibernate.StaleObjectStateException;
import net.sf.hibernate.hql.PathExpressionParser;
+ import net.sf.hibernate.id.IdentifierGeneratorFactory;
import net.sf.hibernate.type.AbstractComponentType;
import net.sf.hibernate.type.DiscriminatorType;
***************
*** 522,526 ****
try {
if ( !rs.next() ) throw new HibernateException("The database returned no natively generated identity value");
! id = dialect.getIdentityFrom(rs);
}
finally {
--- 523,527 ----
try {
if ( !rs.next() ) throw new HibernateException("The database returned no natively generated identity value");
! id = IdentifierGeneratorFactory.get( rs, getIdentifierType().returnedClass() );
}
finally {
***************
*** 900,904 ****
.append(discr)
.append(" as ")
! .append( aliasColumn(discr, suffix) );
}
--- 901,905 ----
.append(discr)
.append(" as ")
! .append( StringHelper.suffix(discr, suffix) );
}
***************
*** 911,915 ****
.append( cols[i] )
.append(" as ")
! .append( aliasColumn(cols[i], suffix) );
}
return buf.toString();
--- 912,916 ----
.append( cols[i] )
.append(" as ")
! .append( StringHelper.suffix(cols[i], suffix) );
}
return buf.toString();
Index: MultiTableEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/MultiTableEntityPersister.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MultiTableEntityPersister.java 5 Jan 2003 02:11:22 -0000 1.3
--- MultiTableEntityPersister.java 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 38,41 ****
--- 38,42 ----
import net.sf.hibernate.StaleObjectStateException;
import net.sf.hibernate.hql.PathExpressionParser;
+ import net.sf.hibernate.id.IdentifierGeneratorFactory;
import net.sf.hibernate.type.AbstractComponentType;
import net.sf.hibernate.type.DiscriminatorType;
***************
*** 555,559 ****
try {
if ( !rs.next() ) throw new HibernateException("The database returned no natively generated identity value");
! id = dialect.getIdentityFrom(rs);
}
finally {
--- 556,560 ----
try {
if ( !rs.next() ) throw new HibernateException("The database returned no natively generated identity value");
! id = IdentifierGeneratorFactory.get( rs, getIdentifierType().returnedClass() );
}
finally {
***************
*** 1094,1098 ****
}
buf.append(" end as ")
! .append( aliasColumn( getDiscriminatorColumnName(), suffix) );
}
--- 1095,1099 ----
}
buf.append(" end as ")
! .append( StringHelper.suffix( getDiscriminatorColumnName(), suffix) );
}
***************
*** 1107,1111 ****
.append( cols[i] )
.append(" as ")
! .append( aliasColumn( subclassColumnClosureAliases[i], suffix) );
}
return buf.toString();
--- 1108,1112 ----
.append( cols[i] )
.append(" as ")
! .append( StringHelper.suffix( subclassColumnClosureAliases[i], suffix) );
}
return buf.toString();
|
|
From: <one...@us...> - 2003-01-09 12:24:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/mapping
Modified Files:
Association.java Collection.java Component.java
IntegerValue.java Map.java PersistentClass.java Root.java
RootClass.java Subclass.java Table.java Value.java
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: Association.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Association.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Association.java 5 Jan 2003 02:11:22 -0000 1.4
--- Association.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 32,36 ****
// A many-to-one association
protected Association(Node node, String path, String defaultColumnName, boolean isNullable, Table table, Root root) throws MappingException {
! super(node, defaultColumnName, isNullable, table, root);
joinedFetch = initJoinedFetch(node);
}
--- 32,36 ----
// A many-to-one association
protected Association(Node node, String path, String defaultColumnName, boolean isNullable, Table table, Root root) throws MappingException {
! super(node, isNullable, table, root, defaultColumnName);
joinedFetch = initJoinedFetch(node);
}
Index: Collection.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Collection.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Collection.java 5 Jan 2003 02:11:22 -0000 1.6
--- Collection.java 9 Jan 2003 12:24:51 -0000 1.7
***************
*** 138,142 ****
if ( "key".equals(name) || "generated-key".equals(name) ) {
! key = new Value(subnode, DEFAULT_KEY_COLUMN_NAME, isOneToMany, table, root);
key.setType( owner.getIdentifier().getType() );
if ( key.getType().returnedClass().isArray() ) throw new MappingException(
--- 138,142 ----
if ( "key".equals(name) || "generated-key".equals(name) ) {
! key = new Value(subnode, isOneToMany, table, root, DEFAULT_KEY_COLUMN_NAME);
key.setType( owner.getIdentifier().getType() );
if ( key.getType().returnedClass().isArray() ) throw new MappingException(
***************
*** 145,149 ****
}
else if ( "element".equals(name) ) {
! element = new Value(subnode, DEFAULT_ELEMENT_COLUMN_NAME, true, table, root);
}
else if ( "many-to-many".equals(name) ) {
--- 145,149 ----
}
else if ( "element".equals(name) ) {
! element = new Value(subnode, true, table, root, DEFAULT_ELEMENT_COLUMN_NAME);
}
else if ( "many-to-many".equals(name) ) {
Index: Component.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Component.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Component.java 5 Jan 2003 02:11:22 -0000 1.4
--- Component.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 104,111 ****
}
else if ( "property".equals(name) || "key-property".equals(name) ) {
! value = new Value(subnode, propertyName, isNullable, table, root);
}
else if ( "collection".equals(name) ) {
! value = new Value(subnode, propertyName, isNullable, table, root);
}
else if ( "component".equals(name) || "nested-composite-element".equals(name) ) {
--- 104,111 ----
}
else if ( "property".equals(name) || "key-property".equals(name) ) {
! value = new Value(subnode, isNullable, table, root, propertyName);
}
else if ( "collection".equals(name) ) {
! value = new Value(subnode, isNullable, table, root, propertyName);
}
else if ( "component".equals(name) || "nested-composite-element".equals(name) ) {
Index: IntegerValue.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/IntegerValue.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** IntegerValue.java 5 Jan 2003 02:11:22 -0000 1.4
--- IntegerValue.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 14,18 ****
public IntegerValue(Node node, String defaultColumnName, boolean isNullable, Table table, Root root) throws MappingException {
! super(node, defaultColumnName, isNullable, table, root);
Column col = ( (Column) getColumnIterator().next() );
col.setType( getType() );
--- 14,18 ----
public IntegerValue(Node node, String defaultColumnName, boolean isNullable, Table table, Root root) throws MappingException {
! super(node, isNullable, table, root, defaultColumnName);
Column col = ( (Column) getColumnIterator().next() );
col.setType( getType() );
Index: Map.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Map.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Map.java 5 Jan 2003 02:11:22 -0000 1.5
--- Map.java 9 Jan 2003 12:24:51 -0000 1.6
***************
*** 50,54 ****
if ( "index".equals(name) ) {
! setIndex( new Value(subnode, DEFAULT_INDEX_COLUMN_NAME, isOneToMany(), getTable(), root) );
if ( getIndex().getType()==null ) throw new MappingException("map index element must specify a type");
}
--- 50,54 ----
if ( "index".equals(name) ) {
! setIndex( new Value(subnode, isOneToMany(), getTable(), root, DEFAULT_INDEX_COLUMN_NAME) );
if ( getIndex().getType()==null ) throw new MappingException("map index element must specify a type");
}
Index: PersistentClass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PersistentClass.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PersistentClass.java 5 Jan 2003 02:11:22 -0000 1.4
--- PersistentClass.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 81,85 ****
}
else if ( "property".equals(name) ) {
! value = new Value(subnode, propertyName, true, table, root);
}
else if ( "component".equals(name) ) {
--- 81,85 ----
}
else if ( "property".equals(name) ) {
! value = new Value(subnode, true, table, root, propertyName);
}
else if ( "component".equals(name) ) {
Index: Root.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Root.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Root.java 5 Jan 2003 02:11:22 -0000 1.4
--- Root.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 2,7 ****
package net.sf.hibernate.mapping;
- import java.util.ArrayList;
- import java.util.Arrays;
import java.util.HashMap;
--- 2,5 ----
***************
*** 12,16 ****
import org.w3c.dom.NodeList;
- import net.sf.hibernate.HibernateException;
import net.sf.hibernate.MappingException;
import net.sf.hibernate.cache.Cache;
--- 10,13 ----
***************
*** 20,25 ****
import net.sf.hibernate.cache.ReadOnlyCache;
import net.sf.hibernate.cache.ReadWriteCache;
- import net.sf.hibernate.util.ReflectHelper;
- import net.sf.hibernate.id.*;
import net.sf.hibernate.type.Type;
--- 17,20 ----
***************
*** 35,39 ****
private final java.util.Map tables;
private final java.util.Map queries;
- private final java.util.Map generators;
private final String schemaName;
private final String defaultCascade;
--- 30,33 ----
***************
*** 102,106 ****
java.util.Map collections,
java.util.Map tables,
- java.util.Map generators,
java.util.Map queries
) throws Exception {
--- 96,99 ----
***************
*** 110,114 ****
this.queries = queries;
this.tables = tables;
- this.generators = generators;
// Create maps for all the collections and classes
--- 103,106 ----
***************
*** 141,150 ****
}
- /*public Type getCollectionType(String role) throws MappingException {
- Collection coll = (Collection) collections.get(role);
- if (coll==null) throw new MappingException("undeclared collection role: " + role );
- return coll.getType();
- }*/
-
public void addPersistentClass(PersistentClass persistentClass) throws MappingException {
Object old = classes.put( persistentClass.getPersistentClass(), persistentClass );
--- 133,136 ----
***************
*** 178,238 ****
public String getDefaultCascade() {
return defaultCascade;
- }
-
-
- public IdentifierGenerator createIDGenerator(Node node) throws Exception {
-
- String className = node.getAttributes().getNamedItem("class").getNodeValue();
- Class idgenClass = (Class) idgenerators.get(className);
- if (idgenClass==null) {
- try {
- idgenClass = ReflectHelper.classForName(className);
- }
- catch (Exception e) {
- throw new HibernateException("ID generator class not found: " + className);
- }
- }
- ArrayList list = new ArrayList();
- NodeList nodes = node.getChildNodes();
- for (int i=0; i<nodes.getLength(); i++) {
- Node childNode = nodes.item(i);
- if ( childNode.getNodeName().equals("param") ) {
- list.add( childNode.getFirstChild().getNodeValue() );
- }
- }
- int size = list.size();
- Class[] argTypes = new Class[size];
- String[] args = new String[size];
- Arrays.fill(argTypes, String.class);
- list.toArray(args);
- IdentifierGenerator idgen;
- Object gen = null;
- try {
- gen = idgenClass.getConstructor(argTypes).newInstance(args);
- }
- catch(NoSuchMethodException e) {
- throw new MappingException("Exception while trying to instantiate " + idgenClass.getName() + " with " + list,e);
- }
-
- idgen = (IdentifierGenerator) gen;
-
- if ( PersistentIdentifierGenerator.class.isAssignableFrom(idgenClass) ) {
- generators.put( ( (PersistentIdentifierGenerator) idgen ).generatorKey(), idgen );
- }
- return idgen;
- }
-
- private static final HashMap idgenerators = new HashMap();
- static {
- idgenerators.put("uuid.hex", UUIDHexGenerator.class);
- idgenerators.put("uuid.string", UUIDStringGenerator.class);
- idgenerators.put("hilo.long", HiLoGenerator.class);
- idgenerators.put("hilo.hex", HiLoHexGenerator.class);
- idgenerators.put("vm.long", LongGenerator.class);
- idgenerators.put("vm.hex", HexGenerator.class);
- idgenerators.put("assigned", Assigned.class);
- idgenerators.put("native", NativeGenerator.class);
- idgenerators.put("sequence", SequenceGenerator.class);
- idgenerators.put("seqhilo.long", SequenceHiLoGenerator.class);
}
--- 164,167 ----
Index: RootClass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/RootClass.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** RootClass.java 5 Jan 2003 02:11:22 -0000 1.4
--- RootClass.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 139,149 ****
if ( "id".equals(name) ) {
if (propertyName==null) {
! identifier = new Value(subnode, DEFAULT_IDENTIFIER_COLUMN_NAME, false, table, root);
if (identifier.getType()==null) throw new MappingException( "must specify an identifier type: " + getPersistentClass().getName() );
identifierProperty = null;
}
else {
! identifier = new Value(subnode, propertyName, false, table, root);
identifier.setTypeByReflection( getPersistentClass(), propertyName );
identifierProperty = new Property(subnode, identifier, root);
}
--- 139,151 ----
if ( "id".equals(name) ) {
if (propertyName==null) {
! identifier = new Value(subnode, false, table, root, DEFAULT_IDENTIFIER_COLUMN_NAME);
if (identifier.getType()==null) throw new MappingException( "must specify an identifier type: " + getPersistentClass().getName() );
+ identifier.makeIdentifier(subnode, root);
identifierProperty = null;
}
else {
! identifier = new Value(subnode, false, table, root, propertyName);
identifier.setTypeByReflection( getPersistentClass(), propertyName );
+ identifier.makeIdentifier(subnode, root);
identifierProperty = new Property(subnode, identifier, root);
}
***************
*** 166,170 ****
else if ( "version".equals(name) || "timestamp".equals(name) ) {
//VERSION
! Value val = new Value(subnode, propertyName, false, table, root);
if ( val.getType()==null ) val.setType( "version".equals(name) ? Hibernate.INTEGER : Hibernate.TIMESTAMP );
version = new Property(subnode, val, root);
--- 168,172 ----
else if ( "version".equals(name) || "timestamp".equals(name) ) {
//VERSION
! Value val = new Value(subnode, false, table, root, propertyName);
if ( val.getType()==null ) val.setType( "version".equals(name) ? Hibernate.INTEGER : Hibernate.TIMESTAMP );
version = new Property(subnode, val, root);
***************
*** 173,177 ****
else if ( "discriminator".equals(name) ) {
//DISCRIMINATOR
! discriminator = new Value(subnode, DEFAULT_DISCRIMINATOR_COLUMN_NAME, false, table, root);
if ( discriminator.getType()==null ) {
discriminator.setType(Hibernate.STRING);
--- 175,179 ----
else if ( "discriminator".equals(name) ) {
//DISCRIMINATOR
! discriminator = new Value(subnode, false, table, root, DEFAULT_DISCRIMINATOR_COLUMN_NAME);
if ( discriminator.getType()==null ) {
discriminator.setType(Hibernate.STRING);
Index: Subclass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Subclass.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Subclass.java 5 Jan 2003 02:11:22 -0000 1.3
--- Subclass.java 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 124,128 ****
for ( int i=0; i<subnodes.getLength(); i++ ) {
if ( "key".equals( subnodes.item(i).getNodeName() ) ) {
! key = new Value( subnodes.item(i), Root.ROOT_ROLE_NAME, false, mytable, root );
}
}
--- 124,128 ----
for ( int i=0; i<subnodes.getLength(); i++ ) {
if ( "key".equals( subnodes.item(i).getNodeName() ) ) {
! key = new Value( subnodes.item(i), false, mytable, root, Root.ROOT_ROLE_NAME );
}
}
Index: Table.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Table.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Table.java 5 Jan 2003 02:11:22 -0000 1.3
--- Table.java 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 8,14 ****
import net.sf.hibernate.engine.Mapping;
! import net.sf.hibernate.id.Assigned;
! import net.sf.hibernate.id.IdentifierGenerator;
! import net.sf.hibernate.id.NativeGenerator;
import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.dialect.HSQLDialect;
--- 8,12 ----
import net.sf.hibernate.engine.Mapping;
! import net.sf.hibernate.id.IdentityGenerator;
import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.dialect.HSQLDialect;
***************
*** 23,27 ****
private String schema;
private Map columns = new SequencedHashMap();
! private IdentifierGenerator identifierGenerator = Assigned.INSTANCE;
private PrimaryKey primaryKey;
private Map indexes = new HashMap();
--- 21,25 ----
private String schema;
private Map columns = new SequencedHashMap();
! private Value idValue;
private PrimaryKey primaryKey;
private Map indexes = new HashMap();
***************
*** 109,121 ****
.append(" (");
String pkname = null;
! // Try to find out the name of the primary key to create it as identity if the NativeGenerator is used
! boolean createIdentity;
! if (primaryKey != null) {
! createIdentity = dialect.supportsIdentityColumns() && ( identifierGenerator instanceof NativeGenerator );
pkname = ( (Column) primaryKey.getColumnIterator().next() ).getName();
}
- else
- createIdentity = false;
Iterator iter = columnIterator();
--- 107,117 ----
.append(" (");
+ boolean identityColumn = idValue!=null && idValue.createIdentifierGenerator(dialect) instanceof IdentityGenerator;
+
+ // Try to find out the name of the primary key to create it as identity if the IdentityGenerator is used
String pkname = null;
! if (primaryKey != null && identityColumn ) {
pkname = ( (Column) primaryKey.getColumnIterator().next() ).getName();
}
Iterator iter = columnIterator();
***************
*** 127,131 ****
.append( col.getSqlType(dialect, p) );
! if ( createIdentity && col.getName().equals(pkname) ) {
buf.append(' ')
.append( dialect.getIdentityColumnString() );
--- 123,127 ----
.append( col.getSqlType(dialect, p) );
! if ( identityColumn && col.getName().equals(pkname) ) {
buf.append(' ')
.append( dialect.getIdentityColumnString() );
***************
*** 147,151 ****
}
if (primaryKey!=null) {
! if ( dialect instanceof HSQLDialect && identifierGenerator instanceof NativeGenerator ) {
// skip the primary key definition
// ugly, ugly hack!
--- 143,147 ----
}
if (primaryKey!=null) {
! if ( dialect instanceof HSQLDialect && identityColumn ) {
// skip the primary key definition
// ugly, ugly hack!
***************
*** 170,180 ****
}
- public IdentifierGenerator getIdentifierGenerator() {
- return identifierGenerator;
- }
- public void setIdentifierGenerator(IdentifierGenerator identifierGenerator) {
- this.identifierGenerator = identifierGenerator;
- }
-
public PrimaryKey getPrimaryKey() {
return primaryKey;
--- 166,169 ----
***************
*** 244,247 ****
--- 233,240 ----
public int getUniqueInteger() {
return uniqueInteger;
+ }
+
+ public void setIdentifierValue(Value idValue) {
+ this.idValue = idValue;
}
Index: Value.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Value.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Value.java 5 Jan 2003 02:11:22 -0000 1.4
--- Value.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 4,14 ****
import java.util.ArrayList;
import java.util.Iterator;
! import org.w3c.dom.*;
! import net.sf.hibernate.*;
! import net.sf.hibernate.util.ReflectHelper;
! import net.sf.hibernate.id.Assigned;
import net.sf.hibernate.id.IdentifierGenerator;
! import net.sf.hibernate.type.*;
import net.sf.hibernate.type.Type;
public class Value {
--- 4,21 ----
import java.util.ArrayList;
import java.util.Iterator;
! import java.util.Properties;
!
! import net.sf.hibernate.HibernateException;
! import net.sf.hibernate.MappingException;
! import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.id.IdentifierGenerator;
! import net.sf.hibernate.id.IdentifierGeneratorFactory;
import net.sf.hibernate.type.Type;
+ import net.sf.hibernate.type.TypeFactory;
+ import net.sf.hibernate.util.ReflectHelper;
+
+ import org.w3c.dom.NamedNodeMap;
+ import org.w3c.dom.Node;
+ import org.w3c.dom.NodeList;
public class Value {
***************
*** 17,21 ****
private final ArrayList columns = new ArrayList();
private Type type;
! private IdentifierGenerator generator = Assigned.INSTANCE;
private String nullValue;
private Table table;
--- 24,29 ----
private final ArrayList columns = new ArrayList();
private Type type;
! private Properties identifierGeneratorProperties;
! private String identifierGeneratorStrategy = "assigned";
private String nullValue;
private Table table;
***************
*** 115,119 ****
//automatically makes a column with the default name if none is specifed by XML
! public Value(Node node, String defaultColumnName, boolean isNullable, Table table, Root root) throws MappingException {
this(node, isNullable, table, root);
if ( getColumnSpan()==0 ) {
--- 123,127 ----
//automatically makes a column with the default name if none is specifed by XML
! public Value(Node node, boolean isNullable, Table table, Root root, String defaultColumnName) throws MappingException {
this(node, isNullable, table, root);
if ( getColumnSpan()==0 ) {
***************
*** 123,126 ****
--- 131,137 ----
addColumn(col);
}
+ }
+
+ public void makeIdentifier(Node node, Root root) throws MappingException {
//GENERATOR
NodeList list = node.getChildNodes();
***************
*** 128,140 ****
Node subnode = list.item(i);
if ( "generator".equals( subnode.getNodeName() ) ) {
! try {
! generator = root.createIDGenerator(subnode);
! }
! catch (Exception e) {
! throw new MappingException( "Error creating ID generator",e);
}
! if (table!=null) table.setIdentifierGenerator(generator);
}
}
// UNSAVED-VALUE
Node nullValueNode = node.getAttributes().getNamedItem("unsaved-value");
--- 139,163 ----
Node subnode = list.item(i);
if ( "generator".equals( subnode.getNodeName() ) ) {
!
! identifierGeneratorStrategy = subnode.getAttributes().getNamedItem("class").getNodeValue();
!
! Properties params = new Properties();
! NodeList nodes = node.getChildNodes();
! for (int j=0; j<nodes.getLength(); j++) {
! Node childNode = nodes.item(j);
! if ( childNode.getNodeName().equals("param") ) {
! params.setProperty(
! childNode.getAttributes().getNamedItem("name").getNodeValue(),
! childNode.getFirstChild().getNodeValue()
! );
! }
}
!
! identifierGeneratorProperties = params;
}
}
+
+ table.setIdentifierValue(this);
+
// UNSAVED-VALUE
Node nullValueNode = node.getAttributes().getNamedItem("unsaved-value");
***************
*** 142,145 ****
--- 165,172 ----
}
+ public IdentifierGenerator createIdentifierGenerator(Dialect dialect) throws MappingException {
+ return IdentifierGeneratorFactory.create(identifierGeneratorStrategy, type, identifierGeneratorProperties, dialect);
+ }
+
protected Type typeFromXML(Node node) throws MappingException {
return getTypeFromXML(node);
***************
*** 149,160 ****
Type type;
NamedNodeMap atts = node.getAttributes();
- /*Node roleNode = atts.getNamedItem("role");
- if (roleNode!=null) {
- //System.out.println( path + Root.ROLE_SEPERATOR + roleNode.getNodeValue() );
- type = root.getCollectionType(
- path + Root.ROLE_SEPERATOR + roleNode.getNodeValue()
- );
- }
- else {*/
Node typeNode = atts.getNamedItem("type");
if (typeNode==null) {
--- 176,179 ----
***************
*** 165,169 ****
if (type==null) throw new MappingException( "Could not interpret type: " + typeNode.getNodeValue() );
}
- //}
return type;
}
--- 184,187 ----
***************
*** 189,194 ****
public int enableJoinedFetch() { return 0; }
! public IdentifierGenerator getIdentifierGenerator() {
! return generator;
}
--- 207,216 ----
public int enableJoinedFetch() { return 0; }
! public String getIdentifierStrategy() {
! return identifierGeneratorStrategy;
! }
!
! public Properties getIdentifierGeneratorProperties() {
! return identifierGeneratorProperties;
}
|
|
From: <one...@us...> - 2003-01-09 12:24:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/loader
Modified Files:
OuterJoinLoader.java
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: OuterJoinLoader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** OuterJoinLoader.java 5 Jan 2003 02:11:21 -0000 1.4
--- OuterJoinLoader.java 9 Jan 2003 12:24:51 -0000 1.5
***************
*** 73,77 ****
if ( autoEager( persister.enableJoinedFetch(), etype, session ) ) {
// fetch many-to-many by outerjoin depending value of outer-join in mapping
! walkTree(etype, columns, persister, alias, associations, new HashSet(), session);
}
}
--- 73,77 ----
if ( autoEager( persister.enableJoinedFetch(), etype, session ) ) {
// fetch many-to-many by outerjoin depending value of outer-join in mapping
! walkTree(etype, columns, persister, associations, new HashSet(), session);
}
}
***************
*** 112,116 ****
}
! walkTree(etype, columns, persister, alias, associations, classPersisters, session);
}
}
--- 112,116 ----
}
! walkTree(etype, columns, persister, associations, classPersisters, session);
}
}
***************
*** 139,143 ****
EntityType etype = (EntityType) types[i];
if ( autoEager( act.enableJoinedFetch(i), etype, session ) )
! walkTree(etype, range, persister, alias, associations, classPersisters, session);
}
else if ( types[i].isComponentType() ) {
--- 139,143 ----
EntityType etype = (EntityType) types[i];
if ( autoEager( act.enableJoinedFetch(i), etype, session ) )
! walkTree(etype, range, persister, associations, classPersisters, session);
}
else if ( types[i].isComponentType() ) {
***************
*** 158,162 ****
* Add on association (one-to-one or many-to-one) to a list of associations be fetched by outerjoin (if necessary)
*/
! private void walkTree(EntityType type, String[] columns, Object persister, String alias, List associations, Set classPersisters, SessionFactoryImplementor session) throws MappingException {
Loadable subpersister = (Loadable) session.getPersister( type.getPersistentClass() );
--- 158,162 ----
* Add on association (one-to-one or many-to-one) to a list of associations be fetched by outerjoin (if necessary)
*/
! private void walkTree(EntityType type, String[] columns, Object persister, List associations, Set classPersisters, SessionFactoryImplementor session) throws MappingException {
Loadable subpersister = (Loadable) session.getPersister( type.getPersistentClass() );
***************
*** 222,226 ****
.append( keyCols[j] )
.append(" AS ")
! .append( aliasColumn( keyCols[j], suffix ) );
if ( j != keyCols.length-1 ) buf.append(", ");
}
--- 222,226 ----
.append( keyCols[j] )
.append(" AS ")
! .append( StringHelper.suffix( keyCols[j], suffix ) );
if ( j != keyCols.length-1 ) buf.append(", ");
}
***************
*** 276,307 ****
tableName = StringHelper.unqualify(tableName);
! return aliasCore(tableName.length() <=5 ?
! tableName :
! tableName.substring(0, 5),
! Integer.toString(n)
! );
! }
!
! protected static String aliasColumn(String columnName, String suffix) {
! return aliasCore(columnName, suffix);
! }
- //TODO: refactor! this is a duplicate of a method in the Loader heirarchy
- private static String aliasCore(String name, String suffix) {
-
- char quote = name.charAt(0);
- boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
-
- if (nameEscaped) name = name.substring(1, name.length()-1);
-
- StringBuffer aliasBuilder = new StringBuffer(name.length());
-
- if (nameEscaped) aliasBuilder.append(quote);
- aliasBuilder.append(name);
- aliasBuilder.append(suffix);
- if (nameEscaped) aliasBuilder.append(quote);
-
- return aliasBuilder.toString();
- }
}
--- 276,285 ----
tableName = StringHelper.unqualify(tableName);
! return StringHelper.suffix(
! tableName.length() <=5 ? tableName : tableName.substring(0, 5),
! Integer.toString(n)
! );
! }
}
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/id
Modified Files:
Assigned.java IdentifierGenerator.java SequenceGenerator.java
SequenceHiLoGenerator.java UUIDHexGenerator.java
UUIDStringGenerator.java
Added Files:
Configurable.java CounterGenerator.java
IdentifierGeneratorFactory.java IdentityGenerator.java
TableGenerator.java TableHiLoGenerator.java
Removed Files:
HexGenerator.java HiLoHexGenerator.java LongGenerator.java
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
--- NEW FILE: Configurable.java ---
//$Id: Configurable.java,v 1.1 2003/01/09 12:24:50 oneovthafew Exp $
package net.sf.hibernate.id;
import java.util.Properties;
import net.sf.hibernate.MappingException;
import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.type.Type;
/**
* An <tt>IdentifierGenerator</tt> that supports "configuration".
*/
public interface Configurable {
/**
* Configure this instance, given the value of parameters
* specified by the user as <tt><param></tt> elements.
* @param params param values, keyed by parameter name
*/
public void configure(Type type, Properties params, Dialect d) throws MappingException;
}
--- NEW FILE: CounterGenerator.java ---
//$Id: CounterGenerator.java,v 1.1 2003/01/09 12:24:50 oneovthafew Exp $
package net.sf.hibernate.id;
import java.io.Serializable;
import net.sf.hibernate.engine.SessionImplementor;
/**
* <b>vm</b><br>
* <br>
* An <tt>IdentifierGenerator</tt> that returns a <tt>long</tt>,
* constructed from the system time and a counter value. Not safe
* for use in a cluster!
*/
public class CounterGenerator implements IdentifierGenerator {
private static short counter = (short) 0;
protected short getCount() {
synchronized(CounterGenerator.class) {
if (counter<0) counter=0;
return counter++;
}
}
public Serializable generate(SessionImplementor cache, Object obj) {
return new Long( ( System.currentTimeMillis() << 16 ) + getCount() );
}
public static void main( String[] args ) throws Exception {
IdentifierGenerator gen = new CounterGenerator();
for ( int i=0; i<5; i++) {
long result = ( (Long) gen.generate(null, null) ).longValue();
System.out.println( result + " (" + Long.toHexString(result) + ")" );
}
}
}
--- NEW FILE: IdentifierGeneratorFactory.java ---
//$Id: IdentifierGeneratorFactory.java,v 1.1 2003/01/09 12:24:50 oneovthafew Exp $
package net.sf.hibernate.id;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Properties;
import net.sf.hibernate.MappingException;
import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.type.Type;
import net.sf.hibernate.util.ReflectHelper;
/**
*
*/
public class IdentifierGeneratorFactory {
// unhappy about this being public ... is there a better way?
public static Number get(ResultSet rs, Class clazz) throws SQLException, IdentifierGenerationException {
if ( clazz==Long.class ) {
return new Long( rs.getLong(1) );
}
else if ( clazz==Integer.class ) {
return new Integer( rs.getInt(1) );
}
else if ( clazz==Short.class ) {
return new Short( rs.getShort(1) );
}
else {
throw new IdentifierGenerationException("this id generator generates long, integer, short");
}
}
private static final HashMap idgenerators = new HashMap();
static {
idgenerators.put("uuid.hex", UUIDHexGenerator.class);
idgenerators.put("uuid.string", UUIDStringGenerator.class);
idgenerators.put("hilo", TableHiLoGenerator.class);
idgenerators.put("assigned", Assigned.class);
idgenerators.put("identity", IdentityGenerator.class);
idgenerators.put("sequence", SequenceGenerator.class);
idgenerators.put("seqhilo", SequenceHiLoGenerator.class);
idgenerators.put("vm", CounterGenerator.class);
}
public static IdentifierGenerator create(String strategy, Type type, Properties params, Dialect dialect) throws MappingException {
try {
Class clazz = (Class) idgenerators.get(strategy);
if ( "native".equals(strategy) ) {
if ( dialect.supportsIdentityColumns() ) {
clazz = IdentityGenerator.class;
}
else if ( dialect.supportsSequences() ) {
clazz = SequenceGenerator.class;
}
else {
clazz = TableHiLoGenerator.class;
}
}
if (clazz==null) clazz = ReflectHelper.classForName(strategy);
IdentifierGenerator idgen = (IdentifierGenerator) clazz.newInstance();
if (idgen instanceof Configurable) ( (Configurable) idgen).configure(type, params, dialect);
return idgen;
}
catch (Exception e) {
throw new MappingException("could not instantiate id generator", e);
}
}
static Number createNumber(long value, Class clazz) throws IdentifierGenerationException {
if ( clazz==Long.class ) {
return new Long(value);
}
else if ( clazz==Integer.class ) {
return new Integer( (int) value );
}
else if ( clazz==Short.class ) {
return new Short( (short) value );
}
else {
throw new IdentifierGenerationException("this id generator generates long, integer, short");
}
}
}
--- NEW FILE: IdentityGenerator.java ---
//$Id: IdentityGenerator.java,v 1.1 2003/01/09 12:24:50 oneovthafew Exp $
package net.sf.hibernate.id;
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.engine.SessionImplementor;
import java.io.Serializable;
import java.sql.SQLException;
/**
* <b>identity</b><br>
* <br>
* Indicates to the <tt>Session</tt> that identity (ie. identity/autoincrement
* column) key generation should be used.
*
*/
public class IdentityGenerator implements IdentifierGenerator {
public Serializable generate(SessionImplementor s, Object obj) throws SQLException, HibernateException {
return null;
}
}
--- NEW FILE: TableGenerator.java ---
//$Id: TableGenerator.java,v 1.1 2003/01/09 12:24:50 oneovthafew Exp $
package net.sf.hibernate.id;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.engine.SessionImplementor;
import net.sf.hibernate.type.Type;
import net.sf.hibernate.util.PropertiesHelper;
/**
* An <tt>IdentifierGenerator</tt> that uses a database
* table to store the last generated value. It is not
* intended that applications use this strategy directly.
* However, it may be used to build other (efficient)
* strategies. The returned type is <tt>Integer</tt>.<br>
* <br>
* The hi value MUST be fetched in a seperate transaction
* to the <tt>Session</tt> transaction so the generator must
* be able to obtain a new connection and commit it. Hence
* this implementation may not be used when Hibernate is
* fetching connections from an application server datasource
* or when the user is supplying connections.<br>
* <br>
* The returned value is of type <tt>integer</tt>.<br>
* <br>
* Mapping parameters supported: table, column
*
* @see TableHiLoGenerator
*/
public class TableGenerator implements PersistentIdentifierGenerator, Configurable {
/**
* The column parameter
*/
public static final String COLUMN = "column";
/**
* The table parameter
*/
public static final String TABLE = "table";
private static final Log log = LogFactory.getLog(TableGenerator.class);
private String tableName;
private String columnName;
private String query;
private String update;
public void configure(Type type, Properties params, Dialect dialect) {
this.tableName = PropertiesHelper.getString(TABLE, params, "hibernate_unique_key");
this.columnName = PropertiesHelper.getString(COLUMN, params, "next_hi");
query = "select " + columnName + " from " + tableName;
if ( dialect.supportsForUpdate() ) query += " for update";
update = "update " + tableName + " set " + columnName + " = ? where " + columnName + " = ?";
}
public synchronized Serializable generate(SessionImplementor session, Object object)
throws SQLException, HibernateException {
// This has to be done using a different connection to the
// containing transaction because the new hi value must
// remain valid even if the containing transaction rolls
// back
Connection conn = session.getFactory().openConnection();
int result;
int rows;
try {
do {
// The loop ensures atomicity of the
// select + update even for no transaction
// or read committed isolation level
PreparedStatement qps = conn.prepareStatement(query);
try {
ResultSet rs = qps.executeQuery();
if ( !rs.next() ) {
String err = "could not read a hi value - you need to populate the table: " + tableName;
log.error(err);
throw new IdentifierGenerationException(err);
}
result = rs.getInt(1);
rs.close();
}
catch (SQLException sqle) {
log.error("could not read a hi value", sqle);
throw sqle;
}
finally {
qps.close();
}
PreparedStatement ups = conn.prepareStatement(update);
try {
ups.setInt( 1, result + 1 );
ups.setInt( 2, result );
rows = ups.executeUpdate();
}
catch (SQLException sqle) {
log.error("could not update hi value in: " + tableName, sqle);
throw sqle;
}
finally {
ups.close();
}
}
while (rows==0);
conn.commit();
return new Integer(result);
}
finally {
session.getFactory().closeConnection(conn);
}
}
public String[] sqlCreateStrings(Dialect dialect) throws HibernateException {
return new String[] {
"create table " + tableName + " ( " + columnName + " " + dialect.getTypeName(Types.INTEGER) + " )",
"insert into " + tableName + " values ( 0 )"
};
}
public String sqlDropString(Dialect dialect) {
return "drop table " + tableName;
}
public Object generatorKey() {
return tableName;
}
}
--- NEW FILE: TableHiLoGenerator.java ---
//$Id: TableHiLoGenerator.java,v 1.1 2003/01/09 12:24:50 oneovthafew Exp $
package net.sf.hibernate.id;
import java.io.Serializable;
import java.sql.*;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.engine.SessionImplementor;
import net.sf.hibernate.type.Type;
import net.sf.hibernate.util.PropertiesHelper;
/**
* <b>hilo</b><br>
* <br>
* An <tt>IdentifierGenerator</tt> that returns a <tt>Long</tt>, constructed using
* a hi/lo algorithm. The hi value MUST be fetched in a seperate transaction
* to the <tt>Session</tt> transaction so the generator must be able to obtain
* a new connection and commit it. Hence this implementation may not
* be used when Hibernate is fetching connections from an application
* server datasource or when the user is supplying connections. In these
* cases a <tt>SequenceHiLoGenerator</tt> would be a better choice (where
* supported).<br>
* <br>
* Mapping parameters supported: table, column, max_lo
*
* @see SequenceHiLoGenerator
*/
public class TableHiLoGenerator extends TableGenerator {
/**
* The max_lo parameter
*/
public static final String MAX_LO = "max_lo";
private long hi;
private int lo;
private int maxLo;
private Class returnClass;
private static final Log log = LogFactory.getLog(TableHiLoGenerator.class);
public void configure(Type type, Properties params, Dialect d) {
super.configure(type, params, d);
lo = maxLo = PropertiesHelper.getInt(MAX_LO, params, Short.MAX_VALUE);
returnClass = type.returnedClass();
}
public synchronized Serializable generate(SessionImplementor session, Object obj) throws SQLException, HibernateException {
if (lo==maxLo) {
int hival = ( (Integer) super.generate(session, obj) ).intValue();
lo = 0;
hi = hival * (maxLo+1);
log.debug("new hi value: " + hival);
}
return IdentifierGeneratorFactory.createNumber( hi + lo++, returnClass );
}
}
Index: Assigned.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/Assigned.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Assigned.java 5 Jan 2003 02:11:21 -0000 1.3
--- Assigned.java 9 Jan 2003 12:24:50 -0000 1.4
***************
*** 28,32 ****
return id;
}
-
}
--- 28,31 ----
Index: IdentifierGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/IdentifierGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IdentifierGenerator.java 5 Jan 2003 02:11:21 -0000 1.3
--- IdentifierGenerator.java 9 Jan 2003 12:24:50 -0000 1.4
***************
*** 25,28 ****
--- 25,29 ----
*/
public interface IdentifierGenerator {
+
/**
* Generate a new identifier.
***************
*** 34,37 ****
--- 35,39 ----
*/
public Serializable generate(SessionImplementor session, Object object) throws SQLException, HibernateException;
+
}
Index: SequenceGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/SequenceGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SequenceGenerator.java 5 Jan 2003 02:11:21 -0000 1.3
--- SequenceGenerator.java 9 Jan 2003 12:24:50 -0000 1.4
***************
*** 3,7 ****
import java.io.Serializable;
! import java.sql.*;
import org.apache.commons.logging.Log;
--- 3,10 ----
import java.io.Serializable;
! import java.sql.PreparedStatement;
! import java.sql.ResultSet;
! import java.sql.SQLException;
! import java.util.Properties;
import org.apache.commons.logging.Log;
***************
*** 9,14 ****
--- 12,20 ----
import net.sf.hibernate.HibernateException;
+ import net.sf.hibernate.MappingException;
import net.sf.hibernate.engine.SessionImplementor;
+ import net.sf.hibernate.type.Type;
import net.sf.hibernate.util.JDBCExceptionReporter;
+ import net.sf.hibernate.util.PropertiesHelper;
import net.sf.hibernate.dialect.Dialect;
***************
*** 19,52 ****
* performance algorithm is <tt>SequenceHiLoGenerator</tt>.<br>
* <br>
! * One mapping parameter is supported: sequencename.
*
* @see SequenceHiLoGenerator
! * @see HiLoGenerator
*/
! public class SequenceGenerator implements PersistentIdentifierGenerator {
! private final String sequenceName;
! private static final Log log = LogFactory.getLog(SequenceGenerator.class);
! public SequenceGenerator(String sequenceName) {
! this.sequenceName = sequenceName;
! }
! public SequenceGenerator() {
! this("hibernate_sequence");
}
public Serializable generate(SessionImplementor session, Object obj) throws SQLException, HibernateException {
- String sql = session.getFactory().getDialect().getSequenceNextValString(sequenceName);
PreparedStatement st = session.getBatcher().prepareStatement(sql);
try {
ResultSet rs = st.executeQuery();
! final Long result;
try {
rs.next();
! result = new Long( rs.getLong(1) );
}
finally {
--- 25,62 ----
* performance algorithm is <tt>SequenceHiLoGenerator</tt>.<br>
* <br>
! * One mapping parameter is supported: sequence.
*
* @see SequenceHiLoGenerator
! * @see TableHiLoGenerator
*/
! public class SequenceGenerator implements PersistentIdentifierGenerator, Configurable {
! /**
! * The sequence parameter
! */
! public static final String SEQUENCE = "sequence";
! private String sequenceName;
! private Class returnClass;
! private String sql;
! private static final Log log = LogFactory.getLog(SequenceGenerator.class);
! public void configure(Type type, Properties params, Dialect dialect) throws MappingException {
! this.sequenceName = PropertiesHelper.getString(SEQUENCE, params, "hibernate_sequence");
! returnClass = type.returnedClass();
! sql = dialect.getSequenceNextValString(sequenceName);
}
public Serializable generate(SessionImplementor session, Object obj) throws SQLException, HibernateException {
PreparedStatement st = session.getBatcher().prepareStatement(sql);
try {
ResultSet rs = st.executeQuery();
! final Number result;
try {
rs.next();
! result = IdentifierGeneratorFactory.get(rs, returnClass);
}
finally {
Index: SequenceHiLoGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/SequenceHiLoGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SequenceHiLoGenerator.java 5 Jan 2003 02:11:21 -0000 1.3
--- SequenceHiLoGenerator.java 9 Jan 2003 12:24:50 -0000 1.4
***************
*** 4,7 ****
--- 4,8 ----
import java.io.Serializable;
import java.sql.SQLException;
+ import java.util.Properties;
import org.apache.commons.logging.Log;
***************
*** 9,16 ****
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.engine.SessionImplementor;
/**
! * <b>seqhilo.long</b><br>
* <br>
* An <tt>IdentifierGenerator</tt> that combines a hi/lo algorithm with an underlying
--- 10,21 ----
import net.sf.hibernate.HibernateException;
+ import net.sf.hibernate.MappingException;
+ import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.engine.SessionImplementor;
+ import net.sf.hibernate.type.Type;
+ import net.sf.hibernate.util.PropertiesHelper;
/**
! * <b>seqhilo</b><br>
* <br>
* An <tt>IdentifierGenerator</tt> that combines a hi/lo algorithm with an underlying
***************
*** 18,56 ****
* maximum lo value to determine how often new hi values are fetched.<br>
* <br>
! * If sequences are not available, <tt>HiLoGenerator</tt> might be an
* alternative.<br>
* <br>
! * One mapping parameter is supported: sequencename.
*
! * @see HiLoGenerator
*/
public class SequenceHiLoGenerator extends SequenceGenerator {
private static final Log log = LogFactory.getLog(SequenceHiLoGenerator.class);
! private final int maxLoValue;
private int lo;
private long hi;
! public SequenceHiLoGenerator(String sequenceName, String maxLo) {
! super(sequenceName);
! lo = maxLoValue = Integer.parseInt(maxLo);
! }
! public SequenceHiLoGenerator(String sequenceName) {
! super(sequenceName);
! lo = maxLoValue = 9;
! }
! public SequenceHiLoGenerator() {
! this("hibernate_sequence");
}
public synchronized Serializable generate(SessionImplementor session, Object obj) throws SQLException, HibernateException {
if ( lo==maxLoValue ) {
! long hival = ( (Long) super.generate(session, obj) ).longValue();
! log.debug("new hi value: " + hival);
! hi = hival * ( maxLoValue+1 );
lo = 0;
}
! return new Long( hi + lo++ );
}
--- 23,60 ----
* maximum lo value to determine how often new hi values are fetched.<br>
* <br>
! * If sequences are not available, <tt>TableHiLoGenerator</tt> might be an
* alternative.<br>
* <br>
! * Mapping parameters supported: sequence, max_lo.
*
! * @see TableHiLoGenerator
*/
public class SequenceHiLoGenerator extends SequenceGenerator {
+ public static final String SEQUENCE = "sequence";
+
private static final Log log = LogFactory.getLog(SequenceHiLoGenerator.class);
! private int maxLoValue;
private int lo;
private long hi;
+ private Class returnClass;
! public void configure(Type type, Properties params, Dialect d) throws MappingException {
! super.configure(type, params, d);
! lo = maxLoValue = PropertiesHelper.getInt(SEQUENCE, params, 9);
! returnClass = type.returnedClass();
}
public synchronized Serializable generate(SessionImplementor session, Object obj) throws SQLException, HibernateException {
+
if ( lo==maxLoValue ) {
! long hival = ( (Number) super.generate(session, obj) ).longValue();
lo = 0;
+ hi = hival * ( maxLoValue+1 );
+ log.debug("new hi value: " + hival);
}
!
! return IdentifierGeneratorFactory.createNumber( hi + lo++, returnClass );
}
Index: UUIDHexGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/UUIDHexGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** UUIDHexGenerator.java 5 Jan 2003 02:11:21 -0000 1.3
--- UUIDHexGenerator.java 9 Jan 2003 12:24:50 -0000 1.4
***************
*** 3,8 ****
--- 3,13 ----
import java.io.Serializable;
+ import java.util.Properties;
+ import net.sf.hibernate.Hibernate;
+ import net.sf.hibernate.dialect.Dialect;
import net.sf.hibernate.engine.SessionImplementor;
+ import net.sf.hibernate.type.Type;
+ import net.sf.hibernate.util.PropertiesHelper;
/**
***************
*** 10,33 ****
* <br>
* A <tt>UUIDGenerator</tt> that returns a string of length 32,
! * This string will consist of only hex digits.
! * Optionally, the string may be generated with seperators
! * between each component of the UUID.
*
* @see UUIDStringGenerator
*/
! public class UUIDHexGenerator extends UUIDGenerator {
!
! private final String sep;
!
! public UUIDHexGenerator() {
! super();
! sep = "";
! }
! public UUIDHexGenerator(String sep) {
! super();
! this.sep=sep;
! }
protected String format(int intval) {
--- 15,28 ----
* <br>
* A <tt>UUIDGenerator</tt> that returns a string of length 32,
! * This string will consist of only hex digits. Optionally,
! * the string may be generated with seperators between each
! * component of the UUID.
*
* @see UUIDStringGenerator
*/
! public class UUIDHexGenerator extends UUIDGenerator implements Configurable {
! private String sep;
protected String format(int intval) {
***************
*** 56,61 ****
public static void main( String[] args ) throws Exception {
! IdentifierGenerator gen = new UUIDHexGenerator("/");
! IdentifierGenerator gen2 = new UUIDHexGenerator("/");
for ( int i=0; i<10; i++) {
String id = (String) gen.generate(null, null);
--- 51,61 ----
public static void main( String[] args ) throws Exception {
! Properties props = new Properties();
! props.setProperty("seperator", "/");
! IdentifierGenerator gen = new UUIDHexGenerator();
! ( (Configurable) gen ).configure(Hibernate.STRING, props, null);
! IdentifierGenerator gen2 = new UUIDHexGenerator();
! ( (Configurable) gen2 ).configure(Hibernate.STRING, props, null);
!
for ( int i=0; i<10; i++) {
String id = (String) gen.generate(null, null);
***************
*** 67,70 ****
--- 67,74 ----
+ public void configure(Type type, Properties params, Dialect d) {
+ sep = PropertiesHelper.getString("seperator", params, "");
+ }
+
}
Index: UUIDStringGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/UUIDStringGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** UUIDStringGenerator.java 5 Jan 2003 02:11:21 -0000 1.3
--- UUIDStringGenerator.java 9 Jan 2003 12:24:50 -0000 1.4
***************
*** 5,9 ****
import net.sf.hibernate.engine.SessionImplementor;
! import net.sf.hibernate.util.*;
/**
--- 5,9 ----
import net.sf.hibernate.engine.SessionImplementor;
! import net.sf.hibernate.util.BytesHelper;
/**
***************
*** 25,38 ****
private String sep;
- public UUIDStringGenerator() {
- super();
- sep="";
- }
-
- public UUIDStringGenerator(String sep) {
- super();
- this.sep=sep;
- }
-
public Serializable generate(SessionImplementor cache, Object obj) {
return new StringBuffer(20)
--- 25,28 ----
***************
*** 46,50 ****
public static void main( String[] args ) throws Exception {
! IdentifierGenerator gen = new UUIDStringGenerator();//("/");
for ( int i=0; i<5; i++) {
String id = (String) gen.generate(null, null);
--- 36,40 ----
public static void main( String[] args ) throws Exception {
! IdentifierGenerator gen = new UUIDStringGenerator();
for ( int i=0; i<5; i++) {
String id = (String) gen.generate(null, null);
***************
*** 60,64 ****
return new String ( BytesHelper.toBytes(value) );
}
!
}
--- 50,54 ----
return new String ( BytesHelper.toBytes(value) );
}
!
}
--- HexGenerator.java DELETED ---
--- HiLoHexGenerator.java DELETED ---
--- LongGenerator.java DELETED ---
|
|
From: <one...@us...> - 2003-01-09 12:24:53
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv16192/net/sf/hibernate/impl
Modified Files:
DatastoreImpl.java SessionImpl.java
Log Message:
redesigned id generator package
applied Mark Woon's patch for generated alias lengths
minor refactoring of Transaction package
Index: DatastoreImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/DatastoreImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DatastoreImpl.java 5 Jan 2003 02:11:21 -0000 1.3
--- DatastoreImpl.java 9 Jan 2003 12:24:51 -0000 1.4
***************
*** 26,29 ****
--- 26,30 ----
import net.sf.hibernate.tool.hbm2ddl.JdbcDatabaseInfo;
import net.sf.hibernate.tool.hbm2ddl.JdbcTableInfo;
+ import net.sf.hibernate.id.IdentifierGenerator;
import net.sf.hibernate.id.PersistentIdentifierGenerator;
import net.sf.hibernate.cfg.*;
***************
*** 38,42 ****
private HashMap collections = new HashMap();
private HashMap tables = new HashMap();
- private HashMap generators = new HashMap();
private HashMap namedQueries = new HashMap();
--- 39,42 ----
***************
*** 104,108 ****
private void store(Document doc) throws Exception {
try {
! new Root(doc, classes, collections, tables, generators, namedQueries);
}
catch (MappingException me) {
--- 104,108 ----
private void store(Document doc) throws Exception {
try {
! new Root(doc, classes, collections, tables, namedQueries);
}
catch (MappingException me) {
***************
*** 181,184 ****
--- 181,196 ----
}
+
+ private Iterator iterateGenerators(Dialect dialect) throws MappingException {
+ HashMap generators = new HashMap();
+ Iterator iter = classes.values().iterator();
+ while ( iter.hasNext() ) {
+ IdentifierGenerator ig = ( (PersistentClass) iter.next() ).getIdentifier().createIdentifierGenerator(dialect);
+ if ( ig instanceof PersistentIdentifierGenerator ) generators.put(
+ ( (PersistentIdentifierGenerator) ig ).generatorKey(), ig
+ );
+ }
+ return generators.values().iterator();
+ }
public String[] generateDropSchemaScript(Dialect dialect) throws HibernateException {
***************
*** 200,207 ****
}
Iterator iter = getTableMaps();
! while ( iter.hasNext() ) script.add( ( (Table) iter.next() ).sqlDropString(dialect) );
! iter = generators.values().iterator();
while ( iter.hasNext() ) {
String dropString = ( (PersistentIdentifierGenerator) iter.next() ).sqlDropString(dialect);
--- 212,223 ----
}
+
Iterator iter = getTableMaps();
! while ( iter.hasNext() ) {
! Table table = (Table) iter.next();
! script.add( table.sqlDropString(dialect) );
! }
! iter = iterateGenerators(dialect);
while ( iter.hasNext() ) {
String dropString = ( (PersistentIdentifierGenerator) iter.next() ).sqlDropString(dialect);
***************
*** 243,247 ****
}
! iter = generators.values().iterator();
while ( iter.hasNext() )
{
--- 259,263 ----
}
! iter = iterateGenerators(dialect);
while ( iter.hasNext() )
{
***************
*** 261,265 ****
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName());
if (tableInfo == null) {
script.add( table.sqlCreateString(dialect, this) );
--- 277,281 ----
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
! JdbcTableInfo tableInfo = databaseInfo.getTableInfo( table.getName() );
if (tableInfo == null) {
script.add( table.sqlCreateString(dialect, this) );
***************
*** 267,303 ****
else {
final String sql = table.sqlAlterString(dialect, this, tableInfo);
! if (sql != null) script.add(sql);
}
}
iter = getTableMaps();
! while (iter.hasNext()) {
! Table table = (Table)iter.next();
! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName());
Iterator subIter;
! if (dialect.hasAlterTable()) {
subIter = table.foreignKeyIterator();
while (subIter.hasNext()) {
! ForeignKey fk = (ForeignKey)subIter.next();
! if (tableInfo == null || tableInfo.getForeignKeyInfo(fk.getName())==null)
! script.add(fk.sqlCreateString(dialect, this));
}
}
subIter = table.indexIterator();
! while (subIter.hasNext()) {
Index index = (Index)subIter.next();
! if (tableInfo == null || tableInfo.getIndexInfo(index.getName())==null)
! script.add(index.sqlCreateString(dialect, this));
}
}
! iter = generators.values().iterator();
! while (iter.hasNext()) {
! PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator)iter.next();
! if (!databaseInfo.isSequence(generator.generatorKey())) {
String[] lines = generator.sqlCreateStrings(dialect);
! for (int i = 0; i < lines.length; i++) script.add(lines[i]);
}
}
--- 283,320 ----
else {
final String sql = table.sqlAlterString(dialect, this, tableInfo);
! if (sql!=null) script.add(sql);
}
}
iter = getTableMaps();
! while ( iter.hasNext() ) {
! Table table = (Table) iter.next();
! JdbcTableInfo tableInfo = databaseInfo.getTableInfo( table.getName() );
Iterator subIter;
! if ( dialect.hasAlterTable() ) {
subIter = table.foreignKeyIterator();
while (subIter.hasNext()) {
! ForeignKey fk = (ForeignKey) subIter.next();
! if ( tableInfo == null || tableInfo.getForeignKeyInfo( fk.getName() ) == null )
! script.add( fk.sqlCreateString(dialect, this) );
}
}
subIter = table.indexIterator();
! while ( subIter.hasNext() ) {
Index index = (Index)subIter.next();
! if ( tableInfo == null || tableInfo.getIndexInfo( index.getName() )==null )
! script.add( index.sqlCreateString(dialect, this) );
}
}
! iter = iterateGenerators(dialect);
! while ( iter.hasNext() ) {
! PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator) iter.next();
! Object key = generator.generatorKey();
! if ( !databaseInfo.isSequence(key) && !databaseInfo.isTable(key) ) {
String[] lines = generator.sqlCreateStrings(dialect);
! for (int i = 0; i < lines.length; i++) script.add( lines[i] );
}
}
Index: SessionImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** SessionImpl.java 5 Jan 2003 02:11:21 -0000 1.6
--- SessionImpl.java 9 Jan 2003 12:24:51 -0000 1.7
***************
*** 124,128 ****
private transient Batcher batcher;
!
static final class Status implements Serializable {
private String name;
--- 124,128 ----
private transient Batcher batcher;
!
static final class Status implements Serializable {
private String name;
***************
*** 1604,1607 ****
--- 1604,1608 ----
return factory.getTransactionFactory().beginTransaction(this);
}
+
/**
|
|
From: <one...@us...> - 2003-01-09 09:47:46
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers
In directory sc8-pr-cvs1:/tmp/cvs-serv10886/cirrus/hibernate/helpers
Modified Files:
StringHelper.java
Log Message:
improved alias length-limiting code
Index: StringHelper.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/StringHelper.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** StringHelper.java 9 Jan 2003 09:40:18 -0000 1.18
--- StringHelper.java 9 Jan 2003 09:47:37 -0000 1.19
***************
*** 118,121 ****
--- 118,122 ----
if (nameBuffer.length() > 15) {
nameBuffer.delete(0, nameBuffer.length()-15);
+ if ( !Character.isLetter( nameBuffer.charAt(0) ) ) nameBuffer.setCharAt(0, 'x');
}
if (nameEscaped) {
|
|
From: <one...@us...> - 2003-01-09 09:40:24
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader
In directory sc8-pr-cvs1:/tmp/cvs-serv8251/cirrus/hibernate/loader
Modified Files:
OuterJoinLoader.java
Log Message:
Mark Woon's patch to limit length of aliases
Index: OuterJoinLoader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/loader/OuterJoinLoader.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** OuterJoinLoader.java 26 Nov 2002 14:47:29 -0000 1.14
--- OuterJoinLoader.java 9 Jan 2003 09:40:19 -0000 1.15
***************
*** 73,77 ****
if ( autoEager( persister.enableJoinedFetch(), etype, session ) ) {
// fetch many-to-many by outerjoin depending value of outer-join in mapping
! walkTree(etype, columns, persister, alias, associations, new HashSet(), session);
}
}
--- 73,77 ----
if ( autoEager( persister.enableJoinedFetch(), etype, session ) ) {
// fetch many-to-many by outerjoin depending value of outer-join in mapping
! walkTree(etype, columns, persister, associations, new HashSet(), session);
}
}
***************
*** 104,108 ****
columns = StringHelper.prefix(
! ( (Loadable) persister ).getIdentifierColumnNames(), //The cast is safe because collections can't contain a 1-to-1
alias + '.'
);
--- 104,108 ----
columns = StringHelper.prefix(
! persister.getIdentifierColumnNames(),
alias + '.'
);
***************
*** 112,116 ****
}
! walkTree(etype, columns, persister, alias, associations, classPersisters, session);
}
}
--- 112,116 ----
}
! walkTree(etype, columns, persister, associations, classPersisters, session);
}
}
***************
*** 139,143 ****
EntityType etype = (EntityType) types[i];
if ( autoEager( act.enableJoinedFetch(i), etype, session ) )
! walkTree(etype, range, persister, alias, associations, classPersisters, session);
}
else if ( types[i].isComponentType() ) {
--- 139,143 ----
EntityType etype = (EntityType) types[i];
if ( autoEager( act.enableJoinedFetch(i), etype, session ) )
! walkTree(etype, range, persister, associations, classPersisters, session);
}
else if ( types[i].isComponentType() ) {
***************
*** 158,162 ****
* Add on association (one-to-one or many-to-one) to a list of associations be fetched by outerjoin (if necessary)
*/
! private void walkTree(EntityType type, String[] columns, Object persister, String alias, List associations, Set classPersisters, SessionFactoryImplementor session) throws MappingException {
Loadable subpersister = (Loadable) session.getPersister( type.getPersistentClass() );
--- 158,162 ----
* Add on association (one-to-one or many-to-one) to a list of associations be fetched by outerjoin (if necessary)
*/
! private void walkTree(EntityType type, String[] columns, Object persister, List associations, Set classPersisters, SessionFactoryImplementor session) throws MappingException {
Loadable subpersister = (Loadable) session.getPersister( type.getPersistentClass() );
***************
*** 222,226 ****
.append( keyCols[j] )
.append(" AS ")
! .append( aliasColumn( keyCols[j], suffix ) );
if ( j != keyCols.length-1 ) buf.append(", ");
}
--- 222,226 ----
.append( keyCols[j] )
.append(" AS ")
! .append( StringHelper.suffix( keyCols[j], suffix ) );
if ( j != keyCols.length-1 ) buf.append(", ");
}
***************
*** 276,306 ****
tableName = StringHelper.unqualify(tableName);
! return aliasCore(tableName.length() <=5 ?
! tableName :
tableName.substring(0, 5),
! Integer.toString(n)
);
- }
-
- protected static String aliasColumn(String columnName, String suffix) {
- return aliasCore(columnName, suffix);
- }
-
- //TODO: refactor! this is a duplicate of a method in the Loader heirarchy
- private static String aliasCore(String name, String suffix) {
-
- char quote = name.charAt(0);
- boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
-
- if (nameEscaped) name = name.substring(1, name.length()-1);
-
- StringBuffer aliasBuilder = new StringBuffer(name.length());
-
- if (nameEscaped) aliasBuilder.append(quote);
- aliasBuilder.append(name);
- aliasBuilder.append(suffix);
- if (nameEscaped) aliasBuilder.append(quote);
-
- return aliasBuilder.toString();
}
}
--- 276,285 ----
tableName = StringHelper.unqualify(tableName);
! return StringHelper.suffix(
! tableName.length() <=5 ?
! tableName :
tableName.substring(0, 5),
! Integer.toString(n)
);
}
}
|
|
From: <one...@us...> - 2003-01-09 09:40:24
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv8251/cirrus/hibernate/test
Modified Files:
Master.java MasterDetailTest.java
Log Message:
Mark Woon's patch to limit length of aliases
Index: Master.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/Master.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Master.java 15 Oct 2002 03:36:10 -0000 1.8
--- Master.java 9 Jan 2003 09:40:20 -0000 1.9
***************
*** 21,25 ****
}
! private void setDetails(Set details) {
this.details = details;
}
--- 21,25 ----
}
! void setDetails(Set details) {
this.details = details;
}
Index: MasterDetailTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MasterDetailTest.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** MasterDetailTest.java 7 Dec 2002 08:20:53 -0000 1.42
--- MasterDetailTest.java 9 Jan 2003 09:40:20 -0000 1.43
***************
*** 367,370 ****
--- 367,415 ----
}
+
+ public void testUpdateCollections() throws Exception {
+ Session s = sessions.openSession();
+ Master m = new Master();
+ Serializable mid = s.save(m);
+ s.flush();
+ s.connection().commit();
+ s.close();
+
+ s = sessions.openSession();
+ m.setDetails( new HashSet() );
+ Detail d1 = new Detail();
+ Detail d2 = new Detail();
+ //s.flush();
+ d1.setMaster(m);
+ d2.setMaster(m);
+ m.addDetail(d1);
+ m.addDetail(d2);
+ s.update(m, mid);
+
+ Iterator iter = m.getDetails().iterator();
+ while ( iter.hasNext() ) s.save( iter.next() );
+ s.flush();
+ s.connection().commit();
+ s.close();
+
+
+ s = sessions.openSession();
+ m = (Master) s.load(Master.class, mid);
+ iter = m.getDetails().iterator();
+ int i=0;
+ while ( iter.hasNext() ) {
+ assertTrue( iter.next()!=null );
+ i++;
+ }
+ assertTrue(i==2);
+ iter = m.getDetails().iterator();
+ while ( iter.hasNext() ) s.delete( iter.next() );
+ s.delete(m);
+ s.flush();
+ s.connection().commit();
+ s.close();
+
+ }
+
public void testMultiLevelCascade() throws Exception {
Session s = sessions.openSession();
|
|
From: <one...@us...> - 2003-01-09 09:40:24
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister
In directory sc8-pr-cvs1:/tmp/cvs-serv8251/cirrus/hibernate/persister
Modified Files:
AbstractEntityPersister.java EntityPersister.java
MultiTableEntityPersister.java
Log Message:
Mark Woon's patch to limit length of aliases
Index: AbstractEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/AbstractEntityPersister.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** AbstractEntityPersister.java 6 Dec 2002 12:24:31 -0000 1.19
--- AbstractEntityPersister.java 9 Jan 2003 09:40:19 -0000 1.20
***************
*** 131,135 ****
.append( cols[i] )
.append(" as ")
! .append( aliasColumn(cols[i], suffix) );
if (i!=cols.length-1) buf.append(", ");
}
--- 131,135 ----
.append( cols[i] )
.append(" as ")
! .append( StringHelper.suffix(cols[i], suffix) );
if (i!=cols.length-1) buf.append(", ");
}
***************
*** 686,707 ****
public Class getConcreteProxyClass() {
return concreteProxyClass;
- }
-
- //TODO: refactor! this is a duplicate of a method in the Loader heirarchy
- protected static String aliasColumn(String name, String suffix) {
-
- char quote = name.charAt(0);
- boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
-
- if (nameEscaped) name = name.substring(1, name.length()-1);
-
- StringBuffer aliasBuilder = new StringBuffer(name.length());
-
- if (nameEscaped) aliasBuilder.append(quote);
- aliasBuilder.append(name);
- aliasBuilder.append(suffix);
- if (nameEscaped) aliasBuilder.append(quote);
-
- return aliasBuilder.toString();
}
--- 686,689 ----
Index: EntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/EntityPersister.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** EntityPersister.java 19 Dec 2002 11:49:20 -0000 1.47
--- EntityPersister.java 9 Jan 2003 09:40:19 -0000 1.48
***************
*** 900,904 ****
.append(discr)
.append(" as ")
! .append( aliasColumn(discr, suffix) );
}
--- 900,904 ----
.append(discr)
.append(" as ")
! .append( StringHelper.suffix(discr, suffix) );
}
***************
*** 911,915 ****
.append( cols[i] )
.append(" as ")
! .append( aliasColumn(cols[i], suffix) );
}
return buf.toString();
--- 911,915 ----
.append( cols[i] )
.append(" as ")
! .append( StringHelper.suffix(cols[i], suffix) );
}
return buf.toString();
Index: MultiTableEntityPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/persister/MultiTableEntityPersister.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** MultiTableEntityPersister.java 19 Dec 2002 11:54:19 -0000 1.45
--- MultiTableEntityPersister.java 9 Jan 2003 09:40:19 -0000 1.46
***************
*** 99,104 ****
private static final String[] STRING_ARRAY = {};
private static final Type[] TYPE_ARRAY = {};
! private static final Class[] NO_CLASSES = new Class[0];
!
private static final Log log = LogFactory.getLog(MultiTableEntityPersister.class);
--- 99,103 ----
private static final String[] STRING_ARRAY = {};
private static final Type[] TYPE_ARRAY = {};
!
private static final Log log = LogFactory.getLog(MultiTableEntityPersister.class);
***************
*** 1094,1098 ****
}
buf.append(" end as ")
! .append( aliasColumn( getDiscriminatorColumnName(), suffix) );
}
--- 1093,1097 ----
}
buf.append(" end as ")
! .append( StringHelper.suffix( getDiscriminatorColumnName(), suffix) );
}
***************
*** 1107,1111 ****
.append( cols[i] )
.append(" as ")
! .append( aliasColumn( subclassColumnClosureAliases[i], suffix) );
}
return buf.toString();
--- 1106,1111 ----
.append( cols[i] )
.append(" as ")
! .append( StringHelper.suffix( subclassColumnClosureAliases[i], suffix) );
!
}
return buf.toString();
|
|
From: <one...@us...> - 2003-01-09 09:40:24
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers
In directory sc8-pr-cvs1:/tmp/cvs-serv8251/cirrus/hibernate/helpers
Modified Files:
ReflectHelper.java StringHelper.java
Log Message:
Mark Woon's patch to limit length of aliases
Index: ReflectHelper.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/ReflectHelper.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** ReflectHelper.java 28 Dec 2002 02:25:49 -0000 1.37
--- ReflectHelper.java 9 Jan 2003 09:40:18 -0000 1.38
***************
*** 15,28 ****
public final class ReflectHelper {
!
private static final Class[] NO_CLASSES = new Class[0];
private static final Class[] OBJECT = new Class[] { Object.class };
private static final Method OBJECT_EQUALS;
!
public static final class Setter {
private Class clazz;
private final Method method;
private final String propertyName;
!
private Setter(Class clazz, Method method, String propertyName) {
this.clazz=clazz;
--- 15,28 ----
public final class ReflectHelper {
!
private static final Class[] NO_CLASSES = new Class[0];
private static final Class[] OBJECT = new Class[] { Object.class };
private static final Method OBJECT_EQUALS;
!
public static final class Setter {
private Class clazz;
private final Method method;
private final String propertyName;
!
private Setter(Class clazz, Method method, String propertyName) {
this.clazz=clazz;
***************
*** 51,65 ****
}
catch (IllegalArgumentException iae) {
! throw new PropertyAccessException(iae, "IllegalArgumentException occurred while calling", true, clazz, propertyName);
}
}
!
}
!
public static final class Getter {
private Class clazz;
private final Method method;
private final String propertyName;
!
private Getter(Class clazz, Method method, String propertyName) {
this.clazz=clazz;
--- 51,70 ----
}
catch (IllegalArgumentException iae) {
! if (value == null) {
! throw new PropertyAccessException(iae, "IllegalArgumentException (null value) occurred while calling", true, clazz, propertyName);
! }
! else {
! throw new PropertyAccessException(iae, "IllegalArgumentException occurred while calling", true, clazz, propertyName);
! }
}
}
!
}
!
public static final class Getter {
private Class clazz;
private final Method method;
private final String propertyName;
!
private Getter(Class clazz, Method method, String propertyName) {
this.clazz=clazz;
***************
*** 67,71 ****
this.propertyName=propertyName;
}
!
public Object get(Object target) throws HibernateException {
try {
--- 72,76 ----
this.propertyName=propertyName;
}
!
public Object get(Object target) throws HibernateException {
try {
***************
*** 83,95 ****
}
}
!
public Class getReturnType() {
return method.getReturnType();
}
!
public Method getMethod() {
return method;
}
!
}
--- 88,100 ----
}
}
!
public Class getReturnType() {
return method.getReturnType();
}
!
public Method getMethod() {
return method;
}
!
}
***************
*** 104,108 ****
OBJECT_EQUALS = eq;
}
!
public static boolean overridesEquals(Class clazz) {
Method equals;
--- 109,113 ----
OBJECT_EQUALS = eq;
}
!
public static boolean overridesEquals(Class clazz) {
Method equals;
***************
*** 115,124 ****
return !OBJECT_EQUALS.equals(equals);
}
!
public static Method getMethod(Class theClass, String methodName) throws PropertyNotFoundException {
!
if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a setter" ); // will be swallowed
!
Method result;
try {
--- 120,129 ----
return !OBJECT_EQUALS.equals(equals);
}
!
public static Method getMethod(Class theClass, String methodName) throws PropertyNotFoundException {
!
if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a setter" ); // will be swallowed
!
Method result;
try {
***************
*** 133,148 ****
}
}
!
if ( !ReflectHelper.isPublic(theClass, result) ) result.setAccessible(true);
return result;
!
}
!
public static Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException {
!
if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a setter" ); // will be swallowed
!
Method result = setter(theClass, propertyName);
!
if(result==null) {
try {
--- 138,153 ----
}
}
!
if ( !ReflectHelper.isPublic(theClass, result) ) result.setAccessible(true);
return result;
!
}
!
public static Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException {
!
if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a setter" ); // will be swallowed
!
Method result = setter(theClass, propertyName);
!
if(result==null) {
try {
***************
*** 157,167 ****
return new Setter(theClass, result, propertyName);
}
!
}
!
private static Method setter(Class theClass, String propertyName) throws PropertyNotFoundException {
!
Class returnType = getGetter(theClass, propertyName).getReturnType();
!
Method[] methods = theClass.getDeclaredMethods();
Method potentialSetter = null;
--- 162,172 ----
return new Setter(theClass, result, propertyName);
}
!
}
!
private static Method setter(Class theClass, String propertyName) throws PropertyNotFoundException {
!
Class returnType = getGetter(theClass, propertyName).getReturnType();
!
Method[] methods = theClass.getDeclaredMethods();
Method potentialSetter = null;
***************
*** 172,176 ****
) {
String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) );
! String testOldMethod = methods[i].getName().substring(3);
if (
( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) &&
--- 177,181 ----
) {
String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) );
! String testOldMethod = methods[i].getName().substring(3);
if (
( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) &&
***************
*** 181,188 ****
}
}
! }
! return potentialSetter;
}
!
public static Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException {
--- 186,193 ----
}
}
! }
! return potentialSetter;
}
!
public static Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException {
***************
*** 190,194 ****
Method result = getter(theClass, propertyName);
!
if(result==null) {
try {
--- 195,199 ----
Method result = getter(theClass, propertyName);
!
if(result==null) {
try {
***************
*** 203,210 ****
return new Getter(theClass, result, propertyName);
}
! }
!
private static Method getter(Class theClass, String propertyName) {
!
Method[] methods = theClass.getDeclaredMethods();
for (int i=0; i<methods.length; i++) {
--- 208,215 ----
return new Getter(theClass, result, propertyName);
}
! }
!
private static Method getter(Class theClass, String propertyName) {
!
Method[] methods = theClass.getDeclaredMethods();
for (int i=0; i<methods.length; i++) {
***************
*** 214,240 ****
// try "get"
if( (methods[i].getName().length() > 3) && methods[i].getName().startsWith("get") ) {
!
String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) );
! String testOldMethod = methods[i].getName().substring(3);
! if(
( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) &&
methods[i].getParameterTypes().length==0
) return methods[i];
!
}
!
// if not "get" then try "is"
if( (methods[i].getName().length() > 2) && methods[i].getName().startsWith("is") ) {
!
String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(2) );
! String testOldMethod = methods[i].getName().substring(2);
! if(
! ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) &&
! methods[i].getParameterTypes().length==0
! ) return methods[i];
}
}
! }
! return null;
}
--- 219,245 ----
// try "get"
if( (methods[i].getName().length() > 3) && methods[i].getName().startsWith("get") ) {
!
String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) );
! String testOldMethod = methods[i].getName().substring(3);
! if(
( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) &&
methods[i].getParameterTypes().length==0
) return methods[i];
!
}
!
// if not "get" then try "is"
if( (methods[i].getName().length() > 2) && methods[i].getName().startsWith("is") ) {
!
String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(2) );
! String testOldMethod = methods[i].getName().substring(2);
! if(
! ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) &&
! methods[i].getParameterTypes().length==0
! ) return methods[i];
}
}
! }
! return null;
}
***************
*** 242,246 ****
return TypeFactory.hueristicType( getGetter(theClass, name).getReturnType().getName() );
}
!
public static Class classForName(String name) throws ClassNotFoundException {
try {
--- 247,251 ----
return TypeFactory.hueristicType( getGetter(theClass, name).getReturnType().getName() );
}
!
public static Class classForName(String name) throws ClassNotFoundException {
try {
***************
*** 251,259 ****
}
}
!
public static boolean isPublic(Class clazz, Member member) {
return Modifier.isPublic( member.getModifiers() ) && Modifier.isPublic( clazz.getModifiers() );
}
!
public static Object getConstantValue(String name) {
Class clazz;
--- 256,264 ----
}
}
!
public static boolean isPublic(Class clazz, Member member) {
return Modifier.isPublic( member.getModifiers() ) && Modifier.isPublic( clazz.getModifiers() );
}
!
public static Object getConstantValue(String name) {
Class clazz;
***************
*** 271,281 ****
}
}
!
public static Constructor getDefaultConstructor(Class clazz) throws PropertyNotFoundException {
!
if (isAbstractClass(clazz)) return null;
!
try {
! Constructor constructor = clazz.getDeclaredConstructor(NO_CLASSES);
if (!isPublic(clazz, constructor)) {
constructor.setAccessible(true);
--- 276,286 ----
}
}
!
public static Constructor getDefaultConstructor(Class clazz) throws PropertyNotFoundException {
!
if (isAbstractClass(clazz)) return null;
!
try {
! Constructor constructor = clazz.getDeclaredConstructor(NO_CLASSES);
if (!isPublic(clazz, constructor)) {
constructor.setAccessible(true);
***************
*** 284,294 ****
} catch (NoSuchMethodException nme) {
throw new PropertyNotFoundException(
! "Object class " + clazz.getName() +
" must declare a default (no-argument) constructor"
);
}
!
}
!
public static boolean isAbstractClass(Class clazz) {
int modifier = clazz.getModifiers();
--- 289,299 ----
} catch (NoSuchMethodException nme) {
throw new PropertyNotFoundException(
! "Object class " + clazz.getName() +
" must declare a default (no-argument) constructor"
);
}
!
}
!
public static boolean isAbstractClass(Class clazz) {
int modifier = clazz.getModifiers();
Index: StringHelper.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/helpers/StringHelper.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** StringHelper.java 31 Oct 2002 14:00:28 -0000 1.17
--- StringHelper.java 9 Jan 2003 09:40:18 -0000 1.18
***************
*** 18,23 ****
return buf.toString();
}
!
!
public static String repeat(String string, int times) {
StringBuffer buf = new StringBuffer( string.length() * times );
--- 18,23 ----
return buf.toString();
}
!
!
public static String repeat(String string, int times) {
StringBuffer buf = new StringBuffer( string.length() * times );
***************
*** 25,30 ****
return buf.toString();
}
!
!
public static String replace(String template, String placeholder, String replacement) {
int loc = template.indexOf(placeholder);
--- 25,30 ----
return buf.toString();
}
!
!
public static String replace(String template, String placeholder, String replacement) {
int loc = template.indexOf(placeholder);
***************
*** 35,47 ****
return new StringBuffer( template.substring(0, loc) )
.append(replacement)
! .append( replace(
! template.substring( loc + placeholder.length() ),
! placeholder,
replacement
) ).toString();
}
}
!
!
public static String replaceOnce(String template, String placeholder, String replacement) {
int loc = template.indexOf(placeholder);
--- 35,47 ----
return new StringBuffer( template.substring(0, loc) )
.append(replacement)
! .append( replace(
! template.substring( loc + placeholder.length() ),
! placeholder,
replacement
) ).toString();
}
}
!
!
public static String replaceOnce(String template, String placeholder, String replacement) {
int loc = template.indexOf(placeholder);
***************
*** 56,61 ****
}
}
!
!
public static String[] split(String seperators, String list) {
StringTokenizer tokens = new StringTokenizer(list, seperators);
--- 56,61 ----
}
}
!
!
public static String[] split(String seperators, String list) {
StringTokenizer tokens = new StringTokenizer(list, seperators);
***************
*** 67,79 ****
return result;
}
!
public static String unqualify(String qualifiedName) {
return unqualify(qualifiedName, ".");
}
!
public static String unqualify(String qualifiedName, String seperator) {
return qualifiedName.substring( qualifiedName.lastIndexOf(seperator) + 1 );
}
!
public static String qualifier(String qualifiedName) {
int loc = qualifiedName.lastIndexOf(".");
--- 67,79 ----
return result;
}
!
public static String unqualify(String qualifiedName) {
return unqualify(qualifiedName, ".");
}
!
public static String unqualify(String qualifiedName, String seperator) {
return qualifiedName.substring( qualifiedName.lastIndexOf(seperator) + 1 );
}
!
public static String qualifier(String qualifiedName) {
int loc = qualifiedName.lastIndexOf(".");
***************
*** 85,89 ****
}
}
!
public static String[] suffix( String[] columns, String suffix) {
if (suffix==null) return columns;
--- 85,89 ----
}
}
!
public static String[] suffix( String[] columns, String suffix) {
if (suffix==null) return columns;
***************
*** 94,109 ****
return qualified;
}
!
! public static String suffix(String table, String suffix) {
! if (suffix==null) return table;
! char quote = table.charAt(0);
! if ( Dialect.QUOTE.indexOf(quote) > -1 ) {
! return table.substring( 0, table.length()-1 ) + suffix + quote;
! }
else {
! return table + suffix;
}
}
!
public static String[] prefix( String[] columns, String prefix) {
if (prefix==null) return columns;
--- 94,129 ----
return qualified;
}
!
! public static String suffix(String name, String suffix) {
!
! if (suffix==null) {
! /*if (name.length() > 20) {
! return name.substring(name.length()-20);
! }
! else {*/
! return name;
! //}
! }
!
! char quote = name.charAt(0);
! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1;
! StringBuffer nameBuffer = new StringBuffer(30);
!
! if (nameEscaped) {
! nameBuffer.append( name.substring(1, name.length()-1) ).append(suffix);
! }
else {
! nameBuffer.append(name).append(suffix);
}
+ if (nameBuffer.length() > 15) {
+ nameBuffer.delete(0, nameBuffer.length()-15);
+ }
+ if (nameEscaped) {
+ nameBuffer.insert(0, quote);
+ nameBuffer.append(quote);
+ }
+ return nameBuffer.toString();
}
!
public static String[] prefix( String[] columns, String prefix) {
if (prefix==null) return columns;
***************
*** 119,128 ****
return (loc<0) ? qualifiedName : qualifiedName.substring(0, loc);
}
!
public static boolean booleanValue(String tfString) {
String trimmed = tfString.trim().toLowerCase();
return trimmed.equals("true") || trimmed.equals("t");
}
!
public static String toString(Object[] array) {
int len = array.length;
--- 139,148 ----
return (loc<0) ? qualifiedName : qualifiedName.substring(0, loc);
}
!
public static boolean booleanValue(String tfString) {
String trimmed = tfString.trim().toLowerCase();
return trimmed.equals("true") || trimmed.equals("t");
}
!
public static String toString(Object[] array) {
int len = array.length;
***************
*** 133,137 ****
return buf.append( array[len-1] ).toString();
}
!
public static String[] multiply(String string, Iterator placeholders, Iterator replacements) {
String[] result = new String[] { string };
--- 153,157 ----
return buf.append( array[len-1] ).toString();
}
!
public static String[] multiply(String string, Iterator placeholders, Iterator replacements) {
String[] result = new String[] { string };
***************
*** 158,162 ****
name;
}
!
public static void unQuoteInPlace(String[] names) {
for ( int i=0; i<names.length; i++ ) names[i] = unQuote( names[i] );
--- 178,182 ----
name;
}
!
public static void unQuoteInPlace(String[] names) {
for ( int i=0; i<names.length; i++ ) names[i] = unQuote( names[i] );
***************
*** 167,170 ****
return unquoted;
}
!
}
--- 187,190 ----
return unquoted;
}
!
}
|
|
From: <one...@us...> - 2003-01-05 02:24:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/lob In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/lob Modified Files: BlobImpl.java ClobImpl.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: BlobImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/lob/BlobImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BlobImpl.java 4 Jan 2003 11:15:29 -0000 1.2 --- BlobImpl.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 92,93 **** --- 92,96 ---- + + + Index: ClobImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/lob/ClobImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClobImpl.java 4 Jan 2003 11:15:29 -0000 1.2 --- ClobImpl.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 110,111 **** --- 110,114 ---- + + + |
|
From: <one...@us...> - 2003-01-05 02:24:01
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/odmg Modified Files: Database.java Implementation.java Name.java OQLQuery.java Transaction.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: Database.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Database.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Database.java 4 Jan 2003 11:15:29 -0000 1.2 --- Database.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 208,209 **** --- 208,212 ---- + + + Index: Implementation.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Implementation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Implementation.java 4 Jan 2003 11:15:30 -0000 1.2 --- Implementation.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 146,147 **** --- 146,150 ---- + + + Index: Name.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Name.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Name.java 4 Jan 2003 11:15:30 -0000 1.2 --- Name.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 2,3 **** --- 2,6 ---- + + + Index: OQLQuery.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/OQLQuery.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OQLQuery.java 4 Jan 2003 11:15:30 -0000 1.2 --- OQLQuery.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 2,3 **** --- 2,6 ---- + + + Index: Transaction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Transaction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Transaction.java 4 Jan 2003 11:15:30 -0000 1.2 --- Transaction.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 2,3 **** --- 2,6 ---- + + + |
|
From: <one...@us...> - 2003-01-05 02:24:00
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/metadata In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/metadata Modified Files: ClassMetadata.java CollectionMetadata.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: ClassMetadata.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/metadata/ClassMetadata.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassMetadata.java 4 Jan 2003 11:15:29 -0000 1.2 --- ClassMetadata.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 87,88 **** --- 87,91 ---- + + + Index: CollectionMetadata.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/metadata/CollectionMetadata.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CollectionMetadata.java 4 Jan 2003 11:15:29 -0000 1.2 --- CollectionMetadata.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 44,45 **** --- 44,48 ---- + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/mapping Modified Files: Array.java Association.java Bag.java Collection.java Column.java Component.java Constraint.java ForeignKey.java Index.java IndexedCollection.java IntegerValue.java List.java ManyToOne.java Map.java OneToMany.java OneToOne.java PersistentClass.java PrimaryKey.java PrimitiveArray.java Property.java RelationalModel.java Root.java RootClass.java Set.java Subclass.java Table.java UniqueKey.java Value.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: Array.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Array.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Array.java 4 Jan 2003 11:15:29 -0000 1.3 --- Array.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 71,72 **** --- 71,75 ---- + + + Index: Association.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Association.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Association.java 4 Jan 2003 11:15:29 -0000 1.3 --- Association.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 49,50 **** --- 49,53 ---- + + + Index: Bag.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Bag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Bag.java 4 Jan 2003 11:15:29 -0000 1.2 --- Bag.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 27,28 **** --- 27,31 ---- + + + Index: Collection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Collection.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Collection.java 4 Jan 2003 11:15:29 -0000 1.5 --- Collection.java 5 Jan 2003 02:11:22 -0000 1.6 *************** *** 228,229 **** --- 228,232 ---- + + + Index: Column.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Column.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Column.java 4 Jan 2003 11:15:29 -0000 1.2 --- Column.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 111,112 **** --- 111,115 ---- + + + Index: Component.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Component.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Component.java 4 Jan 2003 11:15:29 -0000 1.3 --- Component.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 161,162 **** --- 161,165 ---- + + + Index: Constraint.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Constraint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Constraint.java 4 Jan 2003 11:15:29 -0000 1.2 --- Constraint.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 53,54 **** --- 53,57 ---- + + + Index: ForeignKey.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/ForeignKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ForeignKey.java 4 Jan 2003 11:15:29 -0000 1.2 --- ForeignKey.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 57,58 **** --- 57,61 ---- + + + Index: Index.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Index.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Index.java 4 Jan 2003 11:15:29 -0000 1.2 --- Index.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 54,55 **** --- 54,58 ---- + + + Index: IndexedCollection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/IndexedCollection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IndexedCollection.java 4 Jan 2003 11:15:29 -0000 1.2 --- IndexedCollection.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 45,46 **** --- 45,49 ---- + + + Index: IntegerValue.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/IntegerValue.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IntegerValue.java 4 Jan 2003 11:15:29 -0000 1.3 --- IntegerValue.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 25,26 **** --- 25,29 ---- + + + Index: List.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/List.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** List.java 4 Jan 2003 11:15:29 -0000 1.2 --- List.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 45,46 **** --- 45,49 ---- + + + Index: ManyToOne.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/ManyToOne.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ManyToOne.java 4 Jan 2003 11:15:29 -0000 1.3 --- ManyToOne.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 52,53 **** --- 52,56 ---- + + + Index: Map.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Map.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Map.java 4 Jan 2003 11:15:29 -0000 1.4 --- Map.java 5 Jan 2003 02:11:22 -0000 1.5 *************** *** 81,82 **** --- 81,85 ---- + + + Index: OneToMany.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/OneToMany.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OneToMany.java 4 Jan 2003 11:15:29 -0000 1.2 --- OneToMany.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 39,40 **** --- 39,43 ---- + + + Index: OneToOne.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/OneToOne.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OneToOne.java 4 Jan 2003 11:15:29 -0000 1.3 --- OneToOne.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 71,72 **** --- 71,75 ---- + + + Index: PersistentClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PersistentClass.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PersistentClass.java 4 Jan 2003 11:15:29 -0000 1.3 --- PersistentClass.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 193,194 **** --- 193,197 ---- + + + Index: PrimaryKey.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PrimaryKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PrimaryKey.java 4 Jan 2003 11:15:29 -0000 1.2 --- PrimaryKey.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 34,35 **** --- 34,38 ---- + + + Index: PrimitiveArray.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PrimitiveArray.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PrimitiveArray.java 4 Jan 2003 11:15:29 -0000 1.2 --- PrimitiveArray.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 20,21 **** --- 20,24 ---- + + + Index: Property.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Property.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Property.java 4 Jan 2003 11:15:29 -0000 1.2 --- Property.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 88,89 **** --- 88,92 ---- + + + Index: RelationalModel.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/RelationalModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RelationalModel.java 4 Jan 2003 11:15:29 -0000 1.2 --- RelationalModel.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 14,15 **** --- 14,18 ---- + + + Index: Root.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Root.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Root.java 4 Jan 2003 11:15:29 -0000 1.3 --- Root.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 271,272 **** --- 271,275 ---- + + + Index: RootClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/RootClass.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RootClass.java 4 Jan 2003 11:15:29 -0000 1.3 --- RootClass.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 278,279 **** --- 278,282 ---- + + + Index: Set.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Set.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Set.java 4 Jan 2003 11:15:29 -0000 1.2 --- Set.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 90,91 **** --- 90,94 ---- + + + Index: Subclass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Subclass.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Subclass.java 4 Jan 2003 11:15:29 -0000 1.2 --- Subclass.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 179,180 **** --- 179,183 ---- + + + Index: Table.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Table.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Table.java 4 Jan 2003 11:15:29 -0000 1.2 --- Table.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 252,253 **** --- 252,256 ---- + + + Index: UniqueKey.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/UniqueKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UniqueKey.java 4 Jan 2003 11:15:29 -0000 1.2 --- UniqueKey.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 35,36 **** --- 35,39 ---- + + + Index: Value.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Value.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Value.java 4 Jan 2003 11:15:29 -0000 1.3 --- Value.java 5 Jan 2003 02:11:22 -0000 1.4 *************** *** 209,210 **** --- 209,213 ---- + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/persister Modified Files: AbstractEntityPersister.java ClassPersister.java EntityPersister.java Loadable.java MultiTableEntityPersister.java Queryable.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractEntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2 --- AbstractEntityPersister.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 718,719 **** --- 718,722 ---- + + + Index: ClassPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/ClassPersister.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClassPersister.java 4 Jan 2003 11:15:30 -0000 1.2 --- ClassPersister.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 271,272 **** --- 271,275 ---- + + + Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/EntityPersister.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2 --- EntityPersister.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 926,927 **** --- 926,930 ---- + + + Index: Loadable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/Loadable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Loadable.java 4 Jan 2003 11:15:30 -0000 1.2 --- Loadable.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 119,120 **** --- 119,123 ---- + + + Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MultiTableEntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2 --- MultiTableEntityPersister.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 1123,1124 **** --- 1123,1127 ---- + + + Index: Queryable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/Queryable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Queryable.java 4 Jan 2003 11:15:30 -0000 1.2 --- Queryable.java 5 Jan 2003 02:11:22 -0000 1.3 *************** *** 60,61 **** --- 60,64 ---- + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/loader Modified Files: AnsiOuterJoinGenerator.java CollectionInitializer.java CollectionLoader.java EntityLoader.java Loader.java OneToManyLoader.java OracleOuterJoinGenerator.java OuterJoinGenerator.java OuterJoinLoader.java SimpleEntityLoader.java UniqueEntityLoader.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: AnsiOuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/AnsiOuterJoinGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AnsiOuterJoinGenerator.java 4 Jan 2003 11:15:29 -0000 1.2 --- AnsiOuterJoinGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 41,42 **** --- 41,45 ---- + + + Index: CollectionInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CollectionInitializer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CollectionInitializer.java 4 Jan 2003 11:15:29 -0000 1.3 --- CollectionInitializer.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 23,24 **** --- 23,27 ---- + + + Index: CollectionLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CollectionLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CollectionLoader.java 4 Jan 2003 11:15:29 -0000 1.3 --- CollectionLoader.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 79,80 **** --- 79,83 ---- + + + Index: EntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/EntityLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EntityLoader.java 4 Jan 2003 11:15:29 -0000 1.3 --- EntityLoader.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 80,81 **** --- 80,84 ---- + + + Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Loader.java 4 Jan 2003 11:15:29 -0000 1.3 --- Loader.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 547,548 **** --- 547,551 ---- + + + Index: OneToManyLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OneToManyLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OneToManyLoader.java 4 Jan 2003 11:15:29 -0000 1.3 --- OneToManyLoader.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 90,91 **** --- 90,94 ---- + + + Index: OracleOuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OracleOuterJoinGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleOuterJoinGenerator.java 4 Jan 2003 11:15:29 -0000 1.2 --- OracleOuterJoinGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 40,41 **** --- 40,44 ---- + + + Index: OuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OuterJoinGenerator.java 4 Jan 2003 11:15:29 -0000 1.2 --- OuterJoinGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 71,72 **** --- 71,75 ---- + + + Index: OuterJoinLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OuterJoinLoader.java 4 Jan 2003 11:15:29 -0000 1.3 --- OuterJoinLoader.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 310,311 **** --- 310,314 ---- + + + Index: SimpleEntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/SimpleEntityLoader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleEntityLoader.java 4 Jan 2003 11:15:29 -0000 1.3 --- SimpleEntityLoader.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 69,70 **** --- 69,73 ---- + + + Index: UniqueEntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/UniqueEntityLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UniqueEntityLoader.java 4 Jan 2003 11:15:29 -0000 1.2 --- UniqueEntityLoader.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 18,19 **** --- 18,22 ---- + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/id Modified Files: Assigned.java HexGenerator.java HiLoGenerator.java HiLoHexGenerator.java IdentifierGenerationException.java IdentifierGenerator.java LongGenerator.java NativeGenerator.java PersistentIdentifierGenerator.java SequenceGenerator.java SequenceHiLoGenerator.java UUIDGenerator.java UUIDHexGenerator.java UUIDStringGenerator.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: Assigned.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/Assigned.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Assigned.java 4 Jan 2003 11:15:28 -0000 1.2 --- Assigned.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 33,34 **** --- 33,37 ---- + + + Index: HexGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/HexGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HexGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- HexGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 30,31 **** --- 30,34 ---- + + + Index: HiLoGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/HiLoGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HiLoGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- HiLoGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 173,174 **** --- 173,177 ---- + + + Index: HiLoHexGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/HiLoHexGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HiLoHexGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- HiLoHexGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 46,47 **** --- 46,50 ---- + + + Index: IdentifierGenerationException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/IdentifierGenerationException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IdentifierGenerationException.java 4 Jan 2003 11:15:28 -0000 1.2 --- IdentifierGenerationException.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 25,26 **** --- 25,29 ---- + + + Index: IdentifierGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/IdentifierGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IdentifierGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- IdentifierGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 38,39 **** --- 38,42 ---- + + + Index: LongGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/LongGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LongGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- LongGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 39,40 **** --- 39,43 ---- + + + Index: NativeGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/NativeGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NativeGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- NativeGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 57,58 **** --- 57,61 ---- + + + Index: PersistentIdentifierGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/PersistentIdentifierGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PersistentIdentifierGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- PersistentIdentifierGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 40,41 **** --- 40,44 ---- + + + Index: SequenceGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/SequenceGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SequenceGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- SequenceGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 84,85 **** --- 84,88 ---- + + + Index: SequenceHiLoGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/SequenceHiLoGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SequenceHiLoGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- SequenceHiLoGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 59,60 **** --- 59,63 ---- + + + Index: UUIDGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/UUIDGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UUIDGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- UUIDGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 72,73 **** --- 72,76 ---- + + + Index: UUIDHexGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/UUIDHexGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UUIDHexGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- UUIDHexGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 71,72 **** --- 71,75 ---- + + + Index: UUIDStringGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/id/UUIDStringGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UUIDStringGenerator.java 4 Jan 2003 11:15:28 -0000 1.2 --- UUIDStringGenerator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 65,66 **** --- 65,69 ---- + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/impl
Modified Files:
BatcherImpl.java BatchingBatcher.java CacheEntry.java
DatastoreImpl.java FilterImpl.java IteratorImpl.java
NonBatchingBatcher.java QueryImpl.java
ScheduledCollectionAction.java
ScheduledCollectionRecreate.java
ScheduledCollectionRemove.java ScheduledCollectionUpdate.java
ScheduledDeletion.java ScheduledEntityAction.java
ScheduledInsertion.java ScheduledUpdate.java
ScrollableResultsImpl.java SessionFactoryImpl.java
SessionFactoryObjectFactory.java SessionImpl.java
Log Message:
added Session.refresh()
revised some javadoc
new javadoc style consistent with website colors
Index: BatcherImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/BatcherImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BatcherImpl.java 4 Jan 2003 11:15:28 -0000 1.2
--- BatcherImpl.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 119,120 ****
--- 119,123 ----
+
+
+
Index: BatchingBatcher.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/BatchingBatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BatchingBatcher.java 4 Jan 2003 11:15:29 -0000 1.2
--- BatchingBatcher.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 75,76 ****
--- 75,79 ----
+
+
+
Index: CacheEntry.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/CacheEntry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CacheEntry.java 4 Jan 2003 11:15:29 -0000 1.2
--- CacheEntry.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 67,68 ****
--- 67,71 ----
+
+
+
Index: DatastoreImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/DatastoreImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DatastoreImpl.java 4 Jan 2003 11:15:29 -0000 1.2
--- DatastoreImpl.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 408,409 ****
--- 408,412 ----
+
+
+
Index: FilterImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/FilterImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FilterImpl.java 4 Jan 2003 11:15:29 -0000 1.3
--- FilterImpl.java 5 Jan 2003 02:11:21 -0000 1.4
***************
*** 52,53 ****
--- 52,56 ----
+
+
+
Index: IteratorImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/IteratorImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** IteratorImpl.java 4 Jan 2003 11:15:29 -0000 1.2
--- IteratorImpl.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 94,95 ****
--- 94,98 ----
+
+
+
Index: NonBatchingBatcher.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/NonBatchingBatcher.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NonBatchingBatcher.java 4 Jan 2003 11:15:29 -0000 1.2
--- NonBatchingBatcher.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 31,32 ****
--- 31,35 ----
+
+
+
Index: QueryImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/QueryImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** QueryImpl.java 4 Jan 2003 11:15:29 -0000 1.3
--- QueryImpl.java 5 Jan 2003 02:11:21 -0000 1.4
***************
*** 348,349 ****
--- 348,352 ----
+
+
+
Index: ScheduledCollectionAction.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScheduledCollectionAction.java 4 Jan 2003 11:15:29 -0000 1.3
--- ScheduledCollectionAction.java 5 Jan 2003 02:11:21 -0000 1.4
***************
*** 42,43 ****
--- 42,46 ----
+
+
+
Index: ScheduledCollectionRecreate.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionRecreate.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScheduledCollectionRecreate.java 4 Jan 2003 11:15:29 -0000 1.3
--- ScheduledCollectionRecreate.java 5 Jan 2003 02:11:21 -0000 1.4
***************
*** 28,29 ****
--- 28,32 ----
+
+
+
Index: ScheduledCollectionRemove.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionRemove.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScheduledCollectionRemove.java 4 Jan 2003 11:15:29 -0000 1.3
--- ScheduledCollectionRemove.java 5 Jan 2003 02:11:21 -0000 1.4
***************
*** 25,26 ****
--- 25,29 ----
+
+
+
Index: ScheduledCollectionUpdate.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionUpdate.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ScheduledCollectionUpdate.java 4 Jan 2003 11:15:29 -0000 1.3
--- ScheduledCollectionUpdate.java 5 Jan 2003 02:11:21 -0000 1.4
***************
*** 39,40 ****
--- 39,43 ----
+
+
+
Index: ScheduledDeletion.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledDeletion.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ScheduledDeletion.java 4 Jan 2003 11:15:29 -0000 1.2
--- ScheduledDeletion.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 33,34 ****
--- 33,37 ----
+
+
+
Index: ScheduledEntityAction.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledEntityAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ScheduledEntityAction.java 4 Jan 2003 11:15:29 -0000 1.2
--- ScheduledEntityAction.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 42,43 ****
--- 42,46 ----
+
+
+
Index: ScheduledInsertion.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledInsertion.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ScheduledInsertion.java 4 Jan 2003 11:15:29 -0000 1.2
--- ScheduledInsertion.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 32,33 ****
--- 32,36 ----
+
+
+
Index: ScheduledUpdate.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledUpdate.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ScheduledUpdate.java 4 Jan 2003 11:15:29 -0000 1.2
--- ScheduledUpdate.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 37,38 ****
--- 37,41 ----
+
+
+
Index: ScrollableResultsImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScrollableResultsImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ScrollableResultsImpl.java 4 Jan 2003 11:15:29 -0000 1.2
--- ScrollableResultsImpl.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 256,257 ****
--- 256,260 ----
+
+
+
Index: SessionFactoryImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SessionFactoryImpl.java 4 Jan 2003 11:15:29 -0000 1.3
--- SessionFactoryImpl.java 5 Jan 2003 02:11:21 -0000 1.4
***************
*** 641,642 ****
--- 641,645 ----
+
+
+
Index: SessionFactoryObjectFactory.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryObjectFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SessionFactoryObjectFactory.java 4 Jan 2003 11:15:29 -0000 1.2
--- SessionFactoryObjectFactory.java 5 Jan 2003 02:11:21 -0000 1.3
***************
*** 142,143 ****
--- 142,146 ----
+
+
+
Index: SessionImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SessionImpl.java 4 Jan 2003 11:15:29 -0000 1.5
--- SessionImpl.java 5 Jan 2003 02:11:21 -0000 1.6
***************
*** 440,443 ****
--- 440,446 ----
return entitiesByKey.get(key);
}
+ private Object removeEntity(Key key) {
+ return entitiesByKey.remove(key);
+ }
private EntityEntry addEntry(
***************
*** 460,463 ****
--- 463,470 ----
}
+ private EntityEntry removeEntry(Object object) {
+ return (EntityEntry) entries.remove(object);
+ }
+
private boolean isEntryFor(Object object) {
return entries.containsKey(object);
***************
*** 1168,1175 ****
}
- public void lock(Object object) throws SQLException, HibernateException {
- lock(object, LockMode.UPGRADE);
- }
-
public void lock(Object object, LockMode lockMode) throws SQLException, HibernateException {
--- 1175,1178 ----
***************
*** 1558,1561 ****
--- 1561,1578 ----
}
+ public void refresh(Object object) throws SQLException, HibernateException {
+
+ if (object==null) throw new NullPointerException("attempted to refresh null");
+
+ object = HibernateProxyHelper.unproxy(object, this);
+ EntityEntry e = removeEntry(object);
+
+ if ( !e.existsInDatabase ) throw new HibernateException("this instance does not yet exist as a row in the database");
+
+ removeEntity( new Key(e.id, e.persister) );
+ e.persister.load( e.id, object, LockMode.READ, this);
+ getEntry(object).lockMode = e.lockMode;
+ }
+
public void initializeEntity(Object object) throws HibernateException, SQLException {
***************
*** 2549,2552 ****
--- 2566,2572 ----
}
+
+
+
|
|
From: <one...@us...> - 2003-01-05 02:11:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/jmx Modified Files: HibernateService.java HibernateServiceMBean.java SessionFactoryStub.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: HibernateService.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx/HibernateService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HibernateService.java 4 Jan 2003 11:15:29 -0000 1.2 --- HibernateService.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 190,191 **** --- 190,194 ---- + + + Index: HibernateServiceMBean.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx/HibernateServiceMBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HibernateServiceMBean.java 4 Jan 2003 11:15:29 -0000 1.2 --- HibernateServiceMBean.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 169,170 **** --- 169,173 ---- + + + Index: SessionFactoryStub.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/jmx/SessionFactoryStub.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionFactoryStub.java 4 Jan 2003 11:15:29 -0000 1.2 --- SessionFactoryStub.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 154,155 **** --- 154,158 ---- + + + |
|
From: <one...@us...> - 2003-01-05 02:11:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/engine Modified Files: Batcher.java Cascades.java Key.java Mapping.java RowSelection.java SessionFactoryImplementor.java SessionImplementor.java TypedValue.java Versioning.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: Batcher.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Batcher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Batcher.java 4 Jan 2003 11:15:28 -0000 1.2 --- Batcher.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 64,65 **** --- 64,68 ---- + + + Index: Cascades.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Cascades.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Cascades.java 4 Jan 2003 11:15:28 -0000 1.3 --- Cascades.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 282,283 **** --- 282,286 ---- + + + Index: Key.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Key.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Key.java 4 Jan 2003 11:15:28 -0000 1.3 --- Key.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 53,54 **** --- 53,57 ---- + + + Index: Mapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Mapping.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mapping.java 4 Jan 2003 11:15:28 -0000 1.2 --- Mapping.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 20,21 **** --- 20,24 ---- + + + Index: RowSelection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/RowSelection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RowSelection.java 4 Jan 2003 11:15:28 -0000 1.2 --- RowSelection.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 33,34 **** --- 33,37 ---- + + + Index: SessionFactoryImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionFactoryImplementor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SessionFactoryImplementor.java 4 Jan 2003 11:15:28 -0000 1.3 --- SessionFactoryImplementor.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 102,103 **** --- 102,106 ---- + + + Index: SessionImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionImplementor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SessionImplementor.java 4 Jan 2003 11:15:28 -0000 1.3 --- SessionImplementor.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 172,173 **** --- 172,176 ---- + + + Index: TypedValue.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/TypedValue.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypedValue.java 4 Jan 2003 11:15:28 -0000 1.2 --- TypedValue.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 32,33 **** --- 32,36 ---- + + + Index: Versioning.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Versioning.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Versioning.java 4 Jan 2003 11:15:28 -0000 1.2 --- Versioning.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 73,74 **** --- 73,77 ---- + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/hql Modified Files: ClauseParser.java FilterTranslator.java FromParser.java GroupByParser.java HavingParser.java OrderByParser.java Parser.java ParserHelper.java PathExpressionParser.java PreprocessingParser.java QueryTranslator.java SelectParser.java SelectPathExpressionParser.java WhereParser.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: ClauseParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/ClauseParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClauseParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- ClauseParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 111,112 **** --- 111,115 ---- + + + Index: FilterTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/FilterTranslator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FilterTranslator.java 4 Jan 2003 11:15:28 -0000 1.2 --- FilterTranslator.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 32,33 **** --- 32,36 ---- + + + Index: FromParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/FromParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FromParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- FromParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 74,75 **** --- 74,78 ---- + + + Index: GroupByParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/GroupByParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GroupByParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- GroupByParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 44,45 **** --- 44,48 ---- + + + Index: HavingParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/HavingParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HavingParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- HavingParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 16,17 **** --- 16,20 ---- + + + Index: OrderByParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/OrderByParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OrderByParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- OrderByParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 44,45 **** --- 44,48 ---- + + + Index: Parser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/Parser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Parser.java 4 Jan 2003 11:15:28 -0000 1.2 --- Parser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 20,21 **** --- 20,24 ---- + + + Index: ParserHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/ParserHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ParserHelper.java 4 Jan 2003 11:15:28 -0000 1.2 --- ParserHelper.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 35,36 **** --- 35,39 ---- + + + Index: PathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/PathExpressionParser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PathExpressionParser.java 4 Jan 2003 11:15:28 -0000 1.3 --- PathExpressionParser.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 460,461 **** --- 460,464 ---- + + + Index: PreprocessingParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/PreprocessingParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PreprocessingParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- PreprocessingParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 110,111 **** --- 110,114 ---- + + + Index: QueryTranslator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/QueryTranslator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QueryTranslator.java 4 Jan 2003 11:15:28 -0000 1.3 --- QueryTranslator.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 879,880 **** --- 879,883 ---- + + + Index: SelectParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/SelectParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SelectParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- SelectParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 144,145 **** --- 144,148 ---- + + + Index: SelectPathExpressionParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/SelectPathExpressionParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SelectPathExpressionParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- SelectPathExpressionParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 33,34 **** --- 33,37 ---- + + + Index: WhereParser.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hql/WhereParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WhereParser.java 4 Jan 2003 11:15:28 -0000 1.2 --- WhereParser.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 459,460 **** --- 459,463 ---- + + + |