我正在使用Spring和Hibernate与MySQL开发应用程序.我是Hibernate的新手并完成了基本任务......
现在我需要在select查询中应用连接以使用注释从多个表中获取数据.我已经搜索过了,但我仍然没有想到......
这是我的数据库表和bean类:
Table 1: 'employee_info' ( id, empid, empname, doj and jobtitle )
Table 2: 'employee_login' ( username, password, status and empid )
Run Code Online (Sandbox Code Playgroud)
我的bean类是:
EmployeeInfoForm.java
@Entity()
@Table(name = "employee_info")
public class EmployeeInfoForm {
@Id
@GeneratedValue
@Column(name = "id", unique = true, nullable = true)
private int id;
@Column(name = "empId")
private int empId;
@Column(name = "empname")
private String empName;
@Column(name = "doj")
private Date empDoj;
@Column(name = "jobtitle")
private String empJobTitle;
public int getEmpId() {
return empId;
}
public …Run Code Online (Sandbox Code Playgroud) 我正在为我的应用程序使用Spring 3.1.0 JAR.我通过命令名称将我的bean类映射到了视图,我对映射它没有问题.
问题是int我的bean类中有一个变量:
private int id;
Run Code Online (Sandbox Code Playgroud)
当我用这个变量映射时<'form:input path="id" />',它0在文本框中给出了我不想要的默认值.我怎么能摆脱这个?
我有两个html页面..我正在从孩子那里调用父窗口.所有的东西都很棒.但是在Chrome中它失败了..我知道原因..
test1.html: -
<html>
<head>
<title>Compose</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<SCRIPT>
function test(){
//alert('');
var win = window.open('../login/test2.html',"","height=700,width=800");
}
function test1(){
alert('test1');
}
</SCRIPT>
</head>
<body>
<input type="button" value="click" onclick="test();" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
test2.html: -
<html>
<head>
<title></title>
<SCRIPT>
function opener1(){
try{
if(window.opener != null && !window.opener.closed)
{
}
window.opener.test1();
}catch(e){ alert(e.description);}
}
</SCRIPT>
</head>
<body oncontextmenu="return false" ondragstart="return false" onload="opener1();">
<h1>Test Page</h1>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
来自test2.html的test1.html中的调用方法无法正常工作..任何解决方案......都认可.谢谢
您好我已经尝试过这两个代码在slickgrid中插入一个新行.
代码-1:
data1.push({id: "12345", name: "secKey", field: "secKey", complete:true});
//grid1.setData(data1);
//grid1.render();
Run Code Online (Sandbox Code Playgroud)
它在光滑的网格单元格中插入未定义的..
代码-2:
try{
var rowData = grid1.getData();
//alert(rowData+"rowdata");
newId = dataView1.getLength();
//alert(newId);
newRow.id = newId + 1;
//alert(newRow.id);
var newRow = {title: "new Title"};
//alert(newRow);
dataView1.insertItem(newRow.id, newRow);
alert("end");
}catch(e){
alert("error:"+e.description);
}
Run Code Online (Sandbox Code Playgroud)
代码2捕获并给出错误..我知道wat我必须做代码更改.
spring ×2
annotations ×1
forms ×1
hibernate ×1
html ×1
java ×1
javascript ×1
join ×1
slickgrid ×1
spring-3 ×1
spring-mvc ×1