随笔分类 - 注解
摘要:@PrePersistpublic void prePersist() { updatedAt = new Timestamp(System.currentTimeMillis()); createdAt = new Timestamp(System.currentTimeMillis());}/*
阅读全文
摘要:@Retention注解 Retention(保留)注解说明,这种类型的注解会被保留到那个阶段. 有三个值:1.RetentionPolicy.SOURCE —— 这种类型的Annotations只在源代码级别保留,编译时就会被忽略2.RetentionPolicy.CLASS —— 这种类型的An
阅读全文
摘要:使用注解之前要开启自动扫描功能 其中base-package为需要扫描的包(含子包)。 1 <context:component-scan base-package="cn.test"/> 1 <context:component-scan base-package="cn.test"/> 1 <c
阅读全文