访问服务本身中的春季服务名称
我很难做我认为很容易的事情。 我有一项服务:
@Service("tr_v1_mapper")
@RequiredArgsConstructor
@Slf4j
public class VoneMapper implements GenericMapper{
// Mapping code ...
// Service name
String serviceName = "tr_v1_mapper"
}
基本上,我想将我的服务名称存储在vonemapper中的字符串变量中,而无需对其进行编码。 有可能吗? 感谢您的帮助。
下午
I am having some difficulties to do something I thought would be easy.
I have a service:
@Service("tr_v1_mapper")
@RequiredArgsConstructor
@Slf4j
public class VoneMapper implements GenericMapper{
// Mapping code ...
// Service name
String serviceName = "tr_v1_mapper"
}
Basically, I want to stock my service name in a String variable inside my class VoneMapper without harcoding it.
is it something possible ?
Thanks by advance for your help.
PM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在注释中使用常数怎么办?更多信息在此处: https://wwww.baeldung.com/java-annotung.com/java-annotation-anotation-com-属性 - 价值限制
What about using a constant in the annotation? More info here: https://www.baeldung.com/java-annotation-attribute-value-restrictions