我有两节课.一个被调用Employee,另一个EmployeeDetails与其父'Employee'类具有零或一个关系.换句话说,在某些情况下我们需要将额外的数据存储到此类中,'EmployeeDetails'但这不一定是常态.db结构非常简单,"EmployeeDetails"与其父级共享相同的ID.
我得到的问题是'EmployeeDetails'从'Employee'类中删除类,我会想象将对象设置为null将完成技巧和刷新会话但不删除数据库中的记录.
我的映射是......
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="StudioBusinessLayer.Data.Structure.Employee, StudioBusinessLayer" table="tblEmployee" lazy="false">
<id name="ID" column="ID" type="int">
<generator class="native" />
</id>
<property name="Name" column="Name" not-null="true" type="string" length="100" />
<!-- etc -->
<one-to-one constrained="false" name="EmployeeDetails" class="StudioBusinessLayer.Data.Structure.EmployeeDetails, StudioBusinessLayer" cascade="all-delete-orphan" />
</class>
</hibernate-mapping>
Run Code Online (Sandbox Code Playgroud)
...以及EmployeeDetails类......
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="StudioBusinessLayer.Data.Structure.EmployeeDetails, StudioBusinessLayer" table="tblDetails" lazy="false">
<id name="ID" column="DetailsID" type="int">
<generator class="foreign">
<param name="property">Employee</param>
</generator>
</id>
<property name="Address" column="Address" not-null="false" type="string" …Run Code Online (Sandbox Code Playgroud) 我想使用游标删除数据库的所有同义词(sql server 2008 r2).环境 - 数据库名称 - 'mydatabase',模式名称 - 'dbo'..你可以指导我,因为我尝试但是...结束时的声明,是不能删除同义词.wrt游标应该应用什么逻辑?
FileInputStream在J2ME中有没有相同的东西?
我需要这样做,但使用Drupal形式:
<input type="button" class="button-user" value="Back" onclick="location.href='edit'"/>
Run Code Online (Sandbox Code Playgroud)
我试过这样做,但它不起作用:
$form['back']['#prefix'] = "<input type='button' class='button-user' value='Back' onclick='location.href='edit''/>;
Run Code Online (Sandbox Code Playgroud)
并且:
$form['back'] = array(
'#type' => 'button',
'#value' => 'Back',
'#attributes' => array(
'class' => 'button-user',
'onclick' => 'location.href=edit',
)
);
Run Code Online (Sandbox Code Playgroud) 我有一个spring集成+批处理应用程序.
集成用于使用inboun通道适配器读取文件并调用批处理作业.jobRepository定义于:org.springframework.batch.core.repository.support.JobRepositoryFactoryBean
事务管理器是org.springframework.orm.jpa.JpaTransactionManager.
当应用程序启动时,我不知道为什么,但我读了这种奇怪的配置:
[5860] [2012-03-12 17:40:47,267] D [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] Adding transactional method [*] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT]
[5860] [2012-03-12 17:40:47,267] D [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] Adding transactional method [create*] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_SERIALIZABLE]
[5860] [2012-03-12 17:40:47,267] D [main] [org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource] Adding transactional method [getLastJobExecution*] with attribute [PROPAGATION_REQUIRES_NEW,ISOLATION_SERIALIZABLE]
Run Code Online (Sandbox Code Playgroud)
似乎默认情况下,每个jobmethod都配置了隔离SERIALIZABLE,但我没有设置它.知道如何将默认隔离级别设置为ISOLATION_DEFAULT吗?
使用带有Python 2.7和Django 1.4的Window 7 64Bit.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Django-1.4\django\bin\cms2>manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Traceback (most recent call last):
File "C:\Django-1.4\django\bin\cms2\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
443, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 196,
in run_from_argv
self.execute(*args, **options.__dict__)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 232,
in execute
output = self.handle(*args, **options)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 371,
in handle
return …Run Code Online (Sandbox Code Playgroud) 我使用的是JSF 1.2
我有一个应该可点击的图像.以下是我编码的方式,
<h:commandLink value="" action="#{myBean.myMethod}>
<h:graphicImage value="image-location-in-webserver" />
</h:commandLink>
Run Code Online (Sandbox Code Playgroud)
使用h:commandLink是因为点击这个图像我必须做一些业务验证,因此我需要在bean中调用一个方法.
我的豆是一个session范围.由于其他一些问题,我不能满足要求范围.
我尝试javax.faces.STATE_SAVING_METHOD将其设置为客户端而不是服务器.
即使这样,当我的页面被渲染时,图像也没有被渲染,因为当在web开发人员中查看时,jsessionid会被添加到url中.
http:/myDomail/static-files/images/myImage.jpg;jsessionid=77F2A5D24CF1D5C3C4882778BC521263.node1
Run Code Online (Sandbox Code Playgroud)
如果未附加jsessionid,则会渲染我的图像.
我怎样才能做到这一点?
我正在实现一个asyncTask从服务器加载数据的类.我已经有了数据,我想将它传递给UI线程,但我不知道如何.
这是代码:
public class InboxHandler extends FragmentActivity implements OnLineSelectedListener {
static final int GET_CODE = 0;
private TextView textView3, textView2;
private Button button1, button2, button3;
private LinearLayout tab1, tab2, tab3;
private CheckBox cbVerPorCategoria;
private ActionBar actionBar;
private TextView txtTitle;
private Settings settings;
FragmentTransaction fragmentTransaction;
BottomPanel bottomPanel;
public List<OrderRequest> orderRequestArray;
private OrderRequestParser orderRequestParser;
public static int number;
int clickCounter = 0;
private boolean doubleBackToExitPressedOnce = false;
private static Context context;
DataLoader dataLoader;
private MyAsynckTask myAsynckTask;
public InboxHandler(){}
public List<OrderRequest> …Run Code Online (Sandbox Code Playgroud) 我最近在本教程中读到某些jQuery泄漏可以通过$.cache变量进行跟踪,你应该总是检查它的大小,如果它太大,你做错了.
嗯,有多大太大了?有没有办法检查变量,看看它吃多少内存?
我正在开发一个只通过加载主页来缓存210个对象的网站.太多了吗?我很感激在这里对这个问题进行彻底的解释.
c# ×2
android ×1
api ×1
asp.net ×1
button ×1
charts ×1
django ×1
drupal ×1
forms ×1
java ×1
java-me ×1
javascript ×1
jquery ×1
jsf-1.2 ×1
memory-leaks ×1
nhibernate ×1
onclick ×1
organization ×1
python ×1
spring-batch ×1
transactions ×1
windows ×1