
JAVA
_壹贰叁_
这个作者很懒,什么都没留下…
展开
-
@TableGenerator
@Id @Column(name = "f_user_id", unique = true, nullable = false) @TableGenerator(name = "tg_cms_user", pkColumnValue = "cms_user", table = "t_id_t转载 2017-03-09 17:14:31 · 2870 阅读 · 0 评论 -
html中submit和button的区别(总结)
submit是button的一个特例,也是button的一种,它把提交这个动作自动集成了。如果表单在点击提交按钮后需要用JS进行处理(包括输入验证)后再提交的话,通常都必须把submit改成button,即取消其自动提交的行为,否则,将会造成提交两次的效果,对于动态网页来说,也就是对数据库操作两次。或者在使用submit时验证时加returntrue或false。submit和bu转载 2017-04-26 17:10:17 · 795 阅读 · 0 评论 -
JS操作JSON总结
JS操作JSON总结JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,采用完全独立于语言的文本格式,是理想的数据交换格式。同时,JSON是 JavaScript 原生格式,这意味着在 JavaScript 中处理 JSON数据不须要任何特殊的 API 或工具包。 本文主要是对JS操作JSON的要领做下总结。 在JSON中,转载 2017-04-26 16:52:55 · 353 阅读 · 0 评论 -
textarea提交的时候怎么去除首尾的空格
不要这样:内容。要这样:内容原创 2017-05-17 16:19:09 · 2027 阅读 · 0 评论 -
Spring Jpa 按时间段查询
项目中有需求要按照名称模糊查找和时间段查找数据,可能只有名称没有时间,也可能只有时间没有名称,也可能这几个参数同时匹配,所以要多条件动态查询。JpaSpecificationExecutor 接口提供很多条件查询方法:public interface JpaSpecificationExecutor { T findOne(Specification var1); L原创 2017-05-24 13:00:16 · 52800 阅读 · 7 评论 -
detached entity passed to persist
detached entity passed to persist注解要么写在字段上,要么写在getXX上,千万千万不能混合使用,否则会报这个错误!原创 2017-05-12 16:15:18 · 442 阅读 · 0 评论 -
Field 'id' doesn't have a default value
ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Field 'id' doesn't have a default value数据表id改成自增原创 2017-05-12 14:41:17 · 508 阅读 · 0 评论 -
ids for this class must be manually assigned before calling save()
Caused by: org.springframework.orm.jpa.JpaSystemException: ids for this class must be manually assigned before calling save():nested exception is org.hibernate.id.IdentifierGenerationException:原创 2017-05-12 14:34:22 · 8915 阅读 · 1 评论 -
hibernate 的@Column注解不生效
@Column的作用范围是根据@Id的作用范围来的;即如果@Id标签放在字段上的,那么@Column就只能作用在字段上;如果@Id放在getter方法上的,那么@Column也得放到getter上原创 2017-05-12 14:09:21 · 1917 阅读 · 0 评论 -
springMVC返回hibernate多对多对象的json时 出现无限循环
jackson中的@JsonBackReference和@JsonManagedReference,以及@JsonIgnore均是为了解决对象中存在双向引用导致的无限递归(infinite recursion)问题。这些标注均可用在属性或对应的get、set方法中。@JsonBackReference和@JsonManagedReference:这两个标注通常配对使用,通常用在父子关系中。转载 2017-03-16 18:04:28 · 314 阅读 · 0 评论 -
Jackson属性的过滤
@JsonAutoDetect (class)这是作用于类的annotation,主要用于指明该类使用annotation,并且可以自动侦测getter,setter,构造方法,以便生成json对象@JsonIgnore(value=true作用于方法或字段,用来表明,当生成json的时候忽略有该annotation的方法或字段(序列化时还会调用此字段)@JsonIgnorePro原创 2017-03-16 14:56:02 · 4381 阅读 · 0 评论 -
json序列化时,不序列化值为null和""的字段
com.fasterxml.jackson.core jackson-core 2.2.3 com.fasterxml.jackson.core jackson-databind 2.2.3 com.fasterxml.jackson.core jackson-annotations 2.2.3在类上添加@JsonInclude(Include.NON_EMPTY),原创 2017-03-15 12:58:28 · 9365 阅读 · 0 评论 -
SpringMVC 自定义全局PropertyEditor
转载:http://blog.youkuaiyun.com/cml_blog/article/details/45222431注入了@Controller与@RequestMapping需要的注解类 class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>转载 2017-03-10 16:52:51 · 302 阅读 · 0 评论 -
spring mvc拦截器
APP登陆验证/** * 登陆拦截器 * Created by dxa on 2017/5/18. */public class LoginInterceptor extends HandlerInterceptorAdapter { @Autowired private RedisService redisService; /** * Handle原创 2017-05-19 10:36:20 · 317 阅读 · 0 评论