我在下面有一个映射的超类:
<uses-permission android:name="android.permission.WAKE_LOCK" tools:node="remove" />
一个实体扩展它:
@MappedSuperclass
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "VERSIONABLE_TYPE")
public class Versionable extends VMAuditedObject implements Serializable,
Comparable<Versionable> {
private static final long serialVersionUID = 1L;
@Basic(optional = false)
@NotNull
@Min(0)
@Column(name = "major_version")
private int majorVersion;
@Basic(optional = false)
@NotNull
@Min(0)
@Column(name = "mid_version")
private int midVersion;
@Basic(optional = false)
@NotNull
@Min(1)
@Column(name = "minor_version")
private int minorVersion;
...
}
如何查询Versionable上定义的字段?
public class Project extends Versionable {
....
}
我收到以下错误:
"select from project "
+ "where major_version=" + p.getMajorVersion()
+ " and mid_version=" + p.getMidVersion()
+ " and minor_version=" + p.getMinorVersion();