package de.firma.iservice.bvs.core.typehandler;
public class TrimmedStringTypeHandler extends BaseTypeHandler<String> {...}
spring.datasource.maximum-pool-size: 10
mybatis: type-handlers-package: de.firma.iservice.bvs.core.typehandler type-aliases-package: de.firma.iservice.bvs.core.models.* mapper-locations: /mapper/*Mapper.xml
Hello Marvin,
type-handlers-package
is used to register type handlers globally.
So, this is the setting you use when you want to override the built-in StringTypeHandler
.
You may need to add @MappedTypes(String.class)
to the type handler.
As global type handlers are used implicitly, you don't need to specify typeHandler
in <result />
.
Now, if you want to use TrimmedStringTypeHandler
only for particular properties, remove type-handlers-package
from the config and specify typeHandler="de.firma.iservice.bvs.core.typehandler.TrimmedStringTypeHandler"
in each <result />
.
To use short names (i.e. typeHandler="TrimmedStringTypeHandler"
), you need to register the aliases. e.g.
type-aliases-package: de.firma.iservice.bvs.core.models,de.firma.iservice.bvs.core.typehandler
(*
is unnecessary)
Please let me know if you have any further questions.
Regards,
Iwao
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/748786d6-90b8-497c-acec-62f61ca897cb%40googlegroups.com.