NutzCN Logo
问答 设置主键uuid出错
发布于 212天前 作者 qq_412bd180 156 次浏览 复制 上一个帖子 下一个帖子
标签:

@Name//字符主键
@Prev(els = { @EL("uuid()") })
private String id;

提示@EL报错 EL cannot be resolved to a type

7 回复

nutz的什么版本,忘记import了?

org.nutz
nutz
1.r.60

@Name //注意,字符串主键用@Name,与属性名称无关!!!
@Prev(els=@EL("uuid(32)")) // 可以是 uuid() uuid(32)

提示 The value for annotation attribute Prev.els must be some @org.nutz.dao.entity.annotation.EL annotation

你import错了

package io.longview.qxpro.beans.local;

import java.util.Date;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Prev;
import org.nutz.dao.entity.annotation.Table;


@Table("base_ultra_violet_light_score")
public class UltravioletLightScore {

	@Name //注意,字符串主键用@Name,与属性名称无关!!!
	@Prev(els=@EL("uuid(32)")) // 可以是 uuid() uuid(32)
	private String id;
	@Column
	private Date create_date;	//录入时间
	@Column
	private String date_time;	//时次
	@Column
	private double precision_yesterday; 	//紫外线预报前一日下午精度
	@Column
	private double precision_today; 	//紫外线预报当日上午精度
	@Column
	private double score; 	//紫外线预报当日评分
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public Date getCreate_date() {
		return create_date;
	}
	public void setCreate_date(Date create_date) {
		this.create_date = create_date;
	}
	public String getDate_time() {
		return date_time;
	}
	public void setDate_time(String date_time) {
		this.date_time = date_time;
	}
	public double getPrecision_yesterday() {
		return precision_yesterday;
	}
	public void setPrecision_yesterday(double precision_yesterday) {
		this.precision_yesterday = precision_yesterday;
	}
	public double getPrecision_today() {
		return precision_today;
	}
	public void setPrecision_today(double precision_today) {
		this.precision_today = precision_today;
	}
	public double getScore() {
		return score;
	}
	public void setScore(double score) {
		this.score = score;
	}
	
	
}

import org.nutz.dao.entity.annotation.EL;

搞定 谢谢!

添加回复
请先登陆
回到顶部