Package org.alfresco.util
Class DialectUtil
- java.lang.Object
-
- org.alfresco.util.DialectUtil
-
public abstract class DialectUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static 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, Class<?> dialectClass, String resourceUrl)Replaces the dialect placeholder in the resource URL and attempts to find a file for it.static StringresolveDialectUrl(Class<?> dialectClass, 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 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, Class<?> dialectClass, 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 String resolveDialectUrl(Class<?> dialectClass, 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
-
-