不提供具体的实现,这里提供一个思路。 在 Spring 集成环境中,可以通过配置静态方式获取 Spring 的 context 对象。 如果使用 vesta(https://gitee.com/free/vesta-id-generator) 来生成 ID,假设已经提供了 vesta 的 idService。 那么可以在实现中获取该类,然后生成 Id 返回,示例代码如下: public class VestaGenId implement GenId { public Long genId(String ta
| 22 | * @author liuzh |
| 23 | */ |
| 24 | public interface GenId<T> { |
| 25 | |
| 26 | T genId(String table, String column); |
| 27 | |
| 28 | class NULL implements GenId { |
| 29 | @Override |
| 30 | public Object genId(String table, String column) { |
| 31 | throw new UnsupportedOperationException(); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…