Author: scabanovich
Date: 2009-10-26 08:36:42 -0400 (Mon, 26 Oct 2009)
New Revision: 18296
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate-configuration-2.0.dtd
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateConstants.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateRecognizer.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5084
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate-configuration-2.0.dtd
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate-configuration-2.0.dtd
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate-configuration-2.0.dtd 2009-10-26
12:36:42 UTC (rev 18296)
@@ -0,0 +1,44 @@
+<!-- Hibernate file-based configuration document.
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
+
+An instance of this document contains property settings and references
+to mapping files for a number of SessionFactory instances to be listed
+in JNDI.
+
+-->
+
+<!ELEMENT hibernate-configuration (session-factory)>
+
+<!ELEMENT property (#PCDATA)>
+<!ATTLIST property name CDATA #REQUIRED>
+
+<!ELEMENT mapping EMPTY> <!-- reference to a mapping file -->
+<!ATTLIST mapping resource CDATA #IMPLIED>
+<!ATTLIST mapping file CDATA #IMPLIED>
+<!ATTLIST mapping jar CDATA #IMPLIED>
+
+<!ELEMENT jcs-class-cache EMPTY> <!-- deprecated -->
+<!ATTLIST jcs-class-cache class CDATA #REQUIRED>
+<!ATTLIST jcs-class-cache region CDATA #IMPLIED>
+<!ATTLIST jcs-class-cache usage (read-only|read-write|nonstrict-read-write)
#REQUIRED>
+
+<!ELEMENT jcs-collection-cache EMPTY> <!-- deprecated -->
+<!ATTLIST jcs-collection-cache collection CDATA #REQUIRED>
+<!ATTLIST jcs-collection-cache region CDATA #IMPLIED>
+<!ATTLIST jcs-collection-cache usage
(read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>
+
+<!ELEMENT class-cache EMPTY>
+<!ATTLIST class-cache class CDATA #REQUIRED>
+<!ATTLIST class-cache region CDATA #IMPLIED>
+<!ATTLIST class-cache usage (read-only|read-write|nonstrict-read-write|transactional)
#REQUIRED>
+
+<!ELEMENT collection-cache EMPTY>
+<!ATTLIST collection-cache collection CDATA #REQUIRED>
+<!ATTLIST collection-cache region CDATA #IMPLIED>
+<!ATTLIST collection-cache usage
(read-only|read-write|nonstrict-read-write|transactional) #REQUIRED>
+
+<!ELEMENT session-factory (property*, mapping+,
(class-cache|collection-cache|jcs-class-cache|jcs-collection-cache)*)>
+<!ATTLIST session-factory name CDATA #IMPLIED> <!-- the JNDI name -->
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate-configuration-2.0.dtd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateConstants.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateConstants.java 2009-10-26
10:38:34 UTC (rev 18295)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateConstants.java 2009-10-26
12:36:42 UTC (rev 18296)
@@ -18,6 +18,9 @@
public static String CFG_DOC_PUBLICID_3_0 = "-//Hibernate/Hibernate Configuration
DTD 3.0//EN"; //$NON-NLS-1$
public static String CFG_DOC_SYSTEMID_3_0 =
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd";
//$NON-NLS-1$
+ public static String CFG_DOC_PUBLICID_2_0 = "-//Hibernate/Hibernate Configuration
DTD 2.0//EN"; //$NON-NLS-1$
+ public static String CFG_DOC_SYSTEMID_2_0 =
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd";
//$NON-NLS-1$
+
public static String RVE_DOC_PUBLICID_3_0 = "-//Hibernate/Hibernate Reverse
Engineering DTD 3.0//EN"; //$NON-NLS-1$
public static String RVE_DOC_SYSTEMID_3_0 =
"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd";
//$NON-NLS-1$
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateRecognizer.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateRecognizer.java 2009-10-26
10:38:34 UTC (rev 18295)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/HibernateRecognizer.java 2009-10-26
12:36:42 UTC (rev 18296)
@@ -28,6 +28,12 @@
XMLEntityResolver.registerSystemEntity(
HibernateConstants.CFG_DOC_SYSTEMID_3_0, HibernateRecognizer.class,
"/meta/hibernate-configuration-3.0.dtd" //$NON-NLS-1$
);
+ XMLEntityResolver.registerPublicEntity(
+ HibernateConstants.CFG_DOC_PUBLICID_2_0, HibernateRecognizer.class,
"/meta/hibernate-configuration-2.0.dtd" //$NON-NLS-1$
+ );
+ XMLEntityResolver.registerSystemEntity(
+ HibernateConstants.CFG_DOC_SYSTEMID_2_0, HibernateRecognizer.class,
"/meta/hibernate-configuration-2.0.dtd" //$NON-NLS-1$
+ );
} catch (Exception e) {}
}
@@ -38,6 +44,9 @@
|| body.indexOf("\"" + HibernateConstants.DOC_SYSTEMID_3_0 +
"\"") >= 0) ? HibernateConstants.ENTITY_FILE_HIBERNATE_3_0
//$NON-NLS-1$ //$NON-NLS-2$
: (body.indexOf("\"" + HibernateConstants.CFG_DOC_PUBLICID_3_0 +
"\"") >= 0 //$NON-NLS-1$ //$NON-NLS-2$
|| body.indexOf("\"" + HibernateConstants.CFG_DOC_SYSTEMID_3_0 +
"\"") >= 0) ? HibernateConstants.ENTITY_FILE_HIB_CONFIG_3_0
//$NON-NLS-1$ //$NON-NLS-2$
+ //we do not support cfg 2.0 but let's try and do the best
+ : (body.indexOf("\"" + HibernateConstants.CFG_DOC_PUBLICID_2_0 +
"\"") >= 0 //$NON-NLS-1$ //$NON-NLS-2$
+ || body.indexOf("\"" + HibernateConstants.CFG_DOC_SYSTEMID_2_0 +
"\"") >= 0) ? HibernateConstants.ENTITY_FILE_HIB_CONFIG_3_0
//$NON-NLS-1$ //$NON-NLS-2$
: (body.indexOf("\"" + HibernateConstants.RVE_DOC_PUBLICID_3_0 +
"\"") >= 0 //$NON-NLS-1$ //$NON-NLS-2$
|| body.indexOf("\"" + HibernateConstants.RVE_DOC_SYSTEMID_3_0 +
"\"") >= 0) ? HibernateConstants.ENTITY_FILE_HIB_REV_ENG_3_0
//$NON-NLS-1$ //$NON-NLS-2$
: null;