Package org.alfresco.util
Class DialectUtil
- java.lang.Object
-
- org.alfresco.util.DialectUtil
-
public abstract class DialectUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPLACEHOLDER_DIALECTThe placeholder for the configuredDialectclass name: ${db.script.dialect}
-
Constructor Summary
Constructors Constructor Description DialectUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.springframework.core.io.ResourcegetDialectResource(org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.lang.Class<?> dialectClass, java.lang.String resourceUrl)Replaces the dialect placeholder in the resource URL and attempts to find a file for it.static java.lang.StringresolveDialectUrl(java.lang.Class<?> dialectClass, java.lang.String resourceUrl)Takes resource URL containing thedialect placeholder textand substitutes the placeholder with the name of the given dialect's class.
-
-
-
Field Detail
-
PLACEHOLDER_DIALECT
public static final java.lang.String PLACEHOLDER_DIALECT
The placeholder for the configuredDialectclass name: ${db.script.dialect}- See Also:
- Constant Field Values
-
-
Method Detail
-
getDialectResource
public static org.springframework.core.io.Resource getDialectResource(org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.lang.Class<?> dialectClass, java.lang.String resourceUrl)Replaces the dialect placeholder in the resource URL and attempts to find a file for it. If not found, the dialect hierarchy will be walked until a compatible resource is found. This makes it possible to have resources that are generic to all dialects.- Returns:
- The Resource, otherwise null
-
resolveDialectUrl
public static java.lang.String resolveDialectUrl(java.lang.Class<?> dialectClass, java.lang.String resourceUrl)Takes resource URL containing thedialect placeholder textand substitutes the placeholder with the name of the given dialect's class. For example:resolveDialectUrl(MySQLInnoDBDialect.class, "classpath:alfresco/db/${db.script.dialect}/myfile.xml")would give the following String:classpath:alfresco/db/org.hibernate.dialect.MySQLInnoDBDialect/myfile.xml
-
-