值集合映射 annotation

值集合映射  
@CollectionOfElements
    @JoinTable(
           name="newfilter",
           joinColumns = @JoinColumn(name="parser_id")
    )
    @Column(name="cutcontent", nullable=false)
	private Set<String> cutcontent;
多对多映射
@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinTable(name = "base_user_role", joinColumns = { @JoinColumn(name = "user_id") }, inverseJoinColumns = { @JoinColumn(name = "role_id") })
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	private List<Role> roles;
简约统计行数:
( (Integer) session.iterate("select count(*) from ....").next() ).intValue()

你可能感兴趣的:(java,cache)