You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
| 2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
| 2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
| 2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
| 2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
| 2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
| 2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <one...@us...> - 2002-11-14 12:57:40
|
Update of /cvsroot/hibernate/Hibernate In directory usw-pr-cvs1:/tmp/cvs-serv29012 Modified Files: changelog.txt readme.txt Log Message: new doco for 1.2 beta 2 Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.264 retrieving revision 1.265 diff -C2 -d -r1.264 -r1.265 *** changelog.txt 11 Nov 2002 11:30:00 -0000 1.264 --- changelog.txt 14 Nov 2002 12:57:36 -0000 1.265 *************** *** 2,5 **** --- 2,12 ---- =================== + Changes in version 1.2 beta 2 (15.11.2002) + ------------------------------------------ + * support multi-argument SQL functions in queries + * reintroduced deprecated form of update() with slightly altered semantics + * fixed BAD problem in the generated SQL for certain queries + * added OrionTransactionManagerLookup + Changes in version 1.2 beta 1 (11.11.2002) ------------------------------------------ Index: readme.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/readme.txt,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** readme.txt 11 Nov 2002 11:30:00 -0000 1.50 --- readme.txt 14 Nov 2002 12:57:37 -0000 1.51 *************** *** 1,5 **** Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 1.2 beta 1 11 November 2002 Instructions --- 1,5 ---- Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 1.2 beta 2 15 November 2002 Instructions |
|
From: <one...@us...> - 2002-11-14 12:57:40
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/src
In directory usw-pr-cvs1:/tmp/cvs-serv29012/doc/reference/src
Modified Files:
session_configuration.xml
Log Message:
new doco for 1.2 beta 2
Index: session_configuration.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/doc/reference/src/session_configuration.xml,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** session_configuration.xml 27 Oct 2002 03:52:15 -0000 1.22
--- session_configuration.xml 14 Nov 2002 12:57:37 -0000 1.23
***************
*** 489,492 ****
--- 489,494 ----
<member><literal>cirrus.hibernate.transaction.WebSphereTransactionManagerLookup</literal></member>
<member>for WebSphere</member>
+ <member><literal>cirrus.hibernate.transaction.OrionTransactionManagerLookup</literal></member>
+ <member>for Orion</member>
</simplelist>
|
|
From: <one...@us...> - 2002-11-14 12:42:22
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/transaction
In directory usw-pr-cvs1:/tmp/cvs-serv24408/hibernate/transaction
Added Files:
OrionTransactionManagerLookup.java
Log Message:
added OrionTransactionManagerLookup
--- NEW FILE: OrionTransactionManagerLookup.java ---
//$Id: OrionTransactionManagerLookup.java,v 1.1 2002/11/14 12:42:19 oneovthafew Exp $
package cirrus.hibernate.transaction;
public class OrionTransactionManagerLookup
extends JNDITransactionManagerLookup {
/**
* @see cirrus.hibernate.transaction.JNDITransactionManagerLookup#getName()
*/
protected String getName() {
return "java:comp/UserTransaction";
}
}
|
|
From: <one...@us...> - 2002-11-14 12:42:22
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory usw-pr-cvs1:/tmp/cvs-serv24408/hibernate/test
Modified Files:
FooBarTest.java
Log Message:
added OrionTransactionManagerLookup
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v
retrieving revision 1.220
retrieving revision 1.221
diff -C2 -d -r1.220 -r1.221
*** FooBarTest.java 14 Nov 2002 11:28:55 -0000 1.220
--- FooBarTest.java 14 Nov 2002 12:42:19 -0000 1.221
***************
*** 756,759 ****
--- 756,761 ----
s.find( "from foo in class cirrus.hibernate.test.Foo where foo.foo = ?", foo.getFoo(), Hibernate.association(Foo.class) );
+ assertTrue( !s.iterate("from bar in class Bar where bar.string='a string' or bar.string='a string'").hasNext() );
+
iter = s.iterate(
"select foo.component.name, foo.component.importantDates.elements from foo in class cirrus.hibernate.test.Foo where foo.foo.id=?",
|
|
From: <one...@us...> - 2002-11-14 11:28:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory usw-pr-cvs1:/tmp/cvs-serv27942/hibernate/impl
Modified Files:
SessionImpl.java
Log Message:
undeprecated update()
fixed BAD bug in generated SQL from some queries
support multi-argument SQL functions
Index: SessionImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v
retrieving revision 1.150
retrieving revision 1.151
diff -C2 -d -r1.150 -r1.151
*** SessionImpl.java 7 Nov 2002 16:04:08 -0000 1.150
--- SessionImpl.java 14 Nov 2002 11:28:55 -0000 1.151
***************
*** 84,88 ****
private Set nullifiables = new HashSet(); //set of Keys of deleted objects
!
private Interceptor interceptor;
--- 84,88 ----
private Set nullifiables = new HashSet(); //set of Keys of deleted objects
!
private Interceptor interceptor;
[...1076 lines suppressed...]
!
if (filters.length==0) return Collections.EMPTY_LIST.iterator();
!
Iterator result = null;
Iterator[] results = null;
boolean many = filters.length>1;
if (many) results = new Iterator[filters.length];
!
//execute the queries and return all results as a single iterator
for ( int i=0; i<filters.length; i++ ) {
!
result = filters[i].iterate(values, types, selection, namedParams, this);
if ( many ) {
results[i] = result;
}
!
}
!
return many ? new JoinedIterator(results) : result;
|
|
From: <one...@us...> - 2002-11-14 11:28:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/engine
In directory usw-pr-cvs1:/tmp/cvs-serv27942/hibernate/engine
Modified Files:
Cascades.java
Log Message:
undeprecated update()
fixed BAD bug in generated SQL from some queries
support multi-argument SQL functions
Index: Cascades.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/engine/Cascades.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Cascades.java 29 Oct 2002 07:50:40 -0000 1.6
--- Cascades.java 14 Nov 2002 11:28:55 -0000 1.7
***************
*** 79,103 ****
};
- /**
- * @see cirrus.hibernate.Session#update(Object)
- * @deprecated
- */
- public static final CascadingAction ACTION_UPDATE = new CascadingAction() {
- void cascade(Session session, Object child) throws SQLException, HibernateException {
- if (
- !(child instanceof HibernateProxy) ||
- !HibernateProxyHelper.getLazyInitializer( (HibernateProxy) child ).isUninitialized()
- // updates don't cascade to uninitialized proxies
- ) {
- log.trace("cacading to update()");
- session.update(child);
- }
- }
- boolean shouldCascadeCollection(Object collection) {
- return !(collection instanceof PersistentCollection) || ( (PersistentCollection) collection ).wasInitialized();
- // updates don't cascade to uninitialized collections
- }
- };
-
// The types of children to cascade to:
--- 79,82 ----
|
|
From: <one...@us...> - 2002-11-14 11:28:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/query
In directory usw-pr-cvs1:/tmp/cvs-serv27942/hibernate/query
Modified Files:
QueryTranslator.java WhereParser.java
Log Message:
undeprecated update()
fixed BAD bug in generated SQL from some queries
support multi-argument SQL functions
Index: QueryTranslator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/QueryTranslator.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** QueryTranslator.java 5 Nov 2002 15:24:36 -0000 1.42
--- QueryTranslator.java 14 Nov 2002 11:28:55 -0000 1.43
***************
*** 561,566 ****
if ( hasPart1 && hasPart2 ) buf.append(" AND ");
if ( hasPart2 ) buf.append(part2);
! if ( hasPart3 && ( hasPart1 || hasPart2 ) ) buf.append(" AND ");
! if ( hasPart3 ) buf.append(part3);
if ( groupByTokens.size()!=0 ) {
--- 561,569 ----
if ( hasPart1 && hasPart2 ) buf.append(" AND ");
if ( hasPart2 ) buf.append(part2);
! if ( hasPart3 ) {
! if ( hasPart1 || hasPart2 ) buf.append(" AND (");
! buf.append(part3);
! if ( hasPart1 || hasPart2 ) buf.append(')');
! }
if ( groupByTokens.size()!=0 ) {
Index: WhereParser.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/query/WhereParser.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** WhereParser.java 28 Oct 2002 15:41:53 -0000 1.36
--- WhereParser.java 14 Nov 2002 11:28:55 -0000 1.37
***************
*** 44,53 ****
expressionTerminators.add("and");
expressionTerminators.add("or");
! expressionTerminators.add(","); //TODO: is this needed????
expressionTerminators.add(")");
expressionOpeners.add("and");
expressionOpeners.add("or");
! expressionOpeners.add(","); //TODO: is this needed????
expressionOpeners.add("(");
--- 44,53 ----
expressionTerminators.add("and");
expressionTerminators.add("or");
! //expressionTerminators.add(","); //TODO: is this needed????
expressionTerminators.add(")");
expressionOpeners.add("and");
expressionOpeners.add("or");
! //expressionOpeners.add(","); //TODO: is this needed????
expressionOpeners.add("(");
***************
*** 93,97 ****
private boolean betweenSpecialCase = false; //Inside a BETWEEN ... AND ... expression
private boolean isSpecialCase = false; //Inside an IS NULL or IS NOT NULL expression
! private boolean functionSpecialCase = false; //Inside an IN (...,...) expression TODO: is this special case needed now?????
private int bracketsSinceFunction = 0; //How deep inside in IN are we?
--- 93,97 ----
private boolean betweenSpecialCase = false; //Inside a BETWEEN ... AND ... expression
private boolean isSpecialCase = false; //Inside an IS NULL or IS NOT NULL expression
! //private boolean functionSpecialCase = false; //Inside an IN (...,...) expression TODO: is this special case needed now?????
private int bracketsSinceFunction = 0; //How deep inside in IN are we?
***************
*** 223,227 ****
//Close extra brackets we opened
! if ( !functionSpecialCase && !betweenSpecialCase && expressionTerminators.contains(lcToken) ) {
closeExpression(q, lcToken);
}
--- 223,227 ----
//Close extra brackets we opened
! if ( /*!functionSpecialCase &&*/ !betweenSpecialCase && expressionTerminators.contains(lcToken) ) {
closeExpression(q, lcToken);
}
***************
*** 240,244 ****
//Open any extra brackets we might need.
! if ( !functionSpecialCase && !betweenSpecialCase && expressionOpeners.contains(lcToken) ) {
openExpression(q, lcToken);
}
--- 240,244 ----
//Open any extra brackets we might need.
! if ( /*!functionSpecialCase &&*/ !betweenSpecialCase && expressionOpeners.contains(lcToken) ) {
openExpression(q, lcToken);
}
***************
*** 322,326 ****
q.addIdentifierSpace( pathExpressionParser.getCollectionTable() );
closeExpression(q, "");
! if (functionSpecialCase && bracketsSinceFunction==0) functionSpecialCase=false;
}
else {
--- 322,326 ----
q.addIdentifierSpace( pathExpressionParser.getCollectionTable() );
closeExpression(q, "");
! //if (functionSpecialCase && bracketsSinceFunction==0) functionSpecialCase=false;
}
else {
***************
*** 382,391 ****
isSpecialCase = true;
}
! else if ( functions.contains(lcToken) ) {
functionSpecialCase = true;
}
else if ( functionSpecialCase && lcToken.equals("(") ) {
bracketsSinceFunction++;
! }
}
--- 382,391 ----
isSpecialCase = true;
}
! /*else if ( functions.contains(lcToken) ) {
functionSpecialCase = true;
}
else if ( functionSpecialCase && lcToken.equals("(") ) {
bracketsSinceFunction++;
! }*/
}
***************
*** 397,405 ****
isSpecialCase = false;
}
! else if ( functionSpecialCase && lcToken.equals(")") ) {
if ( --bracketsSinceFunction == 0 ) {
functionSpecialCase = false;
}
! }
}
--- 397,405 ----
isSpecialCase = false;
}
! /*else if ( functionSpecialCase && lcToken.equals(")") ) {
if ( --bracketsSinceFunction == 0 ) {
functionSpecialCase = false;
}
! }*/
}
|
|
From: <one...@us...> - 2002-11-14 11:28:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory usw-pr-cvs1:/tmp/cvs-serv27942/hibernate Modified Files: Session.java Log Message: undeprecated update() fixed BAD bug in generated SQL from some queries support multi-argument SQL functions Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Session.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Session.java 5 Nov 2002 16:58:13 -0000 1.78 --- Session.java 14 Nov 2002 11:28:54 -0000 1.79 *************** *** 245,248 **** --- 245,265 ---- /** + * Update the persistent instance with the identifier of the given transient + * instance. If there is a persistent instance with the same identifier, + * an exception is thrown.<br> + * <br> + * If the given transient instance has a <tt>null</tt> identifier, an exception + * will be thrown.<br> + * <br> + * <em>The class may not contain toplevel collections or collections + * with subcollections.</em> + * + * @param object a transient instance containing updated state + * @throws SQLException + * @throws HibernateException + */ + public void update(Object object) throws SQLException, HibernateException; + + /** * Update the persistent state associated with the given identifier. An exception * is thrown if there is a persistent instance with the same identifier in the *************** *** 510,534 **** //DEPRECATED: - /** - * Update the persistent instance with the identifier of the given transient - * instance. If there is a persistent instance with the same identifier, - * an exception is thrown.<br> - * <br> - * If the given transient instance has a <tt>null</tt> identifier, the session - * will <tt>save()</tt> the instance with a generated identifier. This is useful - * used in conjuction with cascading updates to persist a graph of transient - * objects, some of which are newly instantiated.<br> - * <br> - * <em>The class may not contain toplevel collections or collections - * with subcollections.</em> - * - * @deprecated use <literal>saveOrUpdate()</literal>. - * - * @param object a transient instance containing updated state - * @throws SQLException - * @throws HibernateException - */ - public void update(Object object) throws SQLException, HibernateException; - /** * Execute a query, returning only the identifiers. --- 527,530 ---- |
|
From: <one...@us...> - 2002-11-14 11:28:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reverse
In directory usw-pr-cvs1:/tmp/cvs-serv27942/hibernate/tools/reverse
Modified Files:
JDBCUtil.java MapGenerator.java
Log Message:
undeprecated update()
fixed BAD bug in generated SQL from some queries
support multi-argument SQL functions
Index: JDBCUtil.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reverse/JDBCUtil.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** JDBCUtil.java 13 Nov 2002 18:06:51 -0000 1.1
--- JDBCUtil.java 14 Nov 2002 11:28:56 -0000 1.2
***************
*** 89,93 ****
try {
rs = dmd.getTables(catalog, schema, tablePattern, new String[] {"TABLE", "VIEW", "SYNONYM", "ALIAS"} );
- Map map = new HashMap();
List l= new LinkedList();
while (rs.next()) {
--- 89,92 ----
Index: MapGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reverse/MapGenerator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MapGenerator.java 13 Nov 2002 18:06:51 -0000 1.1
--- MapGenerator.java 14 Nov 2002 11:28:56 -0000 1.2
***************
*** 6,10 ****
package cirrus.hibernate.tools.reverse;
- import javax.sql.*;
import java.sql.*;
import org.w3c.dom.*;
--- 6,9 ----
***************
*** 14,18 ****
import org.apache.log4j.*;
import cirrus.hibernate.tools.codegen.*;
- import cirrus.hibernate.type.NullableType;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
--- 13,16 ----
***************
*** 227,231 ****
protected void addId(Element classElement, JDBCUtil.Column pkColumn) {
Document hbm = classElement.getOwnerDocument();
- String tableName = classElement.getAttribute("table");
Element identifierElement = hbm.createElement("id");
--- 225,228 ----
***************
*** 253,257 ****
protected void addCompositeId(Element classElement, Collection primaryKeys, Collection foreignKeys) {
Document hbm = classElement.getOwnerDocument();
- String tableName = classElement.getAttribute("table");
Element identifierElement=hbm.createElement("composite-id");
--- 250,253 ----
***************
*** 286,290 ****
protected void addProperties(Element classElement, Collection pkColumns, Collection fkColumns, Collection columns) {
Document hbm = classElement.getOwnerDocument();
- String tableName = classElement.getAttribute("table");
for (Iterator it = columns.iterator(); it.hasNext();) {
--- 282,285 ----
|
|
From: <one...@us...> - 2002-11-14 11:28:58
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test
In directory usw-pr-cvs1:/tmp/cvs-serv27942/hibernate/test
Modified Files:
FooBarTest.java SQLFunctionsTest.java
Log Message:
undeprecated update()
fixed BAD bug in generated SQL from some queries
support multi-argument SQL functions
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/FooBarTest.java,v
retrieving revision 1.219
retrieving revision 1.220
diff -C2 -d -r1.219 -r1.220
*** FooBarTest.java 7 Nov 2002 11:33:49 -0000 1.219
--- FooBarTest.java 14 Nov 2002 11:28:55 -0000 1.220
***************
*** 218,221 ****
--- 218,224 ----
public void testPersistCollections() throws Exception {
Session s = sessions.openSession();
+
+ assertTrue( s.iterate("select count(*) from b in class Bar").next().equals( new Integer(0) ) );
+
Baz baz = new Baz();
s.save(baz);
***************
*** 698,701 ****
--- 701,713 ----
s.save(foo2);
foo.setFoo(foo2);
+
+ if ( dialect instanceof DB2Dialect) {
+ s.find("from foo in class Foo where lower( foo.foo.string ) = 'foo'");
+ s.find("from foo in class Foo where lower( (foo.foo.string || 'foo') || 'bar' ) = 'foo'");
+ s.find("from foo in class Foo where repeat( (foo.foo.string || 'foo') || 'bar', 2 ) = 'foo'");
+ s.find("from foo in class Bar where foo.foo.integer is not null and repeat( (foo.foo.string || 'foo') || 'bar', (5+5)/2 ) = 'foo'");
+ s.find("from foo in class Bar where foo.foo.integer is not null or repeat( (foo.foo.string || 'foo') || 'bar', (5+5)/2 ) = 'foo'");
+ }
+
List list = s.find("from foo in class cirrus.hibernate.test.Foo where foo.string='osama bin laden' and foo.boolean = true order by foo.string asc, foo.component.count desc");
assertTrue( list.size()==0, "empty query" );
Index: SQLFunctionsTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/SQLFunctionsTest.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** SQLFunctionsTest.java 5 Nov 2002 07:09:14 -0000 1.30
--- SQLFunctionsTest.java 14 Nov 2002 11:28:55 -0000 1.31
***************
*** 6,9 ****
--- 6,10 ----
import cirrus.hibernate.*;
+ import cirrus.hibernate.sql.DB2Dialect;
import cirrus.hibernate.sql.MySQLDialect;
import cirrus.hibernate.sql.SAPDBDialect;
***************
*** 25,28 ****
--- 26,36 ----
simple.setName("Simple 1");
s.save(simple, new Long(10) );
+
+ if ( dialect instanceof DB2Dialect) {
+ s.find("from s in class Simple where repeat('foo', 3) = 'foofoofoo'");
+ s.find("from s in class Simple where repeat(s.name, 3) = 'foofoofoo'");
+ s.find("from s in class Simple where repeat( lower(s.name), 3 + (1-1) / 2) = 'foofoofoo'");
+ }
+
assertTrue(
s.find("from s in class Simple where upper( s.name ) ='SIMPLE 1'").size()==1
***************
*** 37,42 ****
s.find("from s in class Simple where lower( s.name + ' foo' ) ='simple 1 foo'").size()==1
);
! }
!
Simple other = new Simple();
--- 45,49 ----
s.find("from s in class Simple where lower( s.name + ' foo' ) ='simple 1 foo'").size()==1
);
! }
Simple other = new Simple();
|
|
From: <cel...@us...> - 2002-11-13 18:06:54
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reverse
In directory usw-pr-cvs1:/tmp/cvs-serv9096
Added Files:
JDBCUtil.java MapGenerator.java MapGui.java ParamsPanel.java
Log Message:
--- NEW FILE: JDBCUtil.java ---
/*
* JDBCUtil.java
*
* Created on November 9, 2002, 4:27 PM
*/
package cirrus.hibernate.tools.reverse;
import java.sql.*;
import java.util.*;
import cirrus.hibernate.Hibernate;
import cirrus.hibernate.type.NullableType;
import org.apache.log4j.*;
/**
*
* @author Administrator
*/
public class JDBCUtil {
private static Logger logger = Logger.getLogger(JDBCUtil.class);
public static class Column {
public String name;
public int sqlType;
public int sqlColumnLength;
public int sqlDecimalLength;
public boolean sqlNotNull;
public boolean sqlReadOnly;
public NullableType hibernateType;
public Class javaType;
public boolean equals(Object o) {
boolean rv = false;
if (o != null && o instanceof JDBCUtil.Column) {
rv = (name.equals(((JDBCUtil.Column)o).name));
}
return rv;
}
public int hashCode() {
return (name != null) ? name.hashCode() : 0;
}
};
public static List getCatalogs(Connection c) throws SQLException {
DatabaseMetaData dmd = c.getMetaData();
ResultSet rs = null;
try {
rs = dmd.getCatalogs();
List l = new LinkedList();
while (rs.next()) {
l.add(rs.getString(1));
}
return l;
}
finally {
if (rs != null) rs.close();
}
}
public static Map getSchemas(Connection c) throws SQLException {
DatabaseMetaData dmd = c.getMetaData();
ResultSet rs = null;
try {
rs = dmd.getSchemas();
Map map = new HashMap();
List l;
while (rs.next()) {
String schema = rs.getString(1);
String catalog = null;
if (rs.getMetaData().getColumnCount() > 1) {
catalog = rs.getString(2);
};
l = (List)map.get(catalog);
if (l == null) {
l = new LinkedList();
map.put(catalog, l);
}
l.add(schema);
}
return map;
}
finally {
if (rs != null) rs.close();
}
}
public static List getTables(Connection c, String catalog, String schema, String tablePattern) throws SQLException {
logger.debug("catalog='" + catalog + "'");
logger.debug("schema='" + schema + "'");
logger.debug("table='" + tablePattern + "'");
DatabaseMetaData dmd = c.getMetaData();
ResultSet rs = null;
try {
rs = dmd.getTables(catalog, schema, tablePattern, new String[] {"TABLE", "VIEW", "SYNONYM", "ALIAS"} );
Map map = new HashMap();
List l= new LinkedList();
while (rs.next()) {
l.add(rs.getString(3));
}
return l;
}
finally {
if (rs != null) rs.close();
}
}
public static Set getForeignKeyColumns(Connection c, String catalog, String schema, String table) throws SQLException {
logger.debug("catalog='" + catalog + "'");
logger.debug("schema='" + schema + "'");
logger.debug("table='" + table + "'");
DatabaseMetaData dmd = c.getMetaData();
ResultSet rs = null;
try {
rs = dmd.getImportedKeys(catalog, schema, table);
HashSet columns = new HashSet();
while (rs.next()) {
columns.add(rs.getString(8));
}
return columns;
}
finally {
if (rs != null) rs.close();
}
}
public static List getPrimaryKeyColumns(Connection c, String catalog, String schema, String table) throws SQLException {
logger.debug("catalog='" + catalog + "'");
logger.debug("schema='" + schema + "'");
logger.debug("table='" + table + "'");
DatabaseMetaData dmd = c.getMetaData();
ResultSet rs = null;
try {
rs = dmd.getPrimaryKeys(catalog, schema, table);
List pkColumns = new LinkedList();;
while (rs.next()) {
List tmp = getTableColumns(c, catalog, schema, table, rs.getString(4));
Column pkColumn = (Column)tmp.get(0);
pkColumns.add(pkColumn);
}
return pkColumns;
}
finally {
if (rs != null) rs.close();
}
}
public static List getTableColumns(Connection c, String catalog, String schema, String table) throws SQLException {
return getTableColumns(c, catalog, schema, table, null);
}
public static List getTableColumns(Connection c, String catalog, String schema, String table, String columnPattern) throws SQLException {
logger.debug("catalog='" + catalog + "'");
logger.debug("schema='" + schema + "'");
logger.debug("table='" + table + "'");
logger.debug("column='" + columnPattern+ "'");
DatabaseMetaData dmd = c.getMetaData();
ResultSet rs = null;
try {
rs = dmd.getColumns(catalog, schema, table, columnPattern);
List columns = new LinkedList();
while (rs.next()) {
JDBCUtil.Column aCol = new JDBCUtil.Column();
aCol.name = rs.getString(4);
aCol.sqlType = rs.getShort(5);
aCol.sqlColumnLength=rs.getInt(7);
aCol.sqlDecimalLength=rs.getInt(9);
aCol.sqlNotNull = ("NO".equals(rs.getString(18)));
aCol.hibernateType = getHibernateType(
aCol.sqlType,
aCol.sqlColumnLength,
aCol.sqlDecimalLength
);
aCol.javaType = getJavaType(
aCol.sqlType,
aCol.sqlColumnLength,
aCol.sqlDecimalLength
);
columns.add(aCol);
}
return columns;
}
finally {
if (rs != null) rs.close();
}
}
public static NullableType getHibernateType(int sqlType, int columnSize, int decimalDigits) {
logger.debug("sqlType=" + sqlType);
logger.debug("columnSize=" + columnSize);
logger.debug("decimalDigits=" + decimalDigits);
NullableType rv=Hibernate.SERIALIZABLE;
if (sqlType == Types.CHAR || sqlType == Types.VARCHAR) {
rv = Hibernate.STRING;
}
else if (sqlType == Types.FLOAT || sqlType == Types.REAL) {
rv = Hibernate.FLOAT;
}
else if (sqlType == Types.INTEGER) {
rv = Hibernate.INTEGER;
}
else if (sqlType == Types.DOUBLE) {
rv = Hibernate.DOUBLE;
}
else if (sqlType == Types.DATE) {
rv = Hibernate.DATE;
}
else if (sqlType == Types.TIMESTAMP) {
rv = Hibernate.TIMESTAMP;
}
else if (sqlType == Types.TIME) {
rv = Hibernate.TIME;
}
else if (sqlType == Types.BOOLEAN) {
rv = Hibernate.BOOLEAN;
}
else if (sqlType == Types.SMALLINT) {
rv = Hibernate.SHORT;
}
else if (sqlType == Types.BIT) {
rv = Hibernate.BYTE;
}
else if (sqlType == Types.BIGINT) {
rv = Hibernate.LONG;
}
else if (sqlType == Types.NUMERIC || sqlType == Types.DECIMAL) {
if (decimalDigits == 0) {
if (columnSize == 1) {
rv = Hibernate.BYTE;
}
else if (columnSize < 5) {
rv = Hibernate.SHORT;
}
else if (columnSize < 10) {
rv = Hibernate.INTEGER;
}
else {
rv = Hibernate.LONG;
}
}
else {
if (columnSize < 9) {
rv = Hibernate.FLOAT;
}
else {
rv = Hibernate.DOUBLE;
}
}
}
return rv;
}
public static Class getJavaType(int sqlType, int columnSize, int decimalDigits) {
logger.debug("sqlType=" + sqlType);
logger.debug("columnSize=" + columnSize);
logger.debug("decimalDigits=" + decimalDigits);
Class rv=String.class;
if (sqlType == Types.CHAR || sqlType == Types.VARCHAR) {
rv = String.class;
}
else if (sqlType == Types.FLOAT || sqlType == Types.REAL) {
rv = Float.class;
}
else if (sqlType == Types.INTEGER) {
rv = Integer.class;
}
else if (sqlType == Types.DOUBLE) {
rv = Double.class;
}
else if (sqlType == Types.DATE) {
rv = java.util.Date.class;
}
else if (sqlType == Types.TIMESTAMP) {
rv = java.util.Date.class;
}
else if (sqlType == Types.TIME) {
rv = java.util.Date.class;
}
else if (sqlType == Types.BOOLEAN) {
rv = Boolean.class;
}
else if (sqlType == Types.SMALLINT) {
rv = Short.class;
}
else if (sqlType == Types.BIT) {
rv = Byte.class;
}
else if (sqlType == Types.BIGINT) {
rv = Long.class;
}
else if (sqlType == Types.NUMERIC || sqlType == Types.DECIMAL) {
if (decimalDigits == 0) {
if (columnSize == 1) {
rv = Byte.class;
}
else if (columnSize < 5) {
rv = Short.class;
}
else if (columnSize < 10) {
rv = Integer.class;
}
else {
rv = Long.class;
}
}
else {
if (columnSize < 9) {
rv = Float.class;
}
else {
rv = Double.class;
}
}
}
return rv;
}
}
--- NEW FILE: MapGenerator.java ---
/*
* MapGenerator.java
*
* Created on November 1, 2002, 1:50 PM
*/
package cirrus.hibernate.tools.reverse;
import javax.sql.*;
import java.sql.*;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.util.*;
import java.io.*;
import org.apache.log4j.*;
import cirrus.hibernate.tools.codegen.*;
import cirrus.hibernate.type.NullableType;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;
/**
*
* @author Administrator
*/
public class MapGenerator {
private static Logger logger = Logger.getLogger(MapGenerator.class);
private String generator;
private String[] generatorParameters;
private String packageName;
private String catalog;
private String schemaPattern;
private String idType;
private String[] tableTypes=new String[] { "TABLE", "VIEW", "SYNONYM", "ALIAS"};
private File outputDirectory;
private String idName;
private DocumentBuilder docBuilder;
private TransformerFactory tFactory;
private boolean generateSource=true;
private String baseClass;
private org.jdom.input.DOMBuilder jdomBuilder;
private boolean singleMapFile;
private String[] tableNames;
private String mappingFile;
private boolean hibernateTypes;
/** Creates a new instance of MapGenerator */
public MapGenerator() {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
docBuilder = dbf.newDocumentBuilder();
tFactory = TransformerFactory.newInstance();
jdomBuilder = new org.jdom.input.DOMBuilder(false);
}
catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
public void generate(Connection c) throws IOException, SQLException, Exception {
Document d = getMap(c);
writeMapping(d);
generateCode(d);
}
public Document getMap(Connection c) throws IOException, SQLException {
Document hbm = createMappingDoc();
logger.debug("reading tables from database");
String[] tableNames = getTableNames();
for (int i=0; tableNames != null && i < tableNames.length; i++) {
addHibernateClass (
c,
tableNames[i],
hbm.getDocumentElement()
);
}
logger.debug("done reading tables from database");
return hbm;
}
public void generateCode(Document doc) throws Exception {
Map map = new HashMap();
NodeList classes = doc.getElementsByTagName("class");
if (classes == null || classes.getLength() == 0) return;
for (int i=0; i < classes.getLength(); i++) {
Element classElement = (Element)classes.item(i);
ClassMapping cmap=null;
if (getBaseClass() != null) {
ClassName cName = new ClassName();
cName.setFullyQualifiedName(getBaseClass());
cmap = new ClassMapping(cName, jdomBuilder.build(classElement));
}
else cmap = new ClassMapping(jdomBuilder.build(classElement));
map.put(cmap.getCanonicalName(), cmap);
}
// generate source files
Generator g = new Generator();
g.setBaseDirName(getOutputDirectory().getAbsolutePath());
g.generate(map);
}
protected void writeMapping(Document mapping) throws IOException {
java.lang.String pkgName = packageName.replace('.', java.io.File.separatorChar) + File.separatorChar;
File packageDir = new File(outputDirectory, pkgName);
if (!packageDir.exists()) packageDir.mkdirs();
if (isSingleMapFile() ) {
File mappingFile = new File(packageDir, getMappingFile());
FileOutputStream fos = new FileOutputStream(mappingFile);
try {
logger.debug("writing to file " + mappingFile);
writeHbm(mapping, fos);
}
finally {
fos.close();
}
}
else {
NodeList classes = mapping.getElementsByTagName("class");
for (int i=0; i < classes.getLength();i++) {
Element classElement = (Element)classes.item(i);
Document hibDoc = createMappingDoc();
classElement = (Element)hibDoc.importNode(classElement, true);
hibDoc.getDocumentElement().appendChild(classElement);
String fname = makeEntityName(classElement.getAttribute("table")) + ".hbm.xml";
File mappingFile = new File(packageDir, fname);
logger.debug("writing to file " + mappingFile);
FileOutputStream fos = new FileOutputStream(mappingFile);
try {
writeHbm(hibDoc, fos);
}
finally {
fos.close();
}
}
}
}
protected void writeHbm(Node node, OutputStream os) {
try {
// Use a Transformer for output
Transformer transformer = tFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "http://hibernate.sourceforge.net/hibernate-mapping-1.1.dtd");
transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "-//Hibernate/Hibernate Mapping DTD 1.1//EN");
DOMSource source = new DOMSource(node);
StreamResult result = new StreamResult(os);
transformer.transform(source, result);
} catch (TransformerConfigurationException tce) {
logger.error("Transformation configuration error", tce);
throw new RuntimeException(tce.getMessage());
} catch (TransformerException te) {
// Error generated by the parser
logger.error("Transformation error", te);
throw new RuntimeException(te.getMessage());
}
}
protected String getXml(Node node) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
writeNode(node, baos);
baos.close();
return baos.toString();
}
catch (IOException ioe) {
throw new RuntimeException(ioe.getMessage());
}
}
protected void writeNode(Node node, OutputStream os) {
try {
// Use a Transformer for output
Transformer transformer = tFactory.newTransformer();
DOMSource source = new DOMSource(node);
StreamResult result = new StreamResult(os);
transformer.transform(source, result);
} catch (TransformerConfigurationException tce) {
logger.error("Transformation configuration error", tce);
throw new RuntimeException(tce.getMessage());
} catch (TransformerException te) {
// Error generated by the parser
logger.error("Transformation error", te);
throw new RuntimeException(te.getMessage());
}
}
protected Document createMappingDoc() {
Document hbm = docBuilder.newDocument();
Element hibernate = hbm.createElement("hibernate-mapping");
hbm.appendChild(hibernate);
//logger.debug(getXml(hbm));
return hbm;
}
protected void addHibernateClass(Connection c, String tableName, Element mappingElement) throws SQLException {
logger.debug("adding hibernate class for table " + tableName);
Document hbm = mappingElement.getOwnerDocument();
Element classElement = hbm.createElement("class");
String className = getPackageName() + "." + makeEntityName(tableName);
classElement.setAttribute("name", className);
classElement.setAttribute("table", tableName);
if (getSchemaPattern() != null) {
classElement.setAttribute("schema", getSchemaPattern());
}
List pkColumns = JDBCUtil.getPrimaryKeyColumns(c, getCatalog(), getSchemaPattern(), tableName);
Set fkColumns = JDBCUtil.getForeignKeyColumns(c, getCatalog(), getSchemaPattern(), tableName);
List columns = JDBCUtil.getTableColumns(c, getCatalog(), getSchemaPattern(), tableName);
if (pkColumns.size() == 1) {
addId(classElement, (JDBCUtil.Column)pkColumns.iterator().next());
}
else if (pkColumns.size() > 1) {
addCompositeId(classElement, pkColumns, fkColumns);
}
addProperties(classElement, pkColumns, fkColumns, columns);
logger.debug("class element: " + getXml(classElement));
mappingElement.appendChild(classElement);
}
protected void addId(Element classElement, JDBCUtil.Column pkColumn) {
Document hbm = classElement.getOwnerDocument();
String tableName = classElement.getAttribute("table");
Element identifierElement = hbm.createElement("id");
String idName = getIdName();
if (idName == null) {
idName = makeMemberName(pkColumn.name);
}
identifierElement.setAttribute("name", idName);
identifierElement.setAttribute("column", pkColumn.name);
if (getIdType() != null) {
identifierElement.setAttribute("type", getIdType());
}
else {
String type = (isHibernateTypes()) ? pkColumn.hibernateType.getName() : pkColumn.javaType.getName();
identifierElement.setAttribute("type", type);
if (pkColumn.sqlColumnLength > 0) {
identifierElement.setAttribute("length", "" + pkColumn.sqlColumnLength);
}
}
addGenerator(identifierElement);
classElement.appendChild(identifierElement);
}
protected void addCompositeId(Element classElement, Collection primaryKeys, Collection foreignKeys) {
Document hbm = classElement.getOwnerDocument();
String tableName = classElement.getAttribute("table");
Element identifierElement=hbm.createElement("composite-id");
// ciElement.setAttribute("class", getPackageName() + "." + makeEntityName(tableName) + "Key");
//String compositeId = this.getIdName();
//if (compositeId == null) compositeId = makeMemberName(tableName) + "Id";
// ciElement.setAttribute("name", compositeId);
for (Iterator it = primaryKeys.iterator(); it.hasNext();) {
JDBCUtil.Column pkColumn = (JDBCUtil.Column)it.next();
Element property = hbm.createElement("key-property");
property.setAttribute("name", makeMemberName(pkColumn.name));
if (getIdType() != null && foreignKeys.contains(pkColumn)) {
// if the primary key column is also a foreign key, use the
// specified keyType.
property.setAttribute("type", getIdType());
}
else {
property.setAttribute("column", pkColumn.name);
String type = (isHibernateTypes()) ? pkColumn.hibernateType.getName() : pkColumn.javaType.getName();
property.setAttribute("type", type);
if (pkColumn.sqlColumnLength > 0) {
property.setAttribute("length", "" + pkColumn.sqlColumnLength);
}
}
identifierElement.appendChild(property);
}
classElement.appendChild(identifierElement);
}
protected void addProperties(Element classElement, Collection pkColumns, Collection fkColumns, Collection columns) {
Document hbm = classElement.getOwnerDocument();
String tableName = classElement.getAttribute("table");
for (Iterator it = columns.iterator(); it.hasNext();) {
JDBCUtil.Column column = (JDBCUtil.Column)it.next();
if (!pkColumns.contains(column)) {
Element propertyElement = hbm.createElement("property");
propertyElement.setAttribute("name", makeMemberName(column.name));
propertyElement.setAttribute("column", column.name);
if (getIdType() != null && fkColumns.contains(column)) {
propertyElement.setAttribute("type", getIdType());
}
else {
String type = (isHibernateTypes()) ? column.hibernateType.getName() : column.javaType.getName();
propertyElement.setAttribute("type", type);
if (column.sqlColumnLength > 0) {
propertyElement.setAttribute("length", "" + column.sqlColumnLength);
}
}
if (column.sqlNotNull) propertyElement.setAttribute("not-null", "" + column.sqlNotNull);
logger.debug("column info: " + getXml(propertyElement));
classElement.appendChild(propertyElement);
}
}
}
protected void addGenerator(Element idElement) {
Document hbm = idElement.getOwnerDocument();
Element generator = hbm.createElement("generator");
generator.setAttribute("class", getGenerator());
if (generatorParameters != null) {
for (int i=0; i < generatorParameters.length;i++) {
Element param = hbm.createElement("param");
param.appendChild(hbm.createTextNode(generatorParameters[i]));
generator.appendChild(param);
}
}
idElement.appendChild(generator);
}
protected String makeEntityName(String name) {
String tmp = makeMemberName(name);
tmp = tmp.substring(0,1).toUpperCase() + tmp.substring(1);
return tmp;
}
protected String makeMemberName(String name) {
String memberName = name.toLowerCase();
int i;
while ((i = memberName.indexOf('_')) != -1) {
java.lang.String tmp1 = memberName.substring(0, i);
if (i+1 < memberName.length()) {
tmp1 += memberName.substring(i+1, i+2).toUpperCase();
}
if (i+2 < memberName.length()) {
tmp1 += memberName.substring(i+2);
}
memberName = tmp1;
}
return memberName;
}
/** Getter for property schemaPattern.
* @return Value of property schemaPattern.
*/
public java.lang.String getSchemaPattern() {
return schemaPattern;
}
/** Setter for property schemaPattern.
* @param schemaPattern New value of property schemaPattern.
*/
public void setSchemaPattern(java.lang.String schemaPattern) {
this.schemaPattern = schemaPattern;
}
/** Getter for property tablePattern.
* @return Value of property tablePattern.
*/
public java.lang.String[] getTableNames() {
return tableNames;
}
/** Setter for property tablePattern.
* @param tablePattern New value of property tablePattern.
*/
public void setTableNames(java.lang.String[] tableNames) {
this.tableNames = tableNames;
}
/** Getter for property catalog.
* @return Value of property catalog.
*/
public java.lang.String getCatalog() {
return catalog;
}
/** Setter for property catalog.
* @param catalog New value of property catalog.
*/
public void setCatalog(java.lang.String catalog) {
this.catalog = catalog;
}
/** Getter for property tableTypes.
* @return Value of property tableTypes.
*/
public java.lang.String[] getTableTypes() {
return this.tableTypes;
}
/** Setter for property tableTypes.
* @param tableTypes New value of property tableTypes.
*/
public void setTableTypes(java.lang.String[] tableTypes) {
this.tableTypes = tableTypes;
}
/** Getter for property packageName.
* @return Value of property packageName.
*/
public java.lang.String getPackageName() {
return packageName;
}
/** Setter for property packageName.
* @param packageName New value of property packageName.
*/
public void setPackageName(java.lang.String packageName) {
this.packageName = packageName;
}
/** Getter for property outputDirectory.
* @return Value of property outputDirectory.
*/
public java.io.File getOutputDirectory() {
return outputDirectory;
}
/** Setter for property outputDirectory.
* @param outputDirectory New value of property outputDirectory.
*/
public void setOutputDirectory(java.io.File outputDirectory) {
this.outputDirectory = outputDirectory;
if (!outputDirectory.exists() || !outputDirectory.isDirectory()) {
throw new RuntimeException("Invalid directory " + outputDirectory);
}
}
/** Getter for property idName.
* @return Value of property idName.
*/
public java.lang.String getIdName() {
return idName;
}
/** Setter for property idName.
* @param idName New value of property idName.
*/
public void setIdName(java.lang.String idName) {
this.idName = idName;
}
/** Getter for property generator.
* @return Value of property generator.
*/
public java.lang.String getGenerator() {
return generator;
}
/** Setter for property generator.
* @param generator New value of property generator.
*/
public void setGenerator(java.lang.String generator) {
this.generator = generator;
}
/** Getter for property generatorParameters.
* @return Value of property generatorParameters.
*/
public java.lang.String[] getGeneratorParameters() {
return this.generatorParameters;
}
/** Setter for property generatorParameters.
* @param generatorParameters New value of property generatorParameters.
*/
public void setGeneratorParameters(java.lang.String[] generatorParameters) {
this.generatorParameters = generatorParameters;
}
/** Getter for property mappingFile.
* @return Value of property mappingFile.
*/
public java.lang.String getMappingFile() {
return mappingFile;
}
/** Setter for property mappingFile.
* @param mappingFile New value of property mappingFile.
*/
public void setMappingFile(java.lang.String mappingFile) {
this.mappingFile = mappingFile;
}
/** Getter for property idType.
* @return Value of property idType.
*/
public java.lang.String getIdType() {
return idType;
}
/** Setter for property idType.
* @param idType New value of property idType.
*/
public void setIdType(java.lang.String idType) {
this.idType = idType;
}
/** Getter for property baseClass.
* @return Value of property baseClass.
*/
public java.lang.String getBaseClass() {
return baseClass;
}
/** Setter for property baseClass.
* @param baseClass New value of property baseClass.
*/
public void setBaseClass(java.lang.String baseClass) {
this.baseClass = baseClass;
}
/** Getter for property generateSource.
* @return Value of property generateSource.
*/
public boolean isGenerateSource() {
return generateSource;
}
/** Setter for property generateSource.
* @param generateSource New value of property generateSource.
*/
public void setGenerateSource(boolean generateSource) {
this.generateSource = generateSource;
}
/** Getter for property singleMapFile.
* @return Value of property singleMapFile.
*/
public boolean isSingleMapFile() {
return singleMapFile;
}
/** Setter for property singleMapFile.
* @param singleMapFile New value of property singleMapFile.
*/
public void setSingleMapFile(boolean singleMapFile) {
this.singleMapFile = singleMapFile;
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws Exception {
MapGenerator mg = new MapGenerator();
mg.setPackageName("com.mtd");
mg.setSchemaPattern("postgres");
mg.setGenerator("sequence");
mg.setIdType("java.lang.Long");
mg.setGeneratorParameters(new String[] {"fooSequence" });
mg.setOutputDirectory(new File("c:\\temp"));
mg.setMappingFile("test.hbm.xml");
//oracle.jdbc.OracleDriver.class.getName();
org.postgresql.Driver.class.getName();
Connection connection = DriverManager.getConnection("jdbc:postgresql:template1", "postgres", "");
mg.generate(connection);
connection.close();
}
/** Getter for property hibernateTypes.
* @return Value of property hibernateTypes.
*/
public boolean isHibernateTypes() {
return hibernateTypes;
}
/** Setter for property hibernateTypes.
* @param hibernateTypes New value of property hibernateTypes.
*/
public void setHibernateTypes(boolean hibernateTypes) {
this.hibernateTypes = hibernateTypes;
}
}
--- NEW FILE: MapGui.java ---
/*
* MapGui.java
*
* Created on November 4, 2002, 11:01 AM
*/
package cirrus.hibernate.tools.reverse;
import java.sql.*;
import java.io.*;
import javax.swing.*;
import java.util.*;
/**
*
* @author Administrator
*/
public class MapGui extends javax.swing.JApplet {
final static Object[] javaKeyTypes= new String[] {"java.util.Date", "java.lang.Long", "java.lang.String", "java.sql.Timestamp"};
final static Object[] hibernateKeyTypes = new String[] {"date", "long", "string", "timestamp"};
final static int DATE_TYPE=0;
final static int LONG_TYPE=1;
final static int STRING_TYPE=2;
final static int TIMESTAMP_TYPE=3;
DefaultComboBoxModel javaTypesModel = new DefaultComboBoxModel(javaKeyTypes);
DefaultComboBoxModel hibernateTypesModel = new DefaultComboBoxModel(hibernateKeyTypes);
String[] generationParameters;
Map schemas;
/** Creates new form MapGui */
public MapGui() {
initComponents();
keyFieldType.setModel(hibernateTypesModel);
generatorNameItemStateChanged(null);
readState();
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
saveState();
}
}
);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
java.awt.GridBagConstraints gridBagConstraints;
mappingTypeGroup = new javax.swing.ButtonGroup();
buttonGroup1 = new javax.swing.ButtonGroup();
databasePanel = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
catalogName = new javax.swing.JComboBox();
jLabel2 = new javax.swing.JLabel();
schemaName = new javax.swing.JComboBox();
jLabel3 = new javax.swing.JLabel();
tableName = new javax.swing.JTextField();
keyFieldTypeGroup = new javax.swing.ButtonGroup();
tabbedPanel = new javax.swing.JTabbedPane();
connectionPanel = new javax.swing.JPanel();
jLabel6 = new javax.swing.JLabel();
driverClass = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
connectionUrl = new javax.swing.JTextField();
dbUser = new javax.swing.JTextField();
dbPassword = new javax.swing.JPasswordField();
jPanel5 = new javax.swing.JPanel();
tablesPanel = new javax.swing.JPanel();
tableListHolder = new javax.swing.JPanel();
cmdGetTables = new javax.swing.JButton();
tablesScroller = new javax.swing.JScrollPane();
selectedTables = new javax.swing.JList();
mappingPanel = new javax.swing.JPanel();
jLabel11 = new javax.swing.JLabel();
mappingTypePanel = new javax.swing.JPanel();
optionSingleMap = new javax.swing.JRadioButton();
optionTableMap = new javax.swing.JRadioButton();
mappingFile = new javax.swing.JTextField();
jLabel10 = new javax.swing.JLabel();
idFieldName = new javax.swing.JTextField();
Generator = new javax.swing.JLabel();
genPanel = new javax.swing.JPanel();
generatorName = new javax.swing.JComboBox();
cmdParams = new javax.swing.JButton();
jLabel12 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
optionHibernateTypes = new javax.swing.JRadioButton();
optionJavaTypes = new javax.swing.JRadioButton();
keyFieldType = new javax.swing.JComboBox();
jLabel14 = new javax.swing.JLabel();
codePanel = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
packageName = new javax.swing.JTextField();
jLabel13 = new javax.swing.JLabel();
baseClass = new javax.swing.JTextField();
outputPanel = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
outputDirectory = new javax.swing.JTextField();
cmdPickDir = new javax.swing.JButton();
cmdPanel = new javax.swing.JPanel();
cmdGenerate = new javax.swing.JButton();
databasePanel.setLayout(new java.awt.GridBagLayout());
databasePanel.setMinimumSize(new java.awt.Dimension(250, 70));
databasePanel.setPreferredSize(new java.awt.Dimension(250, 75));
jLabel1.setText("Catalog");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
databasePanel.add(jLabel1, gridBagConstraints);
catalogName.setMinimumSize(new java.awt.Dimension(31, 20));
catalogName.setNextFocusableComponent(schemaName);
catalogName.setPreferredSize(new java.awt.Dimension(31, 20));
catalogName.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
catalogNameItemStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10);
databasePanel.add(catalogName, gridBagConstraints);
jLabel2.setText("Schema");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
databasePanel.add(jLabel2, gridBagConstraints);
schemaName.setMinimumSize(new java.awt.Dimension(31, 20));
schemaName.setNextFocusableComponent(tableName);
schemaName.setPreferredSize(new java.awt.Dimension(31, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10);
databasePanel.add(schemaName, gridBagConstraints);
jLabel3.setText("Table Filter");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
databasePanel.add(jLabel3, gridBagConstraints);
tableName.setText("%");
tableName.setNextFocusableComponent(catalogName);
tableName.setPreferredSize(new java.awt.Dimension(200, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 10);
databasePanel.add(tableName, gridBagConstraints);
tabbedPanel.setFont(new java.awt.Font("Dialog", 1, 11));
tabbedPanel.setPreferredSize(new java.awt.Dimension(430, 240));
connectionPanel.setLayout(new java.awt.GridBagLayout());
jLabel6.setText("Driver Class");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
connectionPanel.add(jLabel6, gridBagConstraints);
driverClass.setText("oracle.jdbc.OracleDriver");
driverClass.setNextFocusableComponent(connectionUrl);
driverClass.setPreferredSize(new java.awt.Dimension(200, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
connectionPanel.add(driverClass, gridBagConstraints);
jLabel7.setText("Connection URL");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
connectionPanel.add(jLabel7, gridBagConstraints);
jLabel8.setText("Username");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
connectionPanel.add(jLabel8, gridBagConstraints);
jLabel9.setText("Password");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
connectionPanel.add(jLabel9, gridBagConstraints);
connectionUrl.setText("jdbc:oracle:thin:@host:port:dbi");
connectionUrl.setNextFocusableComponent(dbUser);
connectionUrl.setPreferredSize(new java.awt.Dimension(200, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
connectionPanel.add(connectionUrl, gridBagConstraints);
dbUser.setNextFocusableComponent(dbPassword);
dbUser.setPreferredSize(new java.awt.Dimension(200, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
connectionPanel.add(dbUser, gridBagConstraints);
dbPassword.setNextFocusableComponent(driverClass);
dbPassword.setPreferredSize(new java.awt.Dimension(200, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
connectionPanel.add(dbPassword, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridwidth = 2;
connectionPanel.add(jPanel5, gridBagConstraints);
tabbedPanel.addTab("Connection", connectionPanel);
tablesPanel.setLayout(new java.awt.BorderLayout());
tableListHolder.setLayout(new java.awt.GridBagLayout());
cmdGetTables.setFont(new java.awt.Font("Dialog", 0, 12));
cmdGetTables.setText("tables...");
cmdGetTables.setFocusPainted(false);
cmdGetTables.setMaximumSize(new java.awt.Dimension(150, 26));
cmdGetTables.setMinimumSize(new java.awt.Dimension(80, 20));
cmdGetTables.setPreferredSize(new java.awt.Dimension(85, 20));
cmdGetTables.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdGetTablesActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(5, 10, 0, 10);
tableListHolder.add(cmdGetTables, gridBagConstraints);
selectedTables.setFont(new java.awt.Font("Dialog", 0, 12));
selectedTables.setLayoutOrientation(JList.VERTICAL_WRAP);
selectedTables.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
selectedTablesValueChanged(evt);
}
});
tablesScroller.setViewportView(selectedTables);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 10);
tableListHolder.add(tablesScroller, gridBagConstraints);
tablesPanel.add(tableListHolder, java.awt.BorderLayout.CENTER);
tabbedPanel.addTab("Tables", tablesPanel);
mappingPanel.setLayout(new java.awt.GridBagLayout());
jLabel11.setText("Mapping File");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
mappingPanel.add(jLabel11, gridBagConstraints);
mappingTypePanel.setLayout(new java.awt.GridBagLayout());
mappingTypePanel.setBorder(new javax.swing.border.EtchedBorder());
mappingTypePanel.setMinimumSize(new java.awt.Dimension(184, 55));
optionSingleMap.setFont(new java.awt.Font("Dialog", 0, 12));
optionSingleMap.setText("single map");
mappingTypeGroup.add(optionSingleMap);
optionSingleMap.setMinimumSize(new java.awt.Dimension(87, 20));
optionSingleMap.setNextFocusableComponent(idFieldName);
optionSingleMap.setPreferredSize(new java.awt.Dimension(87, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 2, 2, 0);
mappingTypePanel.add(optionSingleMap, gridBagConstraints);
optionTableMap.setFont(new java.awt.Font("Dialog", 0, 12));
optionTableMap.setSelected(true);
optionTableMap.setText("one map per database table");
mappingTypeGroup.add(optionTableMap);
optionTableMap.setNextFocusableComponent(optionSingleMap);
optionTableMap.setPreferredSize(new java.awt.Dimension(183, 20));
optionTableMap.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
optionTableMapItemStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 0.5;
gridBagConstraints.insets = new java.awt.Insets(2, 2, 0, 2);
mappingTypePanel.add(optionTableMap, gridBagConstraints);
mappingFile.setText("mapping.hbm.xml");
mappingFile.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 0.5;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 2);
mappingTypePanel.add(mappingFile, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
mappingPanel.add(mappingTypePanel, gridBagConstraints);
jLabel10.setText("Key Field Name");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
mappingPanel.add(jLabel10, gridBagConstraints);
idFieldName.setText("id");
idFieldName.setMinimumSize(new java.awt.Dimension(220, 20));
idFieldName.setNextFocusableComponent(generatorName);
idFieldName.setPreferredSize(new java.awt.Dimension(220, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
mappingPanel.add(idFieldName, gridBagConstraints);
Generator.setText("Generator");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
mappingPanel.add(Generator, gridBagConstraints);
genPanel.setLayout(new java.awt.GridBagLayout());
genPanel.setPreferredSize(new java.awt.Dimension(250, 20));
generatorName.setEditable(true);
generatorName.setFont(new java.awt.Font("Dialog", 0, 12));
generatorName.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "uuid.hex", "uuid.string", "vm.long", "vm.hex", "assigned", "native", "sequence", "hilo.long", "hilo.hex", "seqhilo.long" }));
generatorName.setSelectedIndex(6);
generatorName.setNextFocusableComponent(cmdParams);
generatorName.setPreferredSize(new java.awt.Dimension(140, 20));
generatorName.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
generatorNameItemStateChanged(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 1.0;
genPanel.add(generatorName, gridBagConstraints);
cmdParams.setFont(new java.awt.Font("Dialog", 0, 12));
cmdParams.setText("params...");
cmdParams.setNextFocusableComponent(keyFieldType);
cmdParams.setPreferredSize(new java.awt.Dimension(88, 20));
cmdParams.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdParamsActionPerformed(evt);
}
});
genPanel.add(cmdParams, new java.awt.GridBagConstraints());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
mappingPanel.add(genPanel, gridBagConstraints);
jLabel12.setText("Key Field Type");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
mappingPanel.add(jLabel12, gridBagConstraints);
jPanel1.setLayout(new java.awt.GridBagLayout());
jPanel1.setBorder(new javax.swing.border.EtchedBorder());
optionHibernateTypes.setFont(new java.awt.Font("Dialog", 0, 12));
optionHibernateTypes.setSelected(true);
optionHibernateTypes.setText("use Hibernate types");
keyFieldTypeGroup.add(optionHibernateTypes);
optionHibernateTypes.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
optionHibernateTypesItemStateChanged(evt);
}
});
jPanel1.add(optionHibernateTypes, new java.awt.GridBagConstraints());
optionJavaTypes.setFont(new java.awt.Font("Dialog", 0, 12));
optionJavaTypes.setText("use Java types");
keyFieldTypeGroup.add(optionJavaTypes);
jPanel1.add(optionJavaTypes, new java.awt.GridBagConstraints());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
mappingPanel.add(jPanel1, gridBagConstraints);
keyFieldType.setFont(new java.awt.Font("Dialog", 0, 12));
keyFieldType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "date", "integer", "long", "string", "timestamp" }));
keyFieldType.setSelectedIndex(2);
keyFieldType.setNextFocusableComponent(optionTableMap);
keyFieldType.setPreferredSize(new java.awt.Dimension(31, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
mappingPanel.add(keyFieldType, gridBagConstraints);
jLabel14.setText("Key Field Class");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
mappingPanel.add(jLabel14, gridBagConstraints);
tabbedPanel.addTab("Mapping", mappingPanel);
codePanel.setLayout(new java.awt.GridBagLayout());
codePanel.setMinimumSize(new java.awt.Dimension(350, 112));
codePanel.setPreferredSize(new java.awt.Dimension(350, 150));
jLabel4.setText("Package Name");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
codePanel.add(jLabel4, gridBagConstraints);
packageName.setNextFocusableComponent(baseClass);
packageName.setPreferredSize(new java.awt.Dimension(220, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
codePanel.add(packageName, gridBagConstraints);
jLabel13.setText("Base Class Name");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
codePanel.add(jLabel13, gridBagConstraints);
baseClass.setNextFocusableComponent(packageName);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
codePanel.add(baseClass, gridBagConstraints);
tabbedPanel.addTab("Code", codePanel);
outputPanel.setLayout(new java.awt.GridBagLayout());
jLabel5.setText("Output Directory");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
outputPanel.add(jLabel5, gridBagConstraints);
outputDirectory.setEditable(false);
outputDirectory.setText("c:\\temp");
outputDirectory.setPreferredSize(new java.awt.Dimension(100, 20));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 0.1;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
outputPanel.add(outputDirectory, gridBagConstraints);
cmdPickDir.setFont(new java.awt.Font("Dialog", 0, 12));
cmdPickDir.setText("pick...");
cmdPickDir.setPreferredSize(new java.awt.Dimension(80, 20));
cmdPickDir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdPickDirActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 10);
outputPanel.add(cmdPickDir, gridBagConstraints);
tabbedPanel.addTab("Output", outputPanel);
getContentPane().add(tabbedPanel, java.awt.BorderLayout.CENTER);
cmdGenerate.setText("Generate");
cmdGenerate.setEnabled(false);
cmdGenerate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdGenerateActionPerformed(evt);
}
});
cmdPanel.add(cmdGenerate);
getContentPane().add(cmdPanel, java.awt.BorderLayout.SOUTH);
}//GEN-END:initComponents
private void optionHibernateTypesItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_optionHibernateTypesItemStateChanged
// Add your handling code here:
int selectedIndex = keyFieldType.getSelectedIndex();
if (optionHibernateTypes.isSelected()) {
keyFieldType.setModel(hibernateTypesModel);
}
else {
keyFieldType.setModel(javaTypesModel);
}
keyFieldType.setSelectedIndex(selectedIndex); // Add your handling code here:
}//GEN-LAST:event_optionHibernateTypesItemStateChanged
private void catalogNameItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_catalogNameItemStateChanged
// Add your handling code here:
List tmp = (List)schemas.get(catalogName.getSelectedItem());
Object[] schemaArr = (tmp != null) ? tmp.toArray() : new Object[0];
DefaultComboBoxModel dcbm = new DefaultComboBoxModel(schemaArr);
schemaName.setModel(dcbm);
schemaName.setSelectedItem(dbUser.getText());
}//GEN-LAST:event_catalogNameItemStateChanged
private void cmdGetTablesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdGetTablesActionPerformed
// Add your handling code here:
try {
Connection c = null;
try {
c = getConnection();
DefaultComboBoxModel dcbm = new DefaultComboBoxModel(JDBCUtil.getCatalogs(c).toArray());
catalogName.setModel(dcbm);
schemas = JDBCUtil.getSchemas(c);
List tmp = (List)schemas.get(catalogName.getSelectedItem());
Object[] schemaArr = (tmp != null) ? tmp.toArray() : new Object[0];
dcbm = new DefaultComboBoxModel(schemaArr);
Object prevItem = schemaName.getSelectedItem();
schemaName.setModel(dcbm);
if (prevItem == null) schemaName.setSelectedItem(dbUser.getText());
JOptionPane.showMessageDialog(this, databasePanel, "Select Table Criteria", JOptionPane.QUESTION_MESSAGE);
List tables = JDBCUtil.getTables(
c,
(String)catalogName.getSelectedItem(),
(String)schemaName.getSelectedItem(),
tableName.getText()
);
dcbm = new DefaultComboBoxModel(tables.toArray());
selectedTables.setModel(dcbm);
}
finally {
if (c != null) c.close();
}
}
catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(this, e);
}
}//GEN-LAST:event_cmdGetTablesActionPerformed
private void selectedTablesValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_selectedTablesValueChanged
// Add your handling code here:
int[] selected = selectedTables.getSelectedIndices();
cmdGenerate.setEnabled(!(selected == null || selected.length == 0));
}//GEN-LAST:event_selectedTablesValueChanged
private void optionTableMapItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_optionTableMapItemStateChanged
// Add your handling code here:
mappingFile.setEnabled(!optionTableMap.isSelected());
}//GEN-LAST:event_optionTableMapItemStateChanged
private void generatorNameItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_generatorNameItemStateChanged
// Add your handling code here:
if (generatorName.getSelectedIndex() != -1) {
String gName = (String)generatorName.getSelectedItem();
if (
gName.equals("vm.long") ||
gName.equals("native") ||
gName.equals("sequence") ||
gName.equals("hilo.long") ||
gName.equals("seqhilo.long")
) {
keyFieldType.setSelectedIndex(LONG_TYPE);
}
else if (
gName.equals("uuid.hex") ||
gName.equals("uuid.string") ||
gName.equals("vm.hex") ||
gName.equals("hilo.hex")
) {
keyFieldType.setSelectedIndex(STRING_TYPE);
}
}
}//GEN-LAST:event_generatorNameItemStateChanged
private void cmdParamsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdParamsActionPerformed
// Add your handling code here:
ParamsPanel paramsPanel = new ParamsPanel();
if (generationParameters != null) paramsPanel.setParameters(generationParameters);
int choice =JOptionPane.showConfirmDialog(this, paramsPanel, "Generation Parameters", JOptionPane.OK_CANCEL_OPTION);
if (choice == JOptionPane.OK_OPTION) {
this.generationParameters = paramsPanel.getParameters();
}
}//GEN-LAST:event_cmdParamsActionPerformed
private void cmdGenerateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdGenerateActionPerformed
// Add your handling code here:
Connection connection=null;
try {
MapGenerator mg = new MapGenerator();
String cat = (String)catalogName.getSelectedItem();
if (cat != null && cat.length() > 0) mg.setCatalog(cat);
String schem = (String)schemaName.getSelectedItem();
if (schem != null && schem.length() > 0) mg.setSchemaPattern(schem);
Object[] otables = selectedTables.getSelectedValues();
if (otables != null && otables.length > 0) {
String[] tables = (String[])Arrays.asList(otables).toArray(new String[0]);
mg.setTableNames(tables...
[truncated message content] |
|
From: <cel...@us...> - 2002-11-13 18:04:56
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reverse In directory usw-pr-cvs1:/tmp/cvs-serv7872/reverse Log Message: Directory /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reverse added to the repository |
|
From: <one...@us...> - 2002-11-11 23:57:19
|
Update of /cvsroot/hibernate/Hibernate/doc In directory usw-pr-cvs1:/tmp/cvs-serv24731/doc Modified Files: features.aft features.html Log Message: minor doco changes Index: features.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/features.aft,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** features.aft 5 Nov 2002 13:40:53 -0000 1.28 --- features.aft 11 Nov 2002 23:57:13 -0000 1.29 *************** *** 11,14 **** --- 11,17 ---- [Support for extensive subset of Java collections API] |Map|, |Set|, |List|, |SortedMap|, |SortedSet|, arrays including primitive arrays, |Collection| [Collection instance management] Collection rows are garbage collected when dereferenced and moved between tables if a collection changes roles + [Extensible type system] powerful, innovative model of persistence types + * supports user-defined types + * includes built-in support for a rich subset of JDK types including |Currency|, |Locale|, |BigDecimal|, etc. **Object-oriented query language *************** *** 70,74 **** [Support for application assigned identifiers] [Support for composite keys] - [Extensible type system] supports user-defined types **Object / relational mapping documents --- 73,76 ---- Index: features.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/features.html,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** features.html 5 Nov 2002 13:40:53 -0000 1.48 --- features.html 11 Nov 2002 23:57:13 -0000 1.49 *************** *** 25,29 **** --- 25,34 ---- <dt><strong>Support for extensive subset of Java collections API</strong><dd> <tt>Map</tt>, <tt>Set</tt>, <tt>List</tt>, <tt>SortedMap</tt>, <tt>SortedSet</tt>, arrays including primitive arrays, <tt>Collection</tt></dd></dt> <dt><strong>Collection instance management</strong><dd> Collection rows are garbage collected when dereferenced and moved between tables if a collection changes roles</dd></dt> + <dt><strong>Extensible type system</strong><dd> powerful, innovative model of persistence types</dd></dt> </dl> + <ul> + <li> supports user-defined types</li> + <li> includes built-in support for a rich subset of JDK types including <tt>Currency</tt>, <tt>Locale</tt>, <tt>BigDecimal</tt>, etc.</li> + </ul> <!--End Section 2--> <h3><a name="Object-oriented query language">Object-oriented query language</a></h3> *************** *** 112,116 **** <dt><strong>Support for application assigned identifiers</strong><dd></dd></dt> <dt><strong>Support for composite keys</strong><dd></dd></dt> - <dt><strong>Extensible type system</strong><dd> supports user-defined types</dd></dt> </dl> <!--End Section 2--> --- 117,120 ---- |
|
From: <one...@us...> - 2002-11-11 16:04:59
|
Update of /cvsroot/hibernate/Hibernate/doc In directory usw-pr-cvs1:/tmp/cvs-serv1425/doc Modified Files: brief.aft brief.html dtd.aft dtd.html hibernate.html Log Message: 1.2 beta 1 Index: brief.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/brief.aft,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** brief.aft 14 Sep 2002 11:48:55 -0000 1.13 --- brief.aft 11 Nov 2002 16:04:54 -0000 1.14 *************** *** 3,7 **** #---PASS-HTML <img src="logo.jpg" alt="Hibernate"> -------------------------------------------------------------------------- ! ''Hibernate 1.1 is now available for'' #---PASS-HTML <a href="http://sourceforge.net/project/showfiles.php?group_id=40712"> ''download'' --- 3,7 ---- #---PASS-HTML <img src="logo.jpg" alt="Hibernate"> -------------------------------------------------------------------------- ! ''Hibernate 1.2 beta is now available for'' #---PASS-HTML <a href="http://sourceforge.net/project/showfiles.php?group_id=40712"> ''download'' Index: brief.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/brief.html,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** brief.html 5 Nov 2002 08:03:58 -0000 1.54 --- brief.html 11 Nov 2002 16:04:54 -0000 1.55 *************** *** 16,20 **** <img src="logo.jpg" alt="Hibernate"><hr> <p class="Body"> ! <em>Hibernate 1.1 is now available for</em> <a href="http://sourceforge.net/project/showfiles.php?group_id=40712"><em>download</em> </a><hr> --- 16,20 ---- <img src="logo.jpg" alt="Hibernate"><hr> <p class="Body"> ! <em>Hibernate 1.2 beta is now available for</em> <a href="http://sourceforge.net/project/showfiles.php?group_id=40712"><em>download</em> </a><hr> Index: dtd.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/dtd.aft,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dtd.aft 22 Oct 2002 20:22:16 -0000 1.9 --- dtd.aft 11 Nov 2002 16:04:55 -0000 1.10 *************** *** 5,15 **** <?xml version='1.0' encoding='utf-8'?> ! <!-- Hibernate Mapping DTD. ! <!DOCTYPE hibernate-mapping PUBLIC ! "-//Hibernate/Hibernate Mapping DTD//EN" ! "http://hibernate.sourceforge.net/hibernate-mapping.dtd"> ! An instance of this XML document may contain mappings for an arbitrary number of classes. The class mappings may contain associations to classes --- 5,15 ---- <?xml version='1.0' encoding='utf-8'?> ! <!-- Hibernate Mapping DTD. ! <!DOCTYPE hibernate-mapping PUBLIC ! "-//Hibernate/Hibernate Mapping DTD 1.1//EN" ! "http://hibernate.sourceforge.net/hibernate-mapping-1.1.dtd"> ! An instance of this XML document may contain mappings for an arbitrary number of classes. The class mappings may contain associations to classes *************** *** 19,27 **** be referenced by later class and collection mappings in the same document. (They must be declared before they are used.) ! --> ! <!-- The document root. --> ! <!ELEMENT hibernate-mapping ( (map|set|list|bag|array|primitive-array)*, --- 19,27 ---- be referenced by later class and collection mappings in the same document. (They must be declared before they are used.) ! --> ! <!-- The document root. --> ! <!ELEMENT hibernate-mapping ( (map|set|list|bag|array|primitive-array)*, *************** *** 29,37 **** query* )> ! <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST hibernate-mapping default-cascade CDATA #IMPLIED> <!-- none|save/update|all, default: none --> ! <!-- Root of an entity class hierarchy. Entities have their own tables. --> ! <!ELEMENT class ( jcs-cache?, --- 29,37 ---- query* )> ! <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! <!-- Root of an entity class hierarchy. Entities have their own tables. --> ! <!ELEMENT class ( jcs-cache?, *************** *** 40,44 **** (version|timestamp)?, (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, ! subclass*, cache? )> --- 40,44 ---- (version|timestamp)?, (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, ! ((subclass*)|(joined-subclass*)), cache? )> *************** *** 47,60 **** <!ATTLIST class schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST class proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! <!ATTLIST class mutable CDATA #IMPLIED> <!-- default: true --> <!ATTLIST class persister CDATA #IMPLIED> <!-- default: cirrus.hibernate.persister.EntityPersister --> ! <!ATTLIST class discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! <!-- Declares the id type, column and generation algorithm for an entity class. If a name attribut is given, the id is exposed to the application through the named property of the class. If not, the id is only exposed to the application through Session.getID()--> ! <!ELEMENT id (column?, generator)> <!ATTLIST id name CDATA #IMPLIED> --- 47,60 ---- <!ATTLIST class schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST class proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! <!ATTLIST class mutable (true|false) "true"> <!ATTLIST class persister CDATA #IMPLIED> <!-- default: cirrus.hibernate.persister.EntityPersister --> ! <!ATTLIST class discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! <!-- Declares the id type, column and generation algorithm for an entity class. If a name attribut is given, the id is exposed to the application through the named property of the class. If not, the id is only exposed to the application through Session.getID()--> ! <!ELEMENT id (column?, generator)> <!ATTLIST id name CDATA #IMPLIED> *************** *** 62,99 **** <!ATTLIST id type CDATA #IMPLIED> <!ATTLIST id length CDATA #IMPLIED> ! <!ATTLIST id unsaved-value CDATA #IMPLIED> <!-- any|none|null|"value", default: any --> ! <!-- A composite key may be modelled by a java class with a property for each key column. The class must implement java.io.Serializable and reimplement equals() and hashCode(). --> ! ! <!ELEMENT composite-id (property+)> <!ATTLIST composite-id class CDATA #IMPLIED> <!ATTLIST composite-id name CDATA #IMPLIED> ! <!ATTLIST composite-id unsaved-value CDATA #IMPLIED> <!-- any|none|null, default: any --> ! <!-- Polymorphic data requires a column holding a class discriminator value. This value is not directly exposed to the application. --> ! <!ELEMENT discriminator (column?)> <!ATTLIST discriminator column CDATA #IMPLIED> <!-- default: "class"|none --> ! <!ATTLIST discriminator type CDATA #IMPLIED> <!-- default: string --> ! <!ATTLIST discriminator length CDATA #IMPLIED> <!-- default: 100 --> ! <!-- Versioned data requires a column holding a version number. This is exposed to the application through a property of the Java class. --> ! <!ELEMENT version EMPTY> <!ATTLIST version name CDATA #REQUIRED> <!ATTLIST version column CDATA #IMPLIED> ! <!ATTLIST version type CDATA #IMPLIED> <!-- default: integer --> ! <!ELEMENT timestamp EMPTY> <!ATTLIST timestamp name CDATA #REQUIRED> <!ATTLIST timestamp column CDATA #IMPLIED> ! <!-- Subclass declarations are nested beneath the root class declaration to achieve polymorphic persistence. --> ! <!ELEMENT subclass ( (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, --- 62,99 ---- <!ATTLIST id type CDATA #IMPLIED> <!ATTLIST id length CDATA #IMPLIED> ! <!ATTLIST id unsaved-value CDATA "any"> <!-- any|none|null|"value" --> ! <!-- A composite key may be modelled by a java class with a property for each key column. The class must implement java.io.Serializable and reimplement equals() and hashCode(). --> ! ! <!ELEMENT composite-id ( (key-property|key-many-to-one)+ )> <!ATTLIST composite-id class CDATA #IMPLIED> <!ATTLIST composite-id name CDATA #IMPLIED> ! <!ATTLIST composite-id unsaved-value (any|none|null) "any"> <!-- default: any --> ! <!-- Polymorphic data requires a column holding a class discriminator value. This value is not directly exposed to the application. --> ! <!ELEMENT discriminator (column?)> <!ATTLIST discriminator column CDATA #IMPLIED> <!-- default: "class"|none --> ! <!ATTLIST discriminator type CDATA "string"> ! <!ATTLIST discriminator length CDATA #IMPLIED> ! <!-- Versioned data requires a column holding a version number. This is exposed to the application through a property of the Java class. --> ! <!ELEMENT version EMPTY> <!ATTLIST version name CDATA #REQUIRED> <!ATTLIST version column CDATA #IMPLIED> ! <!ATTLIST version type CDATA "integer"> ! <!ELEMENT timestamp EMPTY> <!ATTLIST timestamp name CDATA #REQUIRED> <!ATTLIST timestamp column CDATA #IMPLIED> ! <!-- Subclass declarations are nested beneath the root class declaration to achieve polymorphic persistence. --> ! <!ELEMENT subclass ( (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, *************** *** 101,111 **** )> <!ATTLIST subclass name CDATA #REQUIRED> ! <!ATTLIST subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! <!ATTLIST subclass discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! <!-- Property of an entity class or component, component-element, composite-id, etc. JavaBeans style properties are mapped to table columns. --> ! <!ELEMENT property (column*)> <!ATTLIST property name CDATA #REQUIRED> --- 101,122 ---- )> <!ATTLIST subclass name CDATA #REQUIRED> ! <!ATTLIST subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface --> <!ATTLIST subclass discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! ! <!-- Joined subclasses are used for the normalized table-per-subclass mapping strategy --> ! ! <!ELEMENT joined-subclass ( ! key, ! (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, ! joined-subclass* ! )> ! <!ATTLIST joined-subclass name CDATA #REQUIRED> ! <!ATTLIST joined-subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! <!ATTLIST joined-subclass table CDATA #REQUIRED> ! <!ATTLIST joined-subclass schema CDATA #IMPLIED> ! <!-- Property of an entity class or component, component-element, composite-id, etc. JavaBeans style properties are mapped to table columns. --> ! <!ELEMENT property (column*)> <!ATTLIST property name CDATA #REQUIRED> *************** *** 113,144 **** <!ATTLIST property column CDATA #IMPLIED> <!ATTLIST property length CDATA #IMPLIED> ! <!ATTLIST property not-null CDATA #IMPLIED> ! <!ATTLIST property unique CDATA #IMPLIED> ! <!-- Declares an association between two entities (Or from a component, component element, etc. to an entity). --> ! <!ELEMENT many-to-one (column*)> <!ATTLIST many-to-one name CDATA #REQUIRED> <!ATTLIST many-to-one class CDATA #IMPLIED> <!ATTLIST many-to-one column CDATA #IMPLIED> ! <!ATTLIST many-to-one length CDATA #IMPLIED> <!-- DEPRECATED --> ! <!ATTLIST many-to-one not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST many-to-one unique CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST many-to-one cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST many-to-one outer-join CDATA #IMPLIED> <!-- true|false, default to hibernate.use_outer_join --> ! <!-- Declares a one-to-one association between two entities (Or from a component, component element, etc. to an entity). --> ! <!ELEMENT one-to-one EMPTY> <!ATTLIST one-to-one name CDATA #REQUIRED> <!ATTLIST one-to-one class CDATA #IMPLIED> ! <!ATTLIST one-to-one cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST one-to-one outer-join CDATA #IMPLIED> <!-- true|false, default to hibernate.use_outer_join --> ! <!ATTLIST one-to-one constrained CDATA #IMPLIED> <!-- true|false, default: false --> ! <!-- Declared a property that holds instances of a toplevel collection role. --> ! <!ELEMENT collection (column*)> <!ATTLIST collection name CDATA #REQUIRED> --- 124,170 ---- <!ATTLIST property column CDATA #IMPLIED> <!ATTLIST property length CDATA #IMPLIED> ! <!ATTLIST property not-null (true|false) "false"> ! <!ATTLIST property unique (true|false) "false"> ! <!-- Declares an association between two entities (Or from a component, component element, etc. to an entity). --> ! <!ELEMENT many-to-one (column*)> <!ATTLIST many-to-one name CDATA #REQUIRED> <!ATTLIST many-to-one class CDATA #IMPLIED> <!ATTLIST many-to-one column CDATA #IMPLIED> ! <!ATTLIST many-to-one not-null (true|false) "false"> ! <!ATTLIST many-to-one unique (true|false) "false"> ! <!ATTLIST many-to-one cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST many-to-one outer-join (true|false|auto) "auto"> ! <!-- Declares a one-to-one association between two entities (Or from a component, component element, etc. to an entity). --> ! <!ELEMENT one-to-one EMPTY> <!ATTLIST one-to-one name CDATA #REQUIRED> <!ATTLIST one-to-one class CDATA #IMPLIED> ! <!ATTLIST one-to-one cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST one-to-one outer-join (true|false|auto) "auto"> ! <!ATTLIST one-to-one constrained (true|false) "false"> ! ! <!-- A property embedded in a composite identifier or map index (always not-null). --> ! ! <!ELEMENT key-property (column*)> ! <!ATTLIST key-property name CDATA #REQUIRED> ! <!ATTLIST key-property type CDATA #IMPLIED> ! <!ATTLIST key-property column CDATA #IMPLIED> ! <!ATTLIST key-property length CDATA #IMPLIED> ! ! <!-- A many-to-one association embedded in a composite identifier or map index ! (always not-null, never cascade). --> ! ! <!ELEMENT key-many-to-one (column*)> ! <!ATTLIST key-many-to-one name CDATA #REQUIRED> ! <!ATTLIST key-many-to-one class CDATA #IMPLIED> ! <!ATTLIST key-many-to-one column CDATA #IMPLIED> ! <!-- Declared a property that holds instances of a toplevel collection role. --> ! <!ELEMENT collection (column*)> <!ATTLIST collection name CDATA #REQUIRED> *************** *** 146,153 **** <!ATTLIST collection column CDATA #IMPLIED> <!ATTLIST collection length CDATA #IMPLIED> ! <!ATTLIST collection not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST collection unique CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST collection cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are --- 172,179 ---- <!ATTLIST collection column CDATA #IMPLIED> <!ATTLIST collection length CDATA #IMPLIED> ! <!ATTLIST collection not-null (true|false) "false"> ! <!ATTLIST collection unique (true|false) "false"> ! <!ATTLIST collection cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are *************** *** 155,165 **** is mapped to null values in all columns and vice versa. Components do not support shared reference semantics. --> ! ! <!ELEMENT component ( (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> <!ATTLIST component name CDATA #REQUIRED> ! <!-- Collection roles declared directly beneath the root element have their own key and may be referenced by many collection or subcollection tags. Collection declarations --- 181,198 ---- is mapped to null values in all columns and vice versa. Components do not support shared reference semantics. --> ! ! <!ELEMENT component ( ! parent?, (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> <!ATTLIST component name CDATA #REQUIRED> ! ! <!-- The parent element maps a property of the component class as a pointer back to ! the owning entity. --> ! ! <!ELEMENT parent EMPTY> ! <!ATTLIST parent name CDATA #REQUIRED> ! <!-- Collection roles declared directly beneath the root element have their own key and may be referenced by many collection or subcollection tags. Collection declarations *************** *** 168,292 **** the role may be an arbitrary string. For nested collections, it must be the name of the property containing the collection. ! Note that the cascade attribute is ignored for toplevel collections. --> ! <!ELEMENT map ( jcs-cache?, ! key, ! index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST map role CDATA #REQUIRED> ! <!ATTLIST map table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST map schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST map lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST map sort CDATA #IMPLIED> <!-- unsorted|natural, default: unsorted --> ! <!ATTLIST map cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST map order-by CDATA #IMPLIED> <!-- default: none --> ! <!ELEMENT set ( jcs-cache?, ! key, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST set role CDATA #REQUIRED> ! <!ATTLIST set table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST set schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST set lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST set sort CDATA #IMPLIED> <!-- unsorted|natural, default: unsorted --> ! <!ATTLIST set readonly CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST set cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST set order-by CDATA #IMPLIED> <!-- default: none --> ! <!ELEMENT bag ( jcs-cache?, ! key, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST bag role CDATA #REQUIRED> ! <!ATTLIST bag table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST bag schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST bag lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST bag readonly CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST bag cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST bag order-by CDATA #IMPLIED> <!-- default: none --> ! <!ELEMENT list ( jcs-cache?, ! key, index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST list role CDATA #REQUIRED> ! <!ATTLIST list table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST list schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST list lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST list cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ELEMENT array ( jcs-cache?, ! key, index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST array role CDATA #REQUIRED> ! <!ATTLIST array table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST array schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST array element-class CDATA #IMPLIED> ! <!ATTLIST array cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ELEMENT primitive-array (jcs-cache?, key, index, element)> <!ATTLIST primitive-array role CDATA #REQUIRED> ! <!ATTLIST primitive-array table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST primitive-array schema CDATA #IMPLIED> <!-- default: none --> ! <!-- Declares the element type of a collection of basic type --> ! <!ELEMENT element (column*)> <!ATTLIST element column CDATA #IMPLIED> <!ATTLIST element type CDATA #REQUIRED> <!ATTLIST element length CDATA #IMPLIED> ! <!ATTLIST element not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST element unique CDATA #IMPLIED> <!-- true|false, default: false --> ! <!-- One to many association. This tag declares the entity-class element type of a collection and specifies a one-to-many relational model --> ! <!ELEMENT one-to-many EMPTY> <!ATTLIST one-to-many class CDATA #REQUIRED> <!-- No column declaration attributes required in this case. The primary key column of the associated class is already mapped elsewhere.--> ! <!-- Many to many association. This tag declares the entity-class element type of a collection and specifies a many-to-many relational model --> ! <!ELEMENT many-to-many (column*)> <!ATTLIST many-to-many class CDATA #REQUIRED> <!ATTLIST many-to-many column CDATA #IMPLIED> ! <!ATTLIST many-to-many length CDATA #IMPLIED> <!-- DEPRECATED --> ! <!ATTLIST many-to-many not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST many-to-many outer-join CDATA #IMPLIED> <!-- true|false, default to hibernate.use_outer_join --> ! <!-- unique makes no sense here since it would mean a one-to-many --> ! <!-- This tag declares that the element type of a collection is a named toplevel collection role. --> ! <!ELEMENT subcollection (column*)> <!ATTLIST subcollection column CDATA #IMPLIED> <!ATTLIST subcollection role CDATA #REQUIRED> <!ATTLIST subcollection length CDATA #IMPLIED> ! <!ATTLIST subcollection not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST subcollection unique CDATA #IMPLIED> <!-- true|false, default: false --> ! <!-- A composite element allows a collection to hold instances of an arbitrary class, without the requirement of joining to an entity table. Composite elements have component semantics - no shared references and ad hoc null value semantics. Composite elements may not hold nested collections. --> ! <!ELEMENT composite-element ( (property|many-to-one|collection|nested-composite-element)* )> <!ATTLIST composite-element class CDATA #REQUIRED> ! <!ELEMENT nested-composite-element ( (property|many-to-one|collection|nested-composite-element)* --- 201,324 ---- the role may be an arbitrary string. For nested collections, it must be the name of the property containing the collection. ! Note that the cascade attribute is ignored for toplevel collections. --> ! <!ELEMENT map ( jcs-cache?, ! (key|generated-key), ! (index|composite-index|index-many-to-many), (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST map role CDATA #REQUIRED> ! <!ATTLIST map table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST map schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST map lazy (true|false) "false"> ! <!ATTLIST map sort CDATA #IMPLIED> <!-- unsorted|natural|"comparator class", default: unsorted --> ! <!ATTLIST map cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST map order-by CDATA #IMPLIED> <!-- default: none --> ! <!ELEMENT set ( jcs-cache?, ! (key|generated-key), (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST set role CDATA #REQUIRED> ! <!ATTLIST set table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST set schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST set lazy (true|false) "false"> ! <!ATTLIST set sort CDATA "unsorted"> <!-- unsorted|natural|"comparator class" --> ! <!ATTLIST set readonly (true|false) "false"> ! <!ATTLIST set cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST set order-by CDATA #IMPLIED> <!-- default: none --> ! <!ELEMENT bag ( jcs-cache?, ! (key|generated-key), (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST bag role CDATA #REQUIRED> ! <!ATTLIST bag table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST bag schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST bag lazy (true|false) "false"> ! <!ATTLIST bag readonly (true|false) "false"> ! <!ATTLIST bag cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST bag order-by CDATA #IMPLIED> <!-- default: none --> ! <!ELEMENT list ( jcs-cache?, ! (key|generated-key), index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST list role CDATA #REQUIRED> ! <!ATTLIST list table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST list schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST list lazy (true|false) "false"> ! <!ATTLIST list cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ELEMENT array ( jcs-cache?, ! (key|generated-key), index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST array role CDATA #REQUIRED> ! <!ATTLIST array table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST array schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST array element-class CDATA #IMPLIED> ! <!ATTLIST array cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ELEMENT primitive-array (jcs-cache?, key, index, element)> <!ATTLIST primitive-array role CDATA #REQUIRED> ! <!ATTLIST primitive-array table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST primitive-array schema CDATA #IMPLIED> <!-- default: none --> ! <!-- Declares the element type of a collection of basic type --> ! <!ELEMENT element (column*)> <!ATTLIST element column CDATA #IMPLIED> <!ATTLIST element type CDATA #REQUIRED> <!ATTLIST element length CDATA #IMPLIED> ! <!ATTLIST element not-null (true|false) "false"> ! <!ATTLIST element unique (true|false) "false"> ! <!-- One to many association. This tag declares the entity-class element type of a collection and specifies a one-to-many relational model --> ! <!ELEMENT one-to-many EMPTY> <!ATTLIST one-to-many class CDATA #REQUIRED> <!-- No column declaration attributes required in this case. The primary key column of the associated class is already mapped elsewhere.--> ! <!-- Many to many association. This tag declares the entity-class element type of a collection and specifies a many-to-many relational model --> ! <!ELEMENT many-to-many (column*)> <!ATTLIST many-to-many class CDATA #REQUIRED> <!ATTLIST many-to-many column CDATA #IMPLIED> ! <!ATTLIST many-to-many not-null (true|false) "false"> ! <!ATTLIST many-to-many outer-join (true|false|auto) "auto"> ! <!-- unique makes no sense here since it would make the association one-to-many --> ! <!-- This tag declares that the element type of a collection is a named toplevel collection role. --> ! <!ELEMENT subcollection (column*)> <!ATTLIST subcollection column CDATA #IMPLIED> <!ATTLIST subcollection role CDATA #REQUIRED> <!ATTLIST subcollection length CDATA #IMPLIED> ! <!ATTLIST subcollection not-null (true|false) "false"> ! <!ATTLIST subcollection unique (true|false) "false"> ! <!-- A composite element allows a collection to hold instances of an arbitrary class, without the requirement of joining to an entity table. Composite elements have component semantics - no shared references and ad hoc null value semantics. Composite elements may not hold nested collections. --> ! <!ELEMENT composite-element ( (property|many-to-one|collection|nested-composite-element)* )> <!ATTLIST composite-element class CDATA #REQUIRED> ! <!ELEMENT nested-composite-element ( (property|many-to-one|collection|nested-composite-element)* *************** *** 294,347 **** <!ATTLIST nested-composite-element class CDATA #REQUIRED> <!ATTLIST nested-composite-element name CDATA #REQUIRED> ! <!-- Declares the type, column name (and, in the case of toplevel collections, an id generation strategy) for the key of a collection table. These keys are never exposed to the application. For toplevel collections, Hibernate makes no guarantee of key stability of a particular collection instance. --> ! ! <!ELEMENT key (generator?, column*)> <!ATTLIST key column CDATA #IMPLIED> - <!ATTLIST key type CDATA #IMPLIED> <!ATTLIST key length CDATA #IMPLIED> ! <!-- Declares the type and column mapping for a collection index (array or list index, or key of a map). --> ! ! <!ELEMENT index (column?)> ! <!ATTLIST index column CDATA #REQUIRED> ! <!ATTLIST index type CDATA #IMPLIED> <!ATTLIST index length CDATA #IMPLIED> ! <!-- Generators generate unique identifiers. The class attribute specifies a Java class implementing an id generation algorithm. --> ! <!ELEMENT generator (param*)> <!ATTLIST generator class CDATA #REQUIRED> <!ELEMENT param (#PCDATA)> ! <!-- The column element is an alternative to column attributes and required for mapping associations to classes with composite ids. --> ! <!ELEMENT column EMPTY> <!ATTLIST column name CDATA #REQUIRED> ! <!ATTLIST column length CDATA #IMPLIED> <!-- default: 255 --> ! <!ATTLIST column not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST column unique CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST column sql-type CDATA #IMPLIED> <!-- override default column type for hibernate type --> <!ATTLIST column index CDATA #IMPLIED> ! <!-- The jcs-cache element enables caching of an entity class. --> <!ELEMENT jcs-cache EMPTY> ! <!ATTLIST jcs-cache usage CDATA #REQUIRED> <!-- read-only | read-write --> ! ! <!-- The cache element enables caching of an entity class. ! semi-deprecated - use a jcs-cache. --> ! <!ELEMENT cache EMPTY> ! <!ATTLIST cache timeout CDATA #IMPLIED> <!-- default: never expire --> ! <!ATTLIST cache impl-class CDATA #IMPLIED> <!-- default: hashbelt --> ! <!ATTLIST cache type CDATA #REQUIRED> <!-- readonly | readwrite --> ! <!-- The query element declares a named Hibernate query string --> ! <!ELEMENT query (#PCDATA)> <!ATTLIST query name CDATA #REQUIRED> --- 326,388 ---- <!ATTLIST nested-composite-element class CDATA #REQUIRED> <!ATTLIST nested-composite-element name CDATA #REQUIRED> ! <!-- Declares the type, column name (and, in the case of toplevel collections, an id generation strategy) for the key of a collection table. These keys are never exposed to the application. For toplevel collections, Hibernate makes no guarantee of key stability of a particular collection instance. --> ! ! <!ELEMENT key (column*)> <!ATTLIST key column CDATA #IMPLIED> <!ATTLIST key length CDATA #IMPLIED> ! ! <!ELEMENT generated-key (generator, column*)> ! <!ATTLIST generated-key column CDATA #IMPLIED> ! <!ATTLIST generated-key type CDATA #REQUIRED> ! <!ATTLIST generated-key length CDATA #IMPLIED> ! <!-- Declares the type and column mapping for a collection index (array or list index, or key of a map). --> ! ! <!ELEMENT index (column*)> ! <!ATTLIST index column CDATA #IMPLIED> ! <!ATTLIST index type CDATA #IMPLIED> <!-- required for maps --> <!ATTLIST index length CDATA #IMPLIED> ! ! <!-- Many to many association mapped to the key of a map. ie. a map keyed ! on entities. --> ! ! <!ELEMENT index-many-to-many (column*)> ! <!ATTLIST index-many-to-many class CDATA #REQUIRED> ! <!ATTLIST index-many-to-many column CDATA #IMPLIED> ! ! <!-- Composite index of a map ie. a map keyed on components. --> ! ! <!ELEMENT composite-index ( (key-property|key-many-to-one)+ )> ! <!ATTLIST composite-index class CDATA #REQUIRED> ! <!-- Generators generate unique identifiers. The class attribute specifies a Java class implementing an id generation algorithm. --> ! <!ELEMENT generator (param*)> <!ATTLIST generator class CDATA #REQUIRED> <!ELEMENT param (#PCDATA)> ! <!-- The column element is an alternative to column attributes and required for mapping associations to classes with composite ids. --> ! <!ELEMENT column EMPTY> <!ATTLIST column name CDATA #REQUIRED> ! <!ATTLIST column length CDATA #IMPLIED> <!-- default: 255 --> ! <!ATTLIST column not-null (true|false) #IMPLIED> <!-- default: false (except for id properties) --> ! <!ATTLIST column unique (true|false) #IMPLIED> <!-- default: false (except for id properties) --> ! <!ATTLIST column sql-type CDATA #IMPLIED> <!-- override default column type for hibernate type --> <!ATTLIST column index CDATA #IMPLIED> ! <!-- The jcs-cache element enables caching of an entity class. --> <!ELEMENT jcs-cache EMPTY> ! <!ATTLIST jcs-cache usage (read-only|read-write) #REQUIRED> ! <!-- The query element declares a named Hibernate query string --> ! <!ELEMENT query (#PCDATA)> <!ATTLIST query name CDATA #REQUIRED> Index: dtd.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/dtd.html,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** dtd.html 5 Nov 2002 08:03:59 -0000 1.21 --- dtd.html 11 Nov 2002 16:04:55 -0000 1.22 *************** *** 19,32 **** <pre> <?xml version='1.0' encoding='utf-8'?> ! </pre> ! <pre> <!-- Hibernate Mapping DTD. ! </pre> ! <pre> <!DOCTYPE hibernate-mapping PUBLIC ! "-//Hibernate/Hibernate Mapping DTD//EN" ! "http://hibernate.sourceforge.net/hibernate-mapping.dtd"> ! </pre> ! <pre> An instance of this XML document may contain mappings for an arbitrary number of classes. The class mappings may contain associations to classes --- 19,29 ---- <pre> <?xml version='1.0' encoding='utf-8'?> ! <!-- Hibernate Mapping DTD. ! <!DOCTYPE hibernate-mapping PUBLIC ! "-//Hibernate/Hibernate Mapping DTD 1.1//EN" ! "http://hibernate.sourceforge.net/hibernate-mapping-1.1.dtd"> ! An instance of this XML document may contain mappings for an arbitrary number of classes. The class mappings may contain associations to classes *************** *** 36,47 **** be referenced by later class and collection mappings in the same document. (They must be declared before they are used.) ! </pre> ! <pre> --> ! </pre> ! <pre> <!-- The document root. --> ! </pre> ! <pre> <!ELEMENT hibernate-mapping ( (map|set|list|bag|array|primitive-array)*, --- 33,41 ---- be referenced by later class and collection mappings in the same document. (They must be declared before they are used.) ! --> ! <!-- The document root. --> ! <!ELEMENT hibernate-mapping ( (map|set|list|bag|array|primitive-array)*, *************** *** 49,59 **** query* )> ! <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST hibernate-mapping default-cascade CDATA #IMPLIED> <!-- none|save/update|all, default: none --> ! </pre> ! <pre> <!-- Root of an entity class hierarchy. Entities have their own tables. --> ! </pre> ! <pre> <!ELEMENT class ( jcs-cache?, --- 43,51 ---- query* )> ! <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! <!-- Root of an entity class hierarchy. Entities have their own tables. --> ! <!ELEMENT class ( jcs-cache?, *************** *** 62,66 **** (version|timestamp)?, (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, ! subclass*, cache? )> --- 54,58 ---- (version|timestamp)?, (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, ! ((subclass*)|(joined-subclass*)), cache? )> *************** *** 69,85 **** <!ATTLIST class schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST class proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! <!ATTLIST class mutable CDATA #IMPLIED> <!-- default: true --> <!ATTLIST class persister CDATA #IMPLIED> <!-- default: cirrus.hibernate.persister.EntityPersister --> ! </pre> ! <pre> <!ATTLIST class discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! </pre> ! <pre> <!-- Declares the id type, column and generation algorithm for an entity class. If a name attribut is given, the id is exposed to the application through the named property of the class. If not, the id is only exposed to the application through Session.getID()--> ! </pre> ! <pre> <!ELEMENT id (column?, generator)> <!ATTLIST id name CDATA #IMPLIED> --- 61,74 ---- <!ATTLIST class schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST class proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! <!ATTLIST class mutable (true|false) "true"> <!ATTLIST class persister CDATA #IMPLIED> <!-- default: cirrus.hibernate.persister.EntityPersister --> ! <!ATTLIST class discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! <!-- Declares the id type, column and generation algorithm for an entity class. If a name attribut is given, the id is exposed to the application through the named property of the class. If not, the id is only exposed to the application through Session.getID()--> ! <!ELEMENT id (column?, generator)> <!ATTLIST id name CDATA #IMPLIED> *************** *** 87,133 **** <!ATTLIST id type CDATA #IMPLIED> <!ATTLIST id length CDATA #IMPLIED> ! <!ATTLIST id unsaved-value CDATA #IMPLIED> <!-- any|none|null|"value", default: any --> ! </pre> ! <pre> <!-- A composite key may be modelled by a java class with a property for each key column. The class must implement java.io.Serializable and reimplement equals() and hashCode(). --> ! </pre> ! <pre> ! <!ELEMENT composite-id (property+)> <!ATTLIST composite-id class CDATA #IMPLIED> <!ATTLIST composite-id name CDATA #IMPLIED> ! <!ATTLIST composite-id unsaved-value CDATA #IMPLIED> <!-- any|none|null, default: any --> ! </pre> ! <pre> <!-- Polymorphic data requires a column holding a class discriminator value. This value is not directly exposed to the application. --> ! </pre> ! <pre> <!ELEMENT discriminator (column?)> <!ATTLIST discriminator column CDATA #IMPLIED> <!-- default: "class"|none --> ! <!ATTLIST discriminator type CDATA #IMPLIED> <!-- default: string --> ! <!ATTLIST discriminator length CDATA #IMPLIED> <!-- default: 100 --> ! </pre> ! <pre> <!-- Versioned data requires a column holding a version number. This is exposed to the application through a property of the Java class. --> ! </pre> ! <pre> <!ELEMENT version EMPTY> <!ATTLIST version name CDATA #REQUIRED> <!ATTLIST version column CDATA #IMPLIED> ! <!ATTLIST version type CDATA #IMPLIED> <!-- default: integer --> ! </pre> ! <pre> <!ELEMENT timestamp EMPTY> <!ATTLIST timestamp name CDATA #REQUIRED> <!ATTLIST timestamp column CDATA #IMPLIED> ! </pre> ! <pre> <!-- Subclass declarations are nested beneath the root class declaration to achieve polymorphic persistence. --> ! </pre> ! <pre> <!ELEMENT subclass ( (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, --- 76,113 ---- <!ATTLIST id type CDATA #IMPLIED> <!ATTLIST id length CDATA #IMPLIED> ! <!ATTLIST id unsaved-value CDATA "any"> <!-- any|none|null|"value" --> ! <!-- A composite key may be modelled by a java class with a property for each key column. The class must implement java.io.Serializable and reimplement equals() and hashCode(). --> ! ! <!ELEMENT composite-id ( (key-property|key-many-to-one)+ )> <!ATTLIST composite-id class CDATA #IMPLIED> <!ATTLIST composite-id name CDATA #IMPLIED> ! <!ATTLIST composite-id unsaved-value (any|none|null) "any"> <!-- default: any --> ! <!-- Polymorphic data requires a column holding a class discriminator value. This value is not directly exposed to the application. --> ! <!ELEMENT discriminator (column?)> <!ATTLIST discriminator column CDATA #IMPLIED> <!-- default: "class"|none --> ! <!ATTLIST discriminator type CDATA "string"> ! <!ATTLIST discriminator length CDATA #IMPLIED> ! <!-- Versioned data requires a column holding a version number. This is exposed to the application through a property of the Java class. --> ! <!ELEMENT version EMPTY> <!ATTLIST version name CDATA #REQUIRED> <!ATTLIST version column CDATA #IMPLIED> ! <!ATTLIST version type CDATA "integer"> ! <!ELEMENT timestamp EMPTY> <!ATTLIST timestamp name CDATA #REQUIRED> <!ATTLIST timestamp column CDATA #IMPLIED> ! <!-- Subclass declarations are nested beneath the root class declaration to achieve polymorphic persistence. --> ! <!ELEMENT subclass ( (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, *************** *** 135,148 **** )> <!ATTLIST subclass name CDATA #REQUIRED> ! <!ATTLIST subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! </pre> ! <pre> <!ATTLIST subclass discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! </pre> ! <pre> <!-- Property of an entity class or component, component-element, composite-id, etc. JavaBeans style properties are mapped to table columns. --> ! </pre> ! <pre> <!ELEMENT property (column*)> <!ATTLIST property name CDATA #REQUIRED> --- 115,136 ---- )> <!ATTLIST subclass name CDATA #REQUIRED> ! <!ATTLIST subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface --> <!ATTLIST subclass discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> ! ! <!-- Joined subclasses are used for the normalized table-per-subclass mapping strategy --> ! ! <!ELEMENT joined-subclass ( ! key, ! (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)*, ! joined-subclass* ! )> ! <!ATTLIST joined-subclass name CDATA #REQUIRED> ! <!ATTLIST joined-subclass proxy CDATA #IMPLIED> <!-- default: no proxy interface --> ! <!ATTLIST joined-subclass table CDATA #REQUIRED> ! <!ATTLIST joined-subclass schema CDATA #IMPLIED> ! <!-- Property of an entity class or component, component-element, composite-id, etc. JavaBeans style properties are mapped to table columns. --> ! <!ELEMENT property (column*)> <!ATTLIST property name CDATA #REQUIRED> *************** *** 150,187 **** <!ATTLIST property column CDATA #IMPLIED> <!ATTLIST property length CDATA #IMPLIED> ! <!ATTLIST property not-null CDATA #IMPLIED> ! <!ATTLIST property unique CDATA #IMPLIED> ! </pre> ! <pre> <!-- Declares an association between two entities (Or from a component, component element, etc. to an entity). --> ! </pre> ! <pre> <!ELEMENT many-to-one (column*)> <!ATTLIST many-to-one name CDATA #REQUIRED> <!ATTLIST many-to-one class CDATA #IMPLIED> <!ATTLIST many-to-one column CDATA #IMPLIED> ! <!ATTLIST many-to-one length CDATA #IMPLIED> <!-- DEPRECATED --> ! <!ATTLIST many-to-one not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST many-to-one unique CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST many-to-one cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST many-to-one outer-join CDATA #IMPLIED> <!-- true|false, default to hibernate.use_outer_join --> ! </pre> ! <pre> <!-- Declares a one-to-one association between two entities (Or from a component, component element, etc. to an entity). --> ! </pre> ! <pre> <!ELEMENT one-to-one EMPTY> <!ATTLIST one-to-one name CDATA #REQUIRED> <!ATTLIST one-to-one class CDATA #IMPLIED> ! <!ATTLIST one-to-one cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST one-to-one outer-join CDATA #IMPLIED> <!-- true|false, default to hibernate.use_outer_join --> ! <!ATTLIST one-to-one constrained CDATA #IMPLIED> <!-- true|false, default: false --> ! </pre> ! <pre> <!-- Declared a property that holds instances of a toplevel collection role. --> ! </pre> ! <pre> <!ELEMENT collection (column*)> <!ATTLIST collection name CDATA #REQUIRED> --- 138,184 ---- <!ATTLIST property column CDATA #IMPLIED> <!ATTLIST property length CDATA #IMPLIED> ! <!ATTLIST property not-null (true|false) "false"> ! <!ATTLIST property unique (true|false) "false"> ! <!-- Declares an association between two entities (Or from a component, component element, etc. to an entity). --> ! <!ELEMENT many-to-one (column*)> <!ATTLIST many-to-one name CDATA #REQUIRED> <!ATTLIST many-to-one class CDATA #IMPLIED> <!ATTLIST many-to-one column CDATA #IMPLIED> ! <!ATTLIST many-to-one not-null (true|false) "false"> ! <!ATTLIST many-to-one unique (true|false) "false"> ! <!ATTLIST many-to-one cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST many-to-one outer-join (true|false|auto) "auto"> ! <!-- Declares a one-to-one association between two entities (Or from a component, component element, etc. to an entity). --> ! <!ELEMENT one-to-one EMPTY> <!ATTLIST one-to-one name CDATA #REQUIRED> <!ATTLIST one-to-one class CDATA #IMPLIED> ! <!ATTLIST one-to-one cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST one-to-one outer-join (true|false|auto) "auto"> ! <!ATTLIST one-to-one constrained (true|false) "false"> ! ! <!-- A property embedded in a composite identifier or map index (always not-null). --> ! ! <!ELEMENT key-property (column*)> ! <!ATTLIST key-property name CDATA #REQUIRED> ! <!ATTLIST key-property type CDATA #IMPLIED> ! <!ATTLIST key-property column CDATA #IMPLIED> ! <!ATTLIST key-property length CDATA #IMPLIED> ! ! <!-- A many-to-one association embedded in a composite identifier or map index ! (always not-null, never cascade). --> ! ! <!ELEMENT key-many-to-one (column*)> ! <!ATTLIST key-many-to-one name CDATA #REQUIRED> ! <!ATTLIST key-many-to-one class CDATA #IMPLIED> ! <!ATTLIST key-many-to-one column CDATA #IMPLIED> ! <!-- Declared a property that holds instances of a toplevel collection role. --> ! <!ELEMENT collection (column*)> <!ATTLIST collection name CDATA #REQUIRED> *************** *** 189,197 **** <!ATTLIST collection column CDATA #IMPLIED> <!ATTLIST collection length CDATA #IMPLIED> ! <!ATTLIST collection not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST collection unique CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST collection cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! </pre> ! <pre> <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are --- 186,193 ---- <!ATTLIST collection column CDATA #IMPLIED> <!ATTLIST collection length CDATA #IMPLIED> ! <!ATTLIST collection not-null (true|false) "false"> ! <!ATTLIST collection unique (true|false) "false"> ! <!ATTLIST collection cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are *************** *** 199,211 **** is mapped to null values in all columns and vice versa. Components do not support shared reference semantics. --> ! </pre> ! <pre> ! <!ELEMENT component ( (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> <!ATTLIST component name CDATA #REQUIRED> ! </pre> ! <pre> <!-- Collection roles declared directly beneath the root element have their own key and may be referenced by many collection or subcollection tags. Collection declarations --- 195,212 ---- is mapped to null values in all columns and vice versa. Components do not support shared reference semantics. --> ! ! <!ELEMENT component ( ! parent?, (property|many-to-one|one-to-one|collection|component|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> <!ATTLIST component name CDATA #REQUIRED> ! ! <!-- The parent element maps a property of the component class as a pointer back to ! the owning entity. --> ! ! <!ELEMENT parent EMPTY> ! <!ATTLIST parent name CDATA #REQUIRED> ! <!-- Collection roles declared directly beneath the root element have their own key and may be referenced by many collection or subcollection tags. Collection declarations *************** *** 214,356 **** the role may be an arbitrary string. For nested collections, it must be the name of the property containing the collection. ! </pre> ! <pre> Note that the cascade attribute is ignored for toplevel collections. --> ! </pre> ! <pre> <!ELEMENT map ( jcs-cache?, ! key, ! index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST map role CDATA #REQUIRED> ! <!ATTLIST map table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST map schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST map lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST map sort CDATA #IMPLIED> <!-- unsorted|natural, default: unsorted --> ! <!ATTLIST map cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST map order-by CDATA #IMPLIED> <!-- default: none --> ! </pre> ! <pre> <!ELEMENT set ( jcs-cache?, ! key, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST set role CDATA #REQUIRED> ! <!ATTLIST set table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST set schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST set lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST set sort CDATA #IMPLIED> <!-- unsorted|natural, default: unsorted --> ! <!ATTLIST set readonly CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST set cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST set order-by CDATA #IMPLIED> <!-- default: none --> ! </pre> ! <pre> <!ELEMENT bag ( jcs-cache?, ! key, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST bag role CDATA #REQUIRED> ! <!ATTLIST bag table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST bag schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST bag lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST bag readonly CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST bag cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! <!ATTLIST bag order-by CDATA #IMPLIED> <!-- default: none --> ! </pre> ! <pre> <!ELEMENT list ( jcs-cache?, ! key, index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST list role CDATA #REQUIRED> ! <!ATTLIST list table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST list schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST list lazy CDATA #IMPLIED> <!-- default: false --> ! <!ATTLIST list cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! </pre> ! <pre> <!ELEMENT array ( jcs-cache?, ! key, index, (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST array role CDATA #REQUIRED> ! <!ATTLIST array table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST array schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST array element-class CDATA #IMPLIED> ! <!ATTLIST array cascade CDATA #IMPLIED> <!-- none|all|save/update|delete, default: none --> ! </pre> ! <pre> <!ELEMENT primitive-array (jcs-cache?, key, index, element)> <!ATTLIST primitive-array role CDATA #REQUIRED> ! <!ATTLIST primitive-array table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST primitive-array schema CDATA #IMPLIED> <!-- default: none --> ! </pre> ! <pre> <!-- Declares the element type of a collection of basic type --> ! </pre> ! <pre> <!ELEMENT element (column*)> <!ATTLIST element column CDATA #IMPLIED> <!ATTLIST element type CDATA #REQUIRED> <!ATTLIST element length CDATA #IMPLIED> ! <!ATTLIST element not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST element unique CDATA #IMPLIED> <!-- true|false, default: false --> ! </pre> ! <pre> <!-- One to many association. This tag declares the entity-class element type of a collection and specifies a one-to-many relational model --> ! </pre> ! <pre> <!ELEMENT one-to-many EMPTY> <!ATTLIST one-to-many class CDATA #REQUIRED> <!-- No column declaration attributes required in this case. The primary key column of the associated class is already mapped elsewhere.--> ! </pre> ! <pre> <!-- Many to many association. This tag declares the entity-class element type of a collection and specifies a many-to-many relational model --> ! </pre> ! <pre> <!ELEMENT many-to-many (column*)> <!ATTLIST many-to-many class CDATA #REQUIRED> <!ATTLIST many-to-many column CDATA #IMPLIED> ! <!ATTLIST many-to-many length CDATA #IMPLIED> <!-- DEPRECATED --> ! <!ATTLIST many-to-many not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST many-to-many outer-join CDATA #IMPLIED> <!-- true|false, default to hibernate.use_outer_join --> ! <!-- unique makes no sense here since it would mean a one-to-many --> ! </pre> ! <pre> <!-- This tag declares that the element type of a collection is a named toplevel collection role. --> ! </pre> ! <pre> <!ELEMENT subcollection (column*)> <!ATTLIST subcollection column CDATA #IMPLIED> <!ATTLIST subcollection role CDATA #REQUIRED> <!ATTLIST subcollection length CDATA #IMPLIED> ! <!ATTLIST subcollection not-null CDATA #IMPLIED> <!-- true|false, default: false --> ! <!ATTLIST subcollection unique CDATA #IMPLIED> <!-- true|false, default: false --> ! </pre> ! <pre> <!-- A composite element allows a collection to hold instances of an arbitrary class, without the requirement of joining to an entity table. Composite elements have component semantics - no shared references and ad hoc null value semantics. Composite elements may not hold nested collections. --> ! </pre> ! <pre> <!ELEMENT composite-element ( (property|many-to-one|collection|nested-composite-element)* )> <!ATTLIST composite-element class CDATA #REQUIRED> ! </pre> ! <pre> <!ELEMENT nested-composite-element ( (property|many-to-one|collection|nested-composite-element)* --- 215,338 ---- the role may be an arbitrary string. For nested collections, it must be the name of the property containing the collection. ! Note that the cascade attribute is ignored for toplevel collections. --> ! <!ELEMENT map ( jcs-cache?, ! (key|generated-key), ! (index|composite-index|index-many-to-many), (element|one-to-many|many-to-many|subcollection|composite-element) )> <!ATTLIST map role CDATA #REQUIRED> ! <!ATTLIST map table CDATA #IMPLIED> <!-- default: rolename --> ! <!ATTLIST map schema CDATA #IMPLIED> <!-- default: none --> ! <!ATTLIST map lazy (true|false) "false"> ! <!ATTLIST map sort CDATA #IMPLIED> <!-- unsorted|natural|"comparator class", default: unsorted --> ! <!ATTLIST map cascade (none|all|save-update|delete) #IMPLIED> <!-- default: none --> ! <!ATTLIST map order-by CDATA #IMPLIED> <!-- default: non... [truncated message content] |
|
From: <one...@us...> - 2002-11-11 16:04:57
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate
In directory usw-pr-cvs1:/tmp/cvs-serv1425/cirrus/hibernate
Modified Files:
Environment.java
Log Message:
1.2 beta 1
Index: Environment.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Environment.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** Environment.java 31 Oct 2002 08:54:08 -0000 1.73
--- Environment.java 11 Nov 2002 16:04:54 -0000 1.74
***************
*** 39,43 ****
public final class Environment {
! private static final String VERSION = "1.1.8";
/**
--- 39,43 ----
public final class Environment {
! private static final String VERSION = "1.2 beta 1";
/**
|
|
From: <one...@us...> - 2002-11-11 11:30:07
|
Update of /cvsroot/hibernate/Hibernate/doc In directory usw-pr-cvs1:/tmp/cvs-serv7847/doc Modified Files: hibernate.aft Log Message: added jars needed for compiling from CVS Index: hibernate.aft =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/hibernate.aft,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** hibernate.aft 29 Oct 2002 16:09:06 -0000 1.26 --- hibernate.aft 11 Nov 2002 11:30:00 -0000 1.27 *************** *** 79,87 **** * http://sourceforge.net/projects/hibernate ! Needed libraries are distributed, along with |hibernate.jar|, in the |lib| subdirectory. You may also require Sun's |j2ee.jar|. **Compiling Hibernate - * Place |junit.jar| and |j2ee.jar| in the |lib| subdirectory. * Run |build.xml| with Ant 1.5 under JDK1.2+ --- 79,86 ---- * http://sourceforge.net/projects/hibernate ! Needed libraries are distributed, along with |hibernate.jar|, in the |lib| subdirectory. **Compiling Hibernate * Run |build.xml| with Ant 1.5 under JDK1.2+ |
|
From: <one...@us...> - 2002-11-11 11:30:07
|
Update of /cvsroot/hibernate/Hibernate
In directory usw-pr-cvs1:/tmp/cvs-serv7847
Modified Files:
build.xml readme.txt changelog.txt
Log Message:
added jars needed for compiling from CVS
Index: build.xml
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/build.xml,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** build.xml 11 Nov 2002 01:25:06 -0000 1.30
--- build.xml 11 Nov 2002 11:30:00 -0000 1.31
***************
*** 92,96 ****
</target>
! <target name="compile" depends="init" description="Compile the Java source code (remember to put j2ee.jar, junit.jar in the /lib directory)">
<available
classname="org.eclipse.core.launcher.Main"
--- 92,96 ----
</target>
! <target name="compile" depends="init" description="Compile the Java source code">
<available
classname="org.eclipse.core.launcher.Main"
***************
*** 122,127 ****
<fileset dir="${lib.dir}">
<include name="*.jar"/>
- <exclude name="j2ee.jar"/>
- <exclude name="junit.jar"/>
<exclude name="log4j.jar"/>
<include name="*.txt"/>
--- 122,125 ----
Index: readme.txt
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/readme.txt,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** readme.txt 29 Oct 2002 16:09:04 -0000 1.49
--- readme.txt 11 Nov 2002 11:30:00 -0000 1.50
***************
*** 1,5 ****
Hibernate - Relational Persistence for Idiomatic Java
=====================================================
! version 1.1.8 30 October 2002
Instructions
--- 1,5 ----
Hibernate - Relational Persistence for Idiomatic Java
=====================================================
! version 1.2 beta 1 11 November 2002
Instructions
***************
*** 9,13 ****
See index.html in the doc directory.
! Required jars are distributed in the lib directory. You may also need Sun's j2ee.jar.
Latest Documentation:
--- 9,13 ----
See index.html in the doc directory.
! Required jars are distributed in the lib subdirectory.
Latest Documentation:
Index: changelog.txt
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v
retrieving revision 1.263
retrieving revision 1.264
diff -C2 -d -r1.263 -r1.264
*** changelog.txt 11 Nov 2002 10:09:54 -0000 1.263
--- changelog.txt 11 Nov 2002 11:30:00 -0000 1.264
***************
*** 2,7 ****
===================
! Changes in version 1.2 beta 1 (x.11.2002)
! -----------------------------------------
* Fixed a bad bug binding to JNDI with servers that use serialization in preference to getReference()
* support for quoted SQL identifiers (patch by Jean-Francois Nadeau)
--- 2,7 ----
===================
! Changes in version 1.2 beta 1 (11.11.2002)
! ------------------------------------------
* Fixed a bad bug binding to JNDI with servers that use serialization in preference to getReference()
* support for quoted SQL identifiers (patch by Jean-Francois Nadeau)
|
|
From: <one...@us...> - 2002-11-11 11:30:06
|
Update of /cvsroot/hibernate/Hibernate/lib In directory usw-pr-cvs1:/tmp/cvs-serv7847/lib Added Files: j2ee.jar junit.jar Log Message: added jars needed for compiling from CVS --- NEW FILE: j2ee.jar --- (This appears to be a binary file; contents omitted.) --- NEW FILE: junit.jar --- (This appears to be a binary file; contents omitted.) |
|
From: <one...@us...> - 2002-11-11 10:10:00
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory usw-pr-cvs1:/tmp/cvs-serv1678/cirrus/hibernate/impl
Modified Files:
DatastoreImpl.java
Log Message:
made SchemaUpdater commandline-invokable
added latest cglib jar
got SchemaUpdater working with DB2
removed bcel.jar
Index: DatastoreImpl.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/DatastoreImpl.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** DatastoreImpl.java 4 Nov 2002 00:55:30 -0000 1.20
--- DatastoreImpl.java 11 Nov 2002 10:09:55 -0000 1.21
***************
*** 242,271 ****
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
! java.util.Map ci = (java.util.Map) tableColumnInfo.get(table.getName().toLowerCase());
! if (ci == null)
! {
! script.add(table.sqlCreateString(dialect, this));
}
! else
! {
final String sql = table.sqlAlterString(dialect, this, ci);
! if (sql != null)
! script.add(sql);
}
}
iter = primaryKeys.iterator();
! while ( iter.hasNext() )
! {
Constraint constraint = (Constraint) iter.next();
! if (!tableColumnInfo.containsKey(constraint.getName()))
script.add( constraint.sqlCreateString(dialect, this) );
}
if( dialect.hasAlterTable() ) {
iter = foreignKeys.iterator();
! while ( iter.hasNext() )
! {
Constraint constraint = (Constraint) iter.next();
! if (!tableColumnInfo.containsKey(constraint.getName()))
script.add( constraint.sqlCreateString(dialect, this) );
}
--- 242,266 ----
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
! java.util.Map ci = (java.util.Map) tableColumnInfo.get( table.getName().toLowerCase() );
! if (ci == null) {
! script.add( table.sqlCreateString(dialect, this) );
}
! else {
final String sql = table.sqlAlterString(dialect, this, ci);
! if (sql != null) script.add(sql);
}
}
iter = primaryKeys.iterator();
! while ( iter.hasNext() ) {
Constraint constraint = (Constraint) iter.next();
! if ( !tableColumnInfo.containsKey( constraint.getName() ) )
script.add( constraint.sqlCreateString(dialect, this) );
}
if( dialect.hasAlterTable() ) {
iter = foreignKeys.iterator();
! while ( iter.hasNext() ) {
Constraint constraint = (Constraint) iter.next();
! if ( !tableColumnInfo.containsKey( constraint.getName() ) )
script.add( constraint.sqlCreateString(dialect, this) );
}
***************
*** 273,278 ****
iter = indexes.iterator();
! while ( iter.hasNext() )
! {
Index constraint = (Index) iter.next();
if (!tableColumnInfo.containsKey(constraint.getName()))
--- 268,272 ----
iter = indexes.iterator();
! while ( iter.hasNext() ) {
Index constraint = (Index) iter.next();
if (!tableColumnInfo.containsKey(constraint.getName()))
|
|
From: <one...@us...> - 2002-11-11 10:09:59
|
Update of /cvsroot/hibernate/Hibernate/lib In directory usw-pr-cvs1:/tmp/cvs-serv1678/lib Modified Files: cglib.jar Removed Files: bcel.jar Log Message: made SchemaUpdater commandline-invokable added latest cglib jar got SchemaUpdater working with DB2 removed bcel.jar Index: cglib.jar =================================================================== RCS file: /cvsroot/hibernate/Hibernate/lib/cglib.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsj4W776 and /tmp/cvsiJIB76 differ --- bcel.jar DELETED --- |
|
From: <one...@us...> - 2002-11-11 10:09:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools
In directory usw-pr-cvs1:/tmp/cvs-serv1678/cirrus/hibernate/tools
Modified Files:
JdbcColumnInfo.java SchemaUpdater.java
Log Message:
made SchemaUpdater commandline-invokable
added latest cglib jar
got SchemaUpdater working with DB2
removed bcel.jar
Index: JdbcColumnInfo.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/JdbcColumnInfo.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** JdbcColumnInfo.java 4 Nov 2002 00:55:30 -0000 1.1
--- JdbcColumnInfo.java 11 Nov 2002 10:09:56 -0000 1.2
***************
*** 1,2 ****
--- 1,3 ----
+ //$Id$
package cirrus.hibernate.tools;
/*
***************
*** 7,11 ****
* (C) 2002 Christoph Sturm
*/
! public class JdbcColumnInfo{
public String table;
public String columnName;
--- 8,12 ----
* (C) 2002 Christoph Sturm
*/
! public class JdbcColumnInfo {
public String table;
public String columnName;
***************
*** 14,16 ****
--- 15,22 ----
public int decimalDigits;
public String isNullable;
+
+ public String toString() {
+ return table + '.' + columnName;
+ }
+
}
Index: SchemaUpdater.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/SchemaUpdater.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SchemaUpdater.java 4 Nov 2002 00:55:30 -0000 1.1
--- SchemaUpdater.java 11 Nov 2002 10:09:56 -0000 1.2
***************
*** 1,12 ****
package cirrus.hibernate.tools;
import cirrus.hibernate.Datastore;
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.sql.Dialect;
import cirrus.hibernate.connection.ConnectionProvider;
import cirrus.hibernate.connection.ConnectionProviderFactory;
- import cirrus.hibernate.tools.JdbcColumnInfo;
import java.util.*;
import java.sql.*;
--- 1,14 ----
+ //$Id$
package cirrus.hibernate.tools;
import cirrus.hibernate.Datastore;
+ import cirrus.hibernate.Hibernate;
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.sql.Dialect;
import cirrus.hibernate.connection.ConnectionProvider;
import cirrus.hibernate.connection.ConnectionProviderFactory;
import java.util.*;
+ import java.io.FileInputStream;
import java.sql.*;
***************
*** 22,37 ****
*/
public class SchemaUpdater{
! Log log = LogFactory.getLog(getClass());
private ConnectionProvider cp;
!
public SchemaUpdater(Datastore store) throws HibernateException, SQLException {
-
this.store = store;
cp = ConnectionProviderFactory.newConnectionProvider();
-
}
! public void doSchemaUpdate() throws SQLException, HibernateException {
Connection connection = cp.getConnection();
Map columnInfo = getColumnInfo(connection);
--- 24,81 ----
*/
public class SchemaUpdater{
!
! Log log = LogFactory.getLog( getClass() );
private ConnectionProvider cp;
! Datastore store;
!
public SchemaUpdater(Datastore store) throws HibernateException, SQLException {
this.store = store;
cp = ConnectionProviderFactory.newConnectionProvider();
}
! public SchemaUpdater(Datastore store, Properties connectionProperties) throws HibernateException {
! this.store = store;
! cp = ConnectionProviderFactory.newConnectionProvider(connectionProperties);
! }
!
! public static void main(String[] args) {
! try {
!
! Datastore ds = Hibernate.createDatastore();
!
! boolean script = true;
! String propFile = null;
!
! for ( int i=0; i<args.length; i++ ) {
! if( args[i].startsWith("--") ) {
! if( args[i].equals("--quiet") ) {
! script = false;
! }
! else if( args[i].startsWith("--properties=") ) {
! propFile = args[i].substring(13);
! }
! }
! else {
! ds.storeFile(args[i]);
! }
!
! }
! if(propFile!=null) {
! Properties props = new Properties();
! props.load( new FileInputStream(propFile) );
! new SchemaUpdater(ds, props).execute(script);
! }
! else {
! new SchemaUpdater(ds).execute(script);
! }
! }
! catch(Exception e) {
! System.err.println( "Error updating schema " + e.getMessage() );
! e.printStackTrace();
! }
! }
!
! public void execute(boolean script) throws SQLException, HibernateException {
Connection connection = cp.getConnection();
Map columnInfo = getColumnInfo(connection);
***************
*** 39,65 ****
stmt = connection.createStatement();
- boolean export = true;
boolean jdbc2 = false;
String[] createSQL;
createSQL = store.generateSchemaUpdateScript(Dialect.getDialect(), columnInfo);
! for(int j = 0; j < createSQL.length; j++) {
final String sql = createSQL[j];
try {
! // if (script) System.out.println( createSQL[j] );
! // if (outputFile != null) fileOutput.write( createSQL[j] + "\n" );
! if (export) {
! if (jdbc2) {
! stmt.addBatch( sql );
! }
! else {
! stmt.executeUpdate( sql );
! }
! }
! }
! catch (SQLException e) {
! log.error( "Error while executing " + sql, e );
! }
}
if (jdbc2) stmt.executeBatch();
stmt.close();
--- 83,109 ----
stmt = connection.createStatement();
boolean jdbc2 = false;
String[] createSQL;
createSQL = store.generateSchemaUpdateScript(Dialect.getDialect(), columnInfo);
! for (int j = 0; j < createSQL.length; j++) {
!
final String sql = createSQL[j];
try {
! if (script) System.out.println( createSQL[j] );
!
! if (jdbc2) {
! stmt.addBatch( sql );
}
+ else {
+ stmt.executeUpdate( sql );
+ }
+
+ }
+ catch (SQLException e) {
+ log.error( "Error while executing " + sql, e );
+ }
+ }
+
if (jdbc2) stmt.executeBatch();
stmt.close();
***************
*** 91,95 ****
try {
String userName = dbData.supportsSchemasInTableDefinitions() ? dbData.getUserName() : null;
! ResultSet rsCols = dbData.getColumns(null, userName, null, null);
while (rsCols.next()) {
--- 135,141 ----
try {
String userName = dbData.supportsSchemasInTableDefinitions() ? dbData.getUserName() : null;
! if (userName!=null) log.info("Schema: " + userName);
! //ResultSet rsCols = dbData.getColumns(null, userName, "%", "%");
! ResultSet rsCols = dbData.getColumns(null, "%", "%", "%");
while (rsCols.next()) {
***************
*** 100,104 ****
info.table = (info.table == null) ? null : info.table.toUpperCase();
! String columnName = rsCols.getString("COLUMN_NAME");
info.typeName = rsCols.getString("TYPE_NAME");
--- 146,150 ----
info.table = (info.table == null) ? null : info.table.toUpperCase();
! info.columnName = rsCols.getString("COLUMN_NAME");
info.typeName = rsCols.getString("TYPE_NAME");
***************
*** 107,110 ****
--- 153,158 ----
info.isNullable = rsCols.getString("IS_NULLABLE");
+
+ log.info("Existing column: " + info);
Map tableColInfo = (Map)colInfo.get(info.table.toLowerCase());
***************
*** 114,118 ****
colInfo.put(info.table.toLowerCase(), tableColInfo);
}
! tableColInfo.put(columnName.toLowerCase(), info);
} catch (SQLException sqlex) {
String messagex = "Error getting column info for column. Error was:" + sqlex.toString();
--- 162,166 ----
colInfo.put(info.table.toLowerCase(), tableColInfo);
}
! tableColInfo.put( info.columnName.toLowerCase(), info );
} catch (SQLException sqlex) {
String messagex = "Error getting column info for column. Error was:" + sqlex.toString();
***************
*** 139,144 ****
--- 187,195 ----
private Set getTableNames(Connection connection) throws SQLException {
+
DatabaseMetaData dbData = connection.getMetaData();
+ log.info("Getting Table Info From Database");
+
Set tableNames = new TreeSet();
ResultSet tableSet;
***************
*** 162,165 ****
--- 213,219 ----
log.debug("Found Table:" + tableName);
tableNames.add(tableName);
+
+ log.info("Existing table: " + tableName);
+
} catch (SQLException sqle) {
***************
*** 182,185 ****
}
! Datastore store;
}
--- 236,239 ----
}
!
}
|
|
From: <one...@us...> - 2002-11-11 10:09:59
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/cglib In directory usw-pr-cvs1:/tmp/cvs-serv1678/cirrus/hibernate/cglib Removed Files: Enhancer.java Factory.java MethodInterceptor.java Log Message: made SchemaUpdater commandline-invokable added latest cglib jar got SchemaUpdater working with DB2 removed bcel.jar --- Enhancer.java DELETED --- --- Factory.java DELETED --- --- MethodInterceptor.java DELETED --- |
|
From: <one...@us...> - 2002-11-11 10:09:58
|
Update of /cvsroot/hibernate/Hibernate/bin In directory usw-pr-cvs1:/tmp/cvs-serv1678/bin Modified Files: CodeGenerator.bat MapGenerator.bat SchemaExport.bat Added Files: SchemaUpdate.bat Log Message: made SchemaUpdater commandline-invokable added latest cglib jar got SchemaUpdater working with DB2 removed bcel.jar --- NEW FILE: SchemaUpdate.bat --- @echo off rem ------------------------------------------------------------------- rem Execute SchemaExport tool rem ------------------------------------------------------------------- set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip;C:\mm.mysql-2.0.14\mm.mysql-2.0.14-bin.jar set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.SchemaUpdater %* Index: CodeGenerator.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate/bin/CodeGenerator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeGenerator.bat 1 Nov 2002 00:11:32 -0000 1.2 --- CodeGenerator.bat 11 Nov 2002 10:09:55 -0000 1.3 *************** *** 5,12 **** rem ------------------------------------------------------------------- ! set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib ! set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.CodeGenerator %* --- 5,12 ---- rem ------------------------------------------------------------------- ! set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip;C:\mm.mysql-2.0.14\mm.mysql-2.0.14-bin.jar set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib ! set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.CodeGenerator %* Index: MapGenerator.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate/bin/MapGenerator.bat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MapGenerator.bat 11 Nov 2002 01:25:06 -0000 1.2 --- MapGenerator.bat 11 Nov 2002 10:09:55 -0000 1.3 *************** *** 5,12 **** rem ------------------------------------------------------------------- ! set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib ! set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.MapGenerator %* --- 5,12 ---- rem ------------------------------------------------------------------- ! set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip;C:\mm.mysql-2.0.14\mm.mysql-2.0.14-bin.jar set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib ! set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.MapGenerator %* Index: SchemaExport.bat =================================================================== RCS file: /cvsroot/hibernate/Hibernate/bin/SchemaExport.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SchemaExport.bat 31 Oct 2002 17:38:49 -0000 1.1 --- SchemaExport.bat 11 Nov 2002 10:09:55 -0000 1.2 *************** *** 5,12 **** rem ------------------------------------------------------------------- ! set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib ! set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\bcel.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.SchemaExport %* --- 5,12 ---- rem ------------------------------------------------------------------- ! set JDBC_DRIVER=C:\Progra~1\SQLLIB\java\db2java.zip;C:\mm.mysql-2.0.14\mm.mysql-2.0.14-bin.jar set HIBERNATE_HOME=.. set LIB=%HIBERNATE_HOME%\lib ! set CP=%JDBC_DRIVER%;%HIBERNATE_HOME%;%HIBERNATE_HOME%\hibernate.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar java -cp %CP% cirrus.hibernate.tools.SchemaExport %* |
|
From: <one...@us...> - 2002-11-11 10:09:58
|
Update of /cvsroot/hibernate/Hibernate In directory usw-pr-cvs1:/tmp/cvs-serv1678 Modified Files: changelog.txt Log Message: made SchemaUpdater commandline-invokable added latest cglib jar got SchemaUpdater working with DB2 removed bcel.jar Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.262 retrieving revision 1.263 diff -C2 -d -r1.262 -r1.263 *** changelog.txt 11 Nov 2002 01:25:06 -0000 1.262 --- changelog.txt 11 Nov 2002 10:09:54 -0000 1.263 *************** *** 20,23 **** --- 20,24 ---- * components may now have a nonpublic constructor (patch by Jon Lipsky) * changes / bugfixes to MapGenerator tool + * experimental SchemaUpdate tool contributed by Christoph Sturm Changes in version 1.1.8 (30.10.2002) |
|
From: <one...@us...> - 2002-11-11 01:25:11
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect
In directory usw-pr-cvs1:/tmp/cvs-serv27549/cirrus/hibernate/tools/reflect
Modified Files:
MappingByReflection.java ReflectedClass.java
ReflectedProperty.java
Log Message:
changes / bugfixes to MapGenerator tool
Index: MappingByReflection.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect/MappingByReflection.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** MappingByReflection.java 19 Sep 2002 08:26:45 -0000 1.14
--- MappingByReflection.java 11 Nov 2002 01:25:07 -0000 1.15
***************
*** 158,162 ****
/** how low will you go? the depth of component nesting followed
*/
! protected int maxDepth = 3;
/** candidate UID property names; presence of one of these with a
--- 158,162 ----
/** how low will you go? the depth of component nesting followed
*/
! protected int maxDepth = 0;
/** candidate UID property names; presence of one of these with a
***************
*** 222,226 ****
private Vector roots;
! private char[] prefix = " ".toCharArray();
/** the only MappingByReflection constructor
--- 222,226 ----
private Vector roots;
! private char[] prefix = StringHelper.repeat("\t", 100).toCharArray();
/** the only MappingByReflection constructor
***************
*** 462,466 ****
*/
protected void emitPrefix( int n ) {
! int e = n * 2; // configurable?
if( e > prefix.length ) e = prefix.length;
buf.append( prefix, 0, e );
--- 462,466 ----
*/
protected void emitPrefix( int n ) {
! int e = n * 1; // configurable?
if( e > prefix.length ) e = prefix.length;
buf.append( prefix, 0, e );
Index: ReflectedClass.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect/ReflectedClass.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ReflectedClass.java 16 Sep 2002 15:19:39 -0000 1.7
--- ReflectedClass.java 11 Nov 2002 01:25:07 -0000 1.8
***************
*** 7,10 ****
--- 7,12 ----
import java.util.Vector;
+ import cirrus.hibernate.helpers.StringHelper;
+
/** a ReflectedClass is created by MappingByReflection instances for
* every class encountered, from map.addClass(), while chasing the
***************
*** 111,114 ****
--- 113,117 ----
this.buf = map.buf;
String name = clazz.getName();
+ String shortName = StringHelper.unqualify(name);
// debug...
map.emitPrefix(level);;
***************
*** 122,131 ****
.append("\" table=\"")
.append(map.tableNameFor(name))
! .append((subs.size() > 0) ? "\" discriminator=\"subclass" : "")
.append("\">\n");
// first find the uid
if( uid == null ) {
// report error
! map.emitPrefix(level);;
buf.append("<!-- NO UID!? class=\"")
.append(name)
--- 125,134 ----
.append("\" table=\"")
.append(map.tableNameFor(name))
! .append((subs.size() > 0) ? "\" discriminator-value=\"" + shortName : "")
.append("\">\n");
// first find the uid
if( uid == null ) {
// report error
! map.emitPrefix(level);
buf.append("<!-- NO UID!? class=\"")
.append(name)
***************
*** 134,137 ****
--- 137,145 ----
uid.getUidXML(level+1, buf);
}
+ //the discriminator element
+ if ( subs.size() > 0 ) {
+ map.emitPrefix(level+1);
+ buf.append("<discriminator column=\"subclass\" type=\"string\"/>\n");
+ }
// now the properties already classified by heuristic
Enumeration ps = props.elements();
***************
*** 211,215 ****
while( ps.hasMoreElements() ) {
ReflectedProperty prop = (ReflectedProperty )ps.nextElement();
! prop.getXML( level, buf );
}
// NOT the subclasses
--- 219,223 ----
while( ps.hasMoreElements() ) {
ReflectedProperty prop = (ReflectedProperty )ps.nextElement();
! prop.getXML( level+1, buf );
}
// NOT the subclasses
Index: ReflectedProperty.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/tools/reflect/ReflectedProperty.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ReflectedProperty.java 5 Oct 2002 09:33:42 -0000 1.14
--- ReflectedProperty.java 11 Nov 2002 01:25:07 -0000 1.15
***************
*** 131,135 ****
protected void emitPCommentStr( int level, String comment, String name, String tynm ) {
! map.emitPrefix(level);
buf.append("<!-- ")
.append(comment)
--- 131,135 ----
protected void emitPCommentStr( int level, String comment, String name, String tynm ) {
! /*map.emitPrefix(level);
buf.append("<!-- ")
.append(comment)
***************
*** 138,142 ****
.append("\" type=\"")
.append(tynm)
! .append("\" -->\n");
}
--- 138,142 ----
.append("\" type=\"")
.append(tynm)
! .append("\" -->\n");*/
}
|