Package org.alfresco.util
Class DialectUtil
java.lang.Object
org.alfresco.util.DialectUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe placeholder for the configuredDialectclass name: ${db.script.dialect} -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
PLACEHOLDER_DIALECT
The placeholder for the configuredDialectclass name: ${db.script.dialect}- See Also:
-
-
Constructor Details
-
DialectUtil
public DialectUtil()
-
-
Method Details
-
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
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
-