mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-09-03 18:17:17 +00:00
ref[version]: use "orm" as root element in xml, "config" is not used anymore and use "orm" instead
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
package com.zfoo.orm.cache.version;
|
||||
|
||||
import com.zfoo.orm.model.IEntity;
|
||||
import com.zfoo.orm.schema.NamespaceHandler;
|
||||
import com.zfoo.protocol.util.StringUtils;
|
||||
import com.zfoo.protocol.util.UuidUtils;
|
||||
import javassist.*;
|
||||
@@ -50,7 +51,7 @@ public abstract class EnhanceUtils {
|
||||
Method setVersionMethod = cacheVersion.getSetVersionMethod();
|
||||
|
||||
// 定义类名称
|
||||
CtClass enhanceClazz = classPool.makeClass(EnhanceUtils.class.getName() + UuidUtils.getLocalIntId());
|
||||
CtClass enhanceClazz = classPool.makeClass(EnhanceUtils.class.getName() + StringUtils.capitalize(NamespaceHandler.ORM) + UuidUtils.getLocalIntId());
|
||||
enhanceClazz.addInterface(classPool.get(IVersion.class.getName()));
|
||||
|
||||
// 定义类实现的接口方法name
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
|
||||
*/
|
||||
public class NamespaceHandler extends NamespaceHandlerSupport {
|
||||
|
||||
private final String ORM = "config";
|
||||
public static final String ORM = "orm";
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:element name="config">
|
||||
<xsd:element name="orm">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:choice minOccurs="0" maxOccurs="1">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<context:component-scan base-package="com.zfoo.orm"/>
|
||||
|
||||
<orm:config id="config" entity-package="com.zfoo.orm.**.entity">
|
||||
<orm:orm id="ormManager" entity-package="com.zfoo.orm.**.entity">
|
||||
|
||||
<orm:host database="${mongodb.database}" user="${mongodb.user}" password="${mongodb.password}">
|
||||
<orm:address name="${mongodb.address.name}" url="${mongodb.address.url}"/>
|
||||
@@ -39,6 +39,6 @@
|
||||
<orm:persister strategy="cron30s" type="cron" config="0/30 * * * * ?"/>
|
||||
<orm:persister strategy="time30s" type="time" config="30000"/>
|
||||
</orm:persisters>
|
||||
</orm:config>
|
||||
</orm:orm>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user