hibernate中的条件saveOrUpdate(Conditional saveOrUpdate in hibernate)
我有一个具有日期属性的映射类。 我想saveOrUpdate这个类的对象,以便只有比存储的更旧时才更新已存在的对象。
我该怎么做(尽可能整齐有效)?
我有很多这样的课程,所以我希望避免为所有这些课程编写大量的自定义HQL。
I have a mapped class that has a date property. I would like to saveOrUpdate objects of this class so that already existing is updated only if it is older than the stored one.
How would I do that (neatly and efficiently if possible)?
I have a lot of classes like this so I would hope to avoid writing tons of custom HQL for all of them.
原文:https://stackoverflow.com/questions/10121236
最满意答案
如果您使用matplotlib只是为了使用默认字体等显示某些图表,您可以在
dist/mpl-data
文件夹中删除除matplotlib.conf和matplotlibrc以外的所有文件夹。我这样做了,在12MB上节省了4MB。
为什么你的dist是43.5MB可能不是全部由于matplotlib ......
If you're using matplotlib just to show some chart using default font etc you can just delete in
dist/mpl-data
folder all but matplotlib.conf and matplotlibrc.I did this and saved up abot 4MB on 12MB.
Why your dist is 43.5MB probably is not all due to matplotlib...
相关问答
更多-
解决了: 因此,使用快速手指(并使用带有--debug选项的PyInstaller编译它),我对包含Traceback的快速关闭控制台窗口进行了屏幕截图: WindowsError: [Error 3] The system cannot find the path specified: 'C:\\path\\dateutil\\zoneinfo/*.*' zoneinfo文件保存在pytz而不是dateutil中。 快速重命名解决了这个问题。 但只是问题,如果你想用-F或--onefile进行编译,由于最 ...
-
有时我发现py2exe无法包含软件包,即使在packages选项中列出,但是我发现如果我在setup.py中导入软件包它会开始工作,所以尝试添加,靠近setup.py的顶部: import assimulo 你有时会发现它 if False: import assimulo 会工作,(使用这是assimulo在导入时做了很多设置)。 The solution to my problem was obtained by adding, in the includes option, the alg ...
-
您应该明确包含matplotlib模块。 如果你这样做,你可以从不可用的dll中获得一些错误,那么你应该排除它们。 一个适用于我的文件的设置: from distutils.core import setup import py2exe import matplotlib setup(console=['afile.py'], options={ 'py2exe': { 'packages' : ['matpl ...
-
从你的编辑看来,问题似乎与访问一些打包的插件(而不是yapsy模块本身)有关。 为此,您可能需要检查以下两点: 当你调用self.manager.setPluginPlaces(["plugins"])注意路径“plugin”可能与您认为的目录无关。 您应该使用更具体的路径,使用py2exe的“where Am I”常见问题解答提示: http ://www.py2exe.org/index.cgi/WhereAmI 您也可以尝试将插件打包为data_files(就像您链接到的网页一样),我不确定py2ex ...
-
使用py2exe的问题(Issues Using py2exe)[2023-07-25]
您的问题是您正在尝试使用IDLE编译脚本。 当你使用py2exe ,你必须做一点点不同。 如果你之前使用过Disutils,你可能已经看过: python setup.py install 与使用py2exe的方式相同。 所以输入cmd: python untitled-22.py py2exe 它应该工作。 顺便说一句,我建议你在py2exe.org上阅读本教程。 Your problem is that you are trying to compile your script using IDL ... -
这不是一个错误,它只是一个关于被弃用的类的警告; 在这种情况下,不推荐使用sets模块,新代码现在应该使用内置的set类。 Its not an error, its just a warning about a deprecated class; in this case the sets module is deprecated and the new code should use built-in set class now.
-
我找到了更好的解决方案....使用Pyinstaller帮助我轻松地将.py转换为.exe .... I found a better solution....Using Pyinstaller helped me converting the .py to .exe easily....
-
那么它不会失败吗? 您希望msvcr71.dll与exe在同一目录中,以便库加载器能够找到并将其链接到应用程序的内存映射中。 它是基本操作所必需的,所以你不能让py2exe用其余的DLL解压缩它。 Wouldn't it fail to launch, then? You want msvcr71.dll in the same directory as the exe, so that the library loader will be able to find and link it into the ...
-
如果您使用matplotlib只是为了使用默认字体等显示某些图表,您可以在dist/mpl-data文件夹中删除除matplotlib.conf和matplotlibrc以外的所有文件夹。 我这样做了,在12MB上节省了4MB。 为什么你的dist是43.5MB可能不是全部由于matplotlib ...... If you're using matplotlib just to show some chart using default font etc you can just delete in di ...
-
我通过稍微修改用于创建可执行文件的setup.py文件来解决: from distutils.core import setup import py2exe # We need to import the glob module to search for all files. import glob # We need to exclude matplotlib backends not being used by this executable. You may find # that you ...