/**
* Gets the value of the serialNumber property.
*
*/
@Column(name = "serialnumb")
@OrderBy(value = "SerialNumber DESC")
@Id
public Long getSerialNumber() {
return serialNumber;
}
private void getorderBy(List<Annotation> annotationList,Element element) {
Element subelement = element != null ? element.element( "order-by" ) : null;
if ( subelement != null ) {
AnnotationDescriptor ad = new AnnotationDescriptor( OrderBy.class );
copyStringElement( subelement,ad,"value" );
annotationList.add( AnnotationFactory.create( ad ) );
}
}
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "org_user_role_rel",joinColumns = {@JoinColumn(name = "user_id")},inverseJoinColumns = {@JoinColumn(name = "role_id")})
@Where(clause="delete_flag=0")
@OrderBy("no")
public Set<Role> getRoles() {
return roles;
}
/**
* 获取收藏商品
*
* @return 收藏商品
*/
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_member_favorite_product")
@OrderBy("createDate desc")
public Set<Product> getFavoriteProducts() {
return favoriteProducts;
}
/**
* 获取筛选品牌
*
* @return 筛选品牌
*/
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_category_brand")
@OrderBy("order asc")
public Set<Brand> getBrands() {
return brands;
}
/**
* 获取规格
*
* @return 规格
*/
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_specification")
@OrderBy("order asc")
public Set<Specification> getSpecifications() {
return specifications;
}
/**
* 获取规格值
*
* @return 规格值
*/
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "xx_product_specification_value")
@OrderBy("specification asc")
public Set<SpecificationValue> getSpecificationValues() {
return specificationValues;
}
@ManyToMany
@JoinTable(name = "user_badge",joinColumns = { @JoinColumn(name = "user_id") },inverseJoinColumns = { @JoinColumn(name = "badge_id") })
@Fetch(FetchMode.SUBSELECT)
@OrderBy("id")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public Set<Badge> getBadges() {
return badges;
}
@ManyToMany
//�м����,��������Ĭ����������
@JoinTable(name = "ACCT_USER_ROLE",joinColumns = { @JoinColumn(name = "USER_ID") },inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") })
//Fecth���Զ���
@Fetch(FetchMode.SUBSELECT)
//���ϰ�id����.
@OrderBy("id")
//�����ж���id�Ļ���.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public List<AcctRole> getRoleList() {
return roleList;
}
/**
* Get the Actions related to the Symbol.
*
* @return The actions of this Symbol
*/
@OnetoMany(
mappedBy = "symbol",cascade = {CascadeType.ALL})
@OrderBy("number ASC")
@JsonProperty
public List<SymbolAction> getActions() {
return actions;
}
/**
* @return the comments
*/
@OnetoMany(fetch = FetchType.LAZY,orphanRemoval = true)
@JoinColumn(name = "commentPage_id")
@OrderBy("created DESC")
@Where(clause = "commentPage_type = 'IdentificationKey'")
@Cascade({ CascadeType.SAVE_UPDATE,CascadeType.MERGE,CascadeType.DELETE })
@JsonIgnore
public List<Comment> getComments() {
return comments;
}
/**
* @return the comments
*/
@OnetoMany(fetch = FetchType.LAZY,orphanRemoval = true)
@JoinColumn(name = "commentPage_id")
@OrderBy("created DESC")
@Where(clause = "commentPage_type = 'Concept'")
@Cascade({ CascadeType.SAVE_UPDATE,CascadeType.DELETE })
@JsonIgnore
public List<Comment> getComments() {
return comments;
}
/**
* @return the comments
*/
@OnetoMany(fetch = FetchType.LAZY,orphanRemoval = true)
@JoinColumn(name = "commentPage_id")
@OrderBy("created DESC")
@Where(clause = "commentPage_type = 'Taxon'")
@Cascade({ CascadeType.SAVE_UPDATE,CascadeType.DELETE })
@JsonIgnore
public List<Comment> getComments() {
return comments;
}
/**
* @return questions
*/
@OnetoMany(fetch = FetchType.LAZY,mappedBy = "haq",cascade=CascadeType.ALL,orphanRemoval=true)
@OrderBy("sortOrder")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public List<com.mobileman.projecth.domain.questionary.Question> getQuestions() {
return this.questions;
}
@JazzProp(name="Questões",renderer=JazzRenderer.SUBMODULE,listable=false,searchable=false)
@ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
@Size(min=1,message="Adicione pelo menos uma questão!")
@NotEmpty(message="Adicione pelo menos uma questão!")
@Valid()
@Fetch(FetchMode.SELECT)//coloquei este fetch pq o hibernate vai multiplicar os resultados,por nao se tratar de um set. Estúpido!
@OrderBy("ordem")
public List<QuestionVO> getQuestions() {
return questions;
}
@JazzProp(name="Quest��es",message="Adicione pelo menos uma quest�o!")
@NotEmpty(message="Adicione pelo menos uma quest�o!")
@Valid()
@Fetch(FetchMode.SELECT)//coloquei este fetch pq o hibernate vai multiplicar os resultados,por nao se tratar de um set. Est�pido!
@OrderBy("ordem")
@Navigable(alias="perg",visitorClass=ShuffleQuestionsVisitor.class)
public List<QuestionVO> getQuestions() {
return questions;
}
@JazzProp(name="Questões",fetch=FetchType.EAGER)
//@Column(nullable=true) retirei em 110611 nao faz sentido
@Size(min=1,message="Adicione pelo menos uma questão!")
@Valid
@Fetch(FetchMode.SELECT)//coloquei este fetch pq o hibernate vai multiplicar os resultados,por nao se tratar de um set. Estúpido!
@OrderBy("ordem")
public List<QuestionVO> getQuestions() {
return questions;
}
private static JoinPath processJoin(AbstractMetadata thisMeta,ITableMetadata target,AnnotationProvider field,JoinColumn... jj) {
List<JoinKey> result = new ArrayList<JoinKey>();
String fieldName = field.getName();
for (JoinColumn j : jj) {
if (StringUtils.isBlank(j.name())) {
throw new IllegalArgumentException("Invalid reference [" + thisMeta.getThisType().getName() + "." + fieldName + "]:The field 'name' in JoinColumn is empty");
}
Field left = thisMeta.getField(j.name());
Assert.notNull(left,"Invalid reference [" + thisMeta.getThisType().getName() + "." + fieldName + "]: field [" + j.name() + "] not found from entity " + thisMeta.getThisType().getName());
Field right = target.getField(j.referencedColumnName());
if (right == null) {
throw new noresultException("Invalid reference [" + thisMeta.getThisType().getName() + "." + fieldName + "]: '" + j.referencedColumnName() + "' is not available in " + target.getThisType().getName());
}
result.add(new JoinKey(left,right));
}
JoinType type = JoinType.LEFT;
JoinDescription joinDesc = field.getAnnotation(JoinDescription.class);
if (joinDesc != null) {
type = joinDesc.type();
}
if (result.size() > 0) {
JoinPath path = new JoinPath(type,result.toArray(new JoinKey[result.size()]));
path.setDescription(joinDesc,field.getAnnotation(OrderBy.class));
if (joinDesc != null && joinDesc.filterCondition().length() > 0) {
JoinKey joinExpress = getJoinExpress(thisMeta,target,joinDesc.filterCondition().trim());
if (joinExpress != null)
path.addJoinKey(joinExpress);
}
return path;
}
return null;
}
private static JoinPath processJoin(ITableMetadata Meta,AnnotationProvider annos,String mappedBy) {
JoinDescription joinDesc = annos.getAnnotation(JoinDescription.class);
OrderBy orderBy = annos.getAnnotation(OrderBy.class);
List<JoinKey> result = new ArrayList<JoinKey>();
if (Meta.getPKFields().size() != 1) {
throw new IllegalArgumentException(Meta.getSimpleName() + " cann't map to " + target.getSimpleName() + " since its primary key field count " + Meta.getPKFields().size());
}
Field left = Meta.getPKFields().get(0).field();
Field right = target.getField(mappedBy);
if (right == null) {
throw new IllegalArgumentException(Meta.getSimpleName() + " cann't map to " + target.getSimpleName() + " since there is no field [" + mappedBy + "] in target entity");
}
result.add(new JoinKey(left,right));
JoinType type = JoinType.LEFT;
if (joinDesc != null) {
type = joinDesc.type();
}
if (result.size() > 0) {
JoinPath path = new JoinPath(type,orderBy);
if (joinDesc != null && joinDesc.filterCondition().length() > 0) {
JoinKey joinExpress = getJoinExpress(Meta,joinDesc.filterCondition().trim());
if (joinExpress != null)
path.addJoinKey(joinExpress);
}
return path;
}
return null;
}
@ManyToMany(fetch = FetchType.LAZY)
@JoinColumn(nullable = false)
@OrderBy("name asc")
@ForeignKey(name = "fk_admin_role_set")
public Set<Role> getRoleSet() {
return roleSet;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TECIDO_ID",nullable = false)
// name define o nome da chave estrangeira na tabela
@OrderBy("codTecido")
public Tecido getTecido() {
return tecido;
}
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "MODELO_ID",nullable = false)
// name define o nome da chave estrangeira na tabela
@OrderBy("codModelo")
public Modelo getModelo() {
return modelo;
}
@ManyToOne
/** n�o estou usando lazy pois quero os dados do perioPM sempre que mostrar
capacRec */
@JoinColumn(name = "PERIOPM_ID",nullable = false)
// name define o nome da chave estrangeira na tabela
@OrderBy("periodoPM")
public PerioPM getPerioPM() {
return perioPM;
}
@ElementCollection
@CollectionTable(name="judgment_court_reporter",uniqueConstraints={@UniqueConstraint(name="judgment_court_reporter_unique",columnNames={"fk_judgment","court_reporter"})})
@Column(name="court_reporter")
@OrderBy("court_reporter")
private List<String> getCourtReporters_() {
return courtReporters;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。