我正在使用hibernate创建一个jar.我遇到过需要经常更改设置(url)的情况,所以我想加载hibernate.cfg.xml这样的
SessionFactory sessionFactory = new Configuration()
.configure("D:\\fax\\hibernate.cfg.xml")
.buildSessionFactory();
Run Code Online (Sandbox Code Playgroud)
但是然后运行项目我得到了这个例外
org.hibernate.HibernateException: D:\fax\hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1287)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1309)
at hibernate.LabOrderHelper.getDatabaseSesssion(LabOrderHelper.java:55)
at hibernate.Test.main(Test.java:42)
Run Code Online (Sandbox Code Playgroud)
如何hibernate.cfg.xml从类路径的不同位置加载?
我通过bootstrap应用程序使用x可编辑文件.现在我有一种情况,我需要通过按钮click.value更改我的跨度值,但如果我点击该x可编辑跨度,文本框中填充以前的值这是我的示例代码
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>Patient portal</title>
<meta name="description" content="3 styles with inline editable feature" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="assets/css/bootstrap-editable.css" />
</head>
<body ><!-- #section:basics/navbar.layout -->
<div>
<span class="editable" id="city"> intial value </span>
<button id="change">change value</button>
</div>
<script type="text/javascript">
window.jQuery || document.write("<script src='assets/js/jquery.min.js'>"+"<"+"/script>");
</script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/x-editable/bootstrap-editable.min.js"></script>
<script src="assets/js/x-editable/ace-editable.min.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">
$( document ).ready(function() {
$.fn.editable.defaults.mode = 'inline';
$.fn.editableform.loading = "<div class='editableform-loading'><i …Run Code Online (Sandbox Code Playgroud) 我有一个id没有字段的表,我真正想要的是结果raw将重复没有提交时间,如果no字段是2那么raw必须在结果中重复两次.这是我的示例表结构:
id no
1 3
2 2
3 1
Run Code Online (Sandbox Code Playgroud)
现在我需要得到一个结果:
1 3
1 3
1 3
2 2
2 2
3 1
Run Code Online (Sandbox Code Playgroud)
我试着编写mysql查询来获得上面的结果,但是失败了.
我有一个x-editable输入我的bootstrap应用程序,我用来编辑用户名.现在我需要使用jquery.maskedinput.min.js来获取蒙版格式,同时我输入文本框,当我点击跨度时,正如x-editable中那样.这是我的示例html代码
<div id="sZip" class="profile-info-value ">
<span class="editable" id="Dob">dob</span>
</div>
Run Code Online (Sandbox Code Playgroud)
我通过应用这样的j查询获得了x editable
$('#zip').editable({
type: 'text',
name: 'zip',
tpl:' <input type="text" id ="zipiddemo" class="form-control input-sm dd" style="padding-right: 24px;">'
});
Run Code Online (Sandbox Code Playgroud)
它工作正常现在我需要使该文本框可屏蔽,但当我调用这样的蒙版输入函数时
$(".dd").mask("99999-?9999");
Run Code Online (Sandbox Code Playgroud)
它不工作,我不知道确切的原因.任何帮助将不胜感激