Struts2 Hibernate(返回一个列表,导致 hibernate 从所有关系中获取数据)
我正在使用 Struts2 jquery 创建依赖下拉菜单。问题是操作类中的 getLobList() 方法导致 hibernate 获取 lob 的所有数据。如果我删除该 getter 方法,则不会创建这些日志。为什么会出现这种情况,有什么办法可以解决吗?
JSP页面
<s:url id="remoteurl" action="getLists"/>
<sj:select
href="%{remoteurl}"
id="lob"
onChangeTopics="reloadsecondlist"
name="lobId"
list="lobList"
listKey="lobId"
listValue="lobDescription"
headerKey="-1"
headerValue="Please Select a Line of Business"
/>
Action类
public class CreateRequest extends BaseAction {
private List<Lob> lobList;
private Integer lobId;
public String execute() {
lobList = services.getLobs();
return SUCCESS;
}
public void setLobId(Integer lobId) {
this.lobId = lobId;
}
/* PROBLEM */
public List<Lob> getLobList() {
return lobList;
}
}
Lob.java
@Entity
@Table(name = "lob")
public class Lob implements java.io.Serializable {
private Integer lobId;
private String lobDescription;
private List<Application> applications;
public Lob() {
}
public Lob(String lobDescription) {
this.lobDescription = lobDescription;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "lob_id", unique = true, nullable = false)
public Integer getLobId() {
return this.lobId;
}
public void setLobId(Integer lobId) {
this.lobId = lobId;
}
@Column(name = "lob_description", nullable = false, length = 100)
public String getLobDescription() {
return this.lobDescription;
}
public void setLobDescription(String lobDescription) {
this.lobDescription = lobDescription;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "lob")
public List<Application> getApplications() {
return this.applications;
}
public void setApplications(List<Application> applications) {
this.applications = applications;
}
}
Application.java
@Entity
@Table(name = "application")
public class Application implements java.io.Serializable {
private Integer applicationId;
private Lob lob;
private String applicationMnemonic;
private String applicationName;
private List<Cta> ctas;
private List<Request> requests;
private List<Environment> environments;
public Application() {
}
public Application(Lob lob, String applicationMnemonic, String applicationName) {
this.lob = lob;
this.applicationMnemonic = applicationMnemonic;
this.applicationName = applicationName;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "application_id", unique = true, nullable = false)
public Integer getApplicationId() {
return this.applicationId;
}
public void setApplicationId(Integer applicationId) {
this.applicationId = applicationId;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "lob_id", nullable = false)
public Lob getLob() {
return this.lob;
}
public void setLob(Lob lob) {
this.lob = lob;
}
@Column(name = "application_mnemonic", nullable = false, length = 10)
public String getApplicationMnemonic() {
return this.applicationMnemonic;
}
public void setApplicationMnemonic(String applicationMnemonic) {
this.applicationMnemonic = applicationMnemonic;
}
@Column(name = "application_name", nullable = false, length = 100)
public String getApplicationName() {
return this.applicationName;
}
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "application_cta", catalog = "etech", joinColumns = {
@JoinColumn(name = "application_id", nullable = false, updatable = false)}, inverseJoinColumns = {
@JoinColumn(name = "cta_id", nullable = false, updatable = false)})
public List<Cta> getCtas() {
return this.ctas;
}
public void setCtas(List<Cta> ctas) {
this.ctas = ctas;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "application")
public List<Request> getRequests() {
return this.requests;
}
public void setRequests(List<Request> requests) {
this.requests = requests;
}
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "application_environment", catalog = "etech", joinColumns = {
@JoinColumn(name = "application_id", nullable = false, updatable = false)}, inverseJoinColumns = {
@JoinColumn(name = "environment_id", nullable = false, updatable = false)})
public List<Environment> getEnvironments() {
return this.environments;
}
public void setEnvironments(List<Environment> environments) {
this.environments = environments;
}
}
服务器日志
2010-07-30 23:10:36,340 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,350 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,351 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,352 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,353 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,354 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,355 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,356 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,356 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,357 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,358 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,359 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,360 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,361 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,361 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,362 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,363 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,363 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,364 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,364 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,365 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,365 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,366 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,366 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,367 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,367 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,368 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,368 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,369 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,369 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,370 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,370 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,371 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,371 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,372 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,374 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,374 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,375 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
I am creating dependent drop downs using Struts2 jquery. The problem is that getLobList() method inside action class is causing hibernate to fetch all data for a lob. If I remove that getter method, those logs are not created. Why is this happening any way to fix it?
JSP page
<s:url id="remoteurl" action="getLists"/>
<sj:select
href="%{remoteurl}"
id="lob"
onChangeTopics="reloadsecondlist"
name="lobId"
list="lobList"
listKey="lobId"
listValue="lobDescription"
headerKey="-1"
headerValue="Please Select a Line of Business"
/>
Action Class
public class CreateRequest extends BaseAction {
private List<Lob> lobList;
private Integer lobId;
public String execute() {
lobList = services.getLobs();
return SUCCESS;
}
public void setLobId(Integer lobId) {
this.lobId = lobId;
}
/* PROBLEM */
public List<Lob> getLobList() {
return lobList;
}
}
Lob.java
@Entity
@Table(name = "lob")
public class Lob implements java.io.Serializable {
private Integer lobId;
private String lobDescription;
private List<Application> applications;
public Lob() {
}
public Lob(String lobDescription) {
this.lobDescription = lobDescription;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "lob_id", unique = true, nullable = false)
public Integer getLobId() {
return this.lobId;
}
public void setLobId(Integer lobId) {
this.lobId = lobId;
}
@Column(name = "lob_description", nullable = false, length = 100)
public String getLobDescription() {
return this.lobDescription;
}
public void setLobDescription(String lobDescription) {
this.lobDescription = lobDescription;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "lob")
public List<Application> getApplications() {
return this.applications;
}
public void setApplications(List<Application> applications) {
this.applications = applications;
}
}
Application.java
@Entity
@Table(name = "application")
public class Application implements java.io.Serializable {
private Integer applicationId;
private Lob lob;
private String applicationMnemonic;
private String applicationName;
private List<Cta> ctas;
private List<Request> requests;
private List<Environment> environments;
public Application() {
}
public Application(Lob lob, String applicationMnemonic, String applicationName) {
this.lob = lob;
this.applicationMnemonic = applicationMnemonic;
this.applicationName = applicationName;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "application_id", unique = true, nullable = false)
public Integer getApplicationId() {
return this.applicationId;
}
public void setApplicationId(Integer applicationId) {
this.applicationId = applicationId;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "lob_id", nullable = false)
public Lob getLob() {
return this.lob;
}
public void setLob(Lob lob) {
this.lob = lob;
}
@Column(name = "application_mnemonic", nullable = false, length = 10)
public String getApplicationMnemonic() {
return this.applicationMnemonic;
}
public void setApplicationMnemonic(String applicationMnemonic) {
this.applicationMnemonic = applicationMnemonic;
}
@Column(name = "application_name", nullable = false, length = 100)
public String getApplicationName() {
return this.applicationName;
}
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "application_cta", catalog = "etech", joinColumns = {
@JoinColumn(name = "application_id", nullable = false, updatable = false)}, inverseJoinColumns = {
@JoinColumn(name = "cta_id", nullable = false, updatable = false)})
public List<Cta> getCtas() {
return this.ctas;
}
public void setCtas(List<Cta> ctas) {
this.ctas = ctas;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "application")
public List<Request> getRequests() {
return this.requests;
}
public void setRequests(List<Request> requests) {
this.requests = requests;
}
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "application_environment", catalog = "etech", joinColumns = {
@JoinColumn(name = "application_id", nullable = false, updatable = false)}, inverseJoinColumns = {
@JoinColumn(name = "environment_id", nullable = false, updatable = false)})
public List<Environment> getEnvironments() {
return this.environments;
}
public void setEnvironments(List<Environment> environments) {
this.environments = environments;
}
}
Server Log
2010-07-30 23:10:36,340 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,350 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,351 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,352 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,353 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,354 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,355 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,356 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,356 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,357 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,358 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,359 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,360 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,361 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,361 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,362 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,363 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,363 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,364 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,364 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,365 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,365 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,366 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,366 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,367 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,367 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,368 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,368 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,369 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select ctas0_.application_id as applicat1_1_, ctas0_.cta_id as cta2_1_, cta1_.cta_id as cta1_7_0_, cta1_.cta_description as cta2_7_0_ from etech.application_cta ctas0_ left outer join etech.cta cta1_ on ctas0_.cta_id=cta1_.cta_id where ctas0_.application_id=?
2010-07-30 23:10:36,369 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select environmen0_.application_id as applicat1_1_, environmen0_.environment_id as environm2_1_, environmen1_.environment_id as environm1_6_0_, environmen1_.environment_description as environm2_6_0_ from etech.application_environment environmen0_ left outer join etech.environment environmen1_ on environmen0_.environment_id=environmen1_.environment_id where environmen0_.application_id=?
2010-07-30 23:10:36,370 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select requests0_.application_id as applicat5_1_, requests0_.request_id as request1_1_, requests0_.request_id as request1_1_0_, requests0_.application_id as applicat5_1_0_, requests0_.cta_id as cta6_1_0_, requests0_.date_completed as date2_1_0_, requests0_.date_created as date3_1_0_, requests0_.assignee_employee_id as assignee7_1_0_, requests0_.assigner_emploee_id as assigner8_1_0_, requests0_.creator_employee_id as creator9_1_0_, requests0_.request_status as request10_1_0_, requests0_.statement_of_work as statement4_1_0_ from etech.request requests0_ where requests0_.application_id=?
2010-07-30 23:10:36,370 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,371 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,371 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,372 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,374 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,374 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
2010-07-30 23:10:36,375 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Hibernate: select applicatio0_.lob_id as lob4_1_, applicatio0_.application_id as applicat1_1_, applicatio0_.application_id as applicat1_4_0_, applicatio0_.application_mnemonic as applicat2_4_0_, applicatio0_.application_name as applicat3_4_0_, applicatio0_.lob_id as lob4_4_0_ from etech.application applicatio0_ where applicatio0_.lob_id=?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题。
发生这种情况是因为负责创建 JSON 结果的 JSON 插件尝试序列化整个对象及其所有关系。
为了防止这种情况,我建议您为您的数据创建一个包装器(即,您创建一个仅包含您要使用的键和值的
LobJSONWrapper
类),并且返回包装器实例的列表,而不是Lob
实例。您还可以阻止 JSON 插件序列化字段:请参阅“排除属性”此处
I've encountered the same issue.
This happens because the JSON plugin, responsible for the creation of your JSON result, tries to serialize the entire object, with all its relationships.
To prevent this, I suggest you create a wrapper for your data (that is, you create a
LobJSONWrapper
class containing ONLY the key and the value you want to use), and return a list of wrapper instances instead ofLob
instances.You can also prevent the JSON plugin from serializing a field: See "excluding properties" here
您只需要从结果对象中删除您的服务对象,为此您需要在操作映射上编写代码。
you just need to remove your service object from the result object ,to do you need to write code on action mapping.