首页 \ 问答 \ 如果我们在使用Hibernate3时同时拥有hbm和注释文件会发生什么?(What happen if we have both hbm as well as annotation file while using Hibernate3?)

如果我们在使用Hibernate3时同时拥有hbm和注释文件会发生什么?(What happen if we have both hbm as well as annotation file while using Hibernate3?)

我的问题不太好,但我很想知道这一点。

假设我有10个表,并且我正在使用Hibernate3,当我将5个表使用Annotation和5个表的HBM文件时,会发生任何错误。


My question is not so good,But I am curious to know this.

Suppose I have 10 tables, and I am using Hibernate3, anything wrong would happens, when I will use Annotation for 5 tables, and HBM files for 5 tables.


原文:https://stackoverflow.com/questions/8445737
更新时间:2022-09-20 11:09

最满意答案

这样做的一种方法是在本地存储中设置某种“时间”属性(如果不存在)。

if (localStorage.getItem('time') === null) {
  localStorage.setItem('time', 0);
}

然后在循环期间,您可以增加本地存储中保存的时间量。

var intervalTime = 1000;
setInterval(function() {
  // localStorage saves as strings so lets make it an integer
  var totalTime = parseInt(localStorage.getItem('time'));
  localStorage.setItem('time', totalTime + intervalTime);
}, intervalTime);

这将节省用户在您的网站上花费的总毫秒数。 然后,您可以使用这些毫秒来显示他们在网站上的时长。

var totalMilliseconds = parseInt(localStorage.getItem('time'));
var totalTime = new Date(totalMilliseconds);
var hours = totalTime.getHours();
var minutes = totalTime.getMinutes();
var seconds = totalTime.getSeconds();

One way of doing this would be to set some kind of "time" property in the local storage if one doesn't exist.

if (localStorage.getItem('time') === null) {
  localStorage.setItem('time', 0);
}

Then during a loop, you can increment the amount of time saved in the local storage.

var intervalTime = 1000;
setInterval(function() {
  // localStorage saves as strings so lets make it an integer
  var totalTime = parseInt(localStorage.getItem('time'));
  localStorage.setItem('time', totalTime + intervalTime);
}, intervalTime);

This will save the total number of milliseconds the user has spent on your site. You can then use those milliseconds to show how long they've been on the site.

var totalMilliseconds = parseInt(localStorage.getItem('time'));
var totalTime = new Date(totalMilliseconds);
var hours = totalTime.getHours();
var minutes = totalTime.getMinutes();
var seconds = totalTime.getSeconds();

相关问答

更多
  • 好吧,重复的项目发生在StorageObject.push(itemProperties) 。 试试这个来更新对象: //StorageObject.push(itemProperties); <-- remove StorageObject[thisItemsListID] = itemProperties; [编辑] 如果你想保留[{"1":{"property1":false,"property2":false}},{"2":{"property1":false,"property2":false} ...
  • 您不应存储文字clicks ,而应存储具有该名称的变量。 在clicks时调用parseInt也没有意义,因为它已经是一个数字。 此外,localStorage将所有内容存储为字符串,因此无论如何,它最终都会以字符串形式存储。 储存: localStorage.setItem('clicks', clicks); // is always stored as string 读: clicks = +localStorage.getItem('clicks'); // `+` makes it a numb ...
  • 如果在函数内多次引用相同的本地存储值,则在该函数的持续时间内将其分配给局部变量。 这与需要一些工作来检索的任何其他值(例如DOM中的输入字段的值)没有什么不同。 如果在同一函数中多次需要该值,则将其值放在局部变量中并从那里使用它。 您的代码可能会更紧凑,执行速度也更快。 应该没有理由将其全局缓存在持久性全局变量中,因为它已经可以从本地存储全局访问,因此实际上没有理由为它添加新的全局变量。 只需检索您需要的每个函数中的值。我能想到的唯一例外是在极少数情况下进行微观性能优化。 通常,最好不要制作全局可用的全局副 ...
  • 这样做的一种方法是在本地存储中设置某种“时间”属性(如果不存在)。 if (localStorage.getItem('time') === null) { localStorage.setItem('time', 0); } 然后在循环期间,您可以增加本地存储中保存的时间量。 var intervalTime = 1000; setInterval(function() { // localStorage saves as strings so lets make it an integer ...
  • 请遵循以下示例: localStorage.setItem("score", 123.465); //Set value var score = localStorage.getItem("score"); ///Get value as string //Convert var score1 = parseInt(score)//Returns 123 var score2 = parseFloat(score)//Returns 123.465 console.log(score1,score2); ...
  • $(function() { $('#mainform').on('dialogclose', function(event, ui) { if ('localStorage' in window) { if ( localStorage.getItem('test') ){ $(this).remove(); } else { localStorage.setItem(' ...
  • 本地存储中的值始终为字符串 。 您可以在分配money之前使用parseFloat 。 money = parseFloat(localStorage.getItem("money")); The values in Local Storage are always a string. You could use parseFloat before you assign money. money = parseFloat(localStorage.getItem("money"));
  • 当你从localStorage获取项目时,它是一个字符串 - 对该值执行parseInt以将其转换回整数: potatoes = parseInt(localStorage.getItem('potatoes'), 10); When you get the item from localStorage, it's a string - do a parseInt on that value to convert it back to an integer: potatoes = parseInt(loc ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。