mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix for #177 - EbeanServer.refresh() not loading/refreshing @Lob property unless it is annotated with @Basic(fetch=FetchType.EAGER)
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.Version;
|
||||
|
||||
@Entity
|
||||
public class EBasicClobFetchEager {
|
||||
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* Lob properties default to FetchType.LAZY and need to be explicitly included in a fetch
|
||||
* via query.select("*") or by defaulting them to FetchType.EAGER as this case.
|
||||
*/
|
||||
@Lob
|
||||
@Basic(fetch = FetchType.EAGER)
|
||||
private String description;
|
||||
|
||||
@Version
|
||||
private Timestamp lastUpdate;
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Timestamp getLastUpdate() {
|
||||
return lastUpdate;
|
||||
}
|
||||
|
||||
public void setLastUpdate(Timestamp lastUpdate) {
|
||||
this.lastUpdate = lastUpdate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,9 @@ public class EBasicClobNoVer {
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Note that lobs default to FetchType.LAZY - see EBasicClobFetchEager.
|
||||
*/
|
||||
@Lob
|
||||
private String description;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user