这似乎是一个愚蠢的问题,VS2010告诉mit,System.Windows.Forms.Design只包含9个类,而MSDN列表20+.
我想要的只是写下面的类(http://msdn.microsoft.com/en-us/library/ms973820.aspx):
public class DragDropControlDesigner : ControlDesigner {
public override void Initialize(IComponent c) {
base.Initialize(c);
((Control)c).AllowDrop = false;
}
}
Run Code Online (Sandbox Code Playgroud)
项目引用和用户指令没有帮助.我甚至积极地使用该课程
[Designer("System.Windows.Forms.Design.ParentControlDesigner,
System.Design",
typeof(IDesigner))]
Run Code Online (Sandbox Code Playgroud)
在我的一个用户控件上.我搜索了教程和论坛上的答案:什么都没有.那里有人,谁写过定制设计师,可以告诉我如何解决这个问题?
在我们的数据库中,我们有多个带有日期字段的实体。Oracle认为每个日期都是相同的,带有日期和时间部分。但是,JPA实体通过注释@Temporal进行区分。当我们想省略时间部分时,我们用@Temporal(TemporalType.DATE)注释Date字段,Oracle保存00:00:00,如果不是,我们就不加注释。
例:
@Entity
public class MyEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private long myentityId;
@Temporal(TemporalType.DATE)
private Date importantDate; //01.01.2015 00:00:00
private Date creationDate; //01.01.2015 10:35:51
...
}
...
MyEntity me = new MyEntity();
me.setImportantDate(new Date());
me.setCreationDate(new Date());
...
Run Code Online (Sandbox Code Playgroud)
我们从甲骨文11升级到Oracle 12,现在的时间部分importantDate不再省略!
我使用完全相同的程序在两个数据库上对此进行了广泛的测试。这实际上破坏了我们的应用程序。
我该怎么做才能恢复以前的行为?
更新1:我缩小了范围:驱动程序ojdbc6 12.1.0.1.0出现了问题,ojdbc6 11.2.0.3.0可以正常工作。(都使用Oracle 12 DB)
这是11.1中解决的时间戳问题的延续吗?(http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#08_01)
更新2:由于似乎不是Hibernate的问题,所以我用纯JDBC编写了一个示例:
OracleDataSource ods = new OracleDataSource();
...
Connection conn = ods.getConnection();
PreparedStatement ps = conn.prepareStatement("UPDATE MyEntity SET importantDate = ? WHERE myentityId …Run Code Online (Sandbox Code Playgroud) 一段时间以来,我想使用eclipse的更新功能.但每次都找不到一些(可能是过时的)存储库.我仍然希望其他部分更新,但这个错误只会阻止一切.
我该如何解决该问题,即修改已检查存储库的列表?代理设置肯定是正确的,因为"安装新软件"工作正常.
错误信息:
Some sites could not be found. See the error log for more detail.
HTTP Server 'Service Unavailable': org.apache.maven/content.xml
HttpClient connection error response code 503.
No repository found at maven.apache.org.
No repository found at subclipse.tigris.org/.
No repository found at github.com/cbeust/testng-eclipse.git.
No repository found at download.eclipse.org/mat/1.0/update-site/.
No repository found at download.eclipse.org/tools/orbit/downloads/drops/R20100519200754/updateSite/.
HTTP Server 'Service Unavailable': org.apache.maven.plugins/content.xml
HttpClient connection error response code 503.
No repository found at github.com/cbeust/testng-eclipse.
No repository found at beust.com/eclipse.
Unable to read repository at dev2devclub.bea.com/updates/eclipse-3.3/wls-plugins/content.xml.
The …Run Code Online (Sandbox Code Playgroud) 我正在实现一个EJB应用程序.此时我需要一个交易.我需要在行中执行3个方法,如果一个失败,应该回滚所有内容.在这里:http://www.conceptgo.com/gsejb/eb04.html,我找到了一个教程.我的代码:
try {
javax.transaction.UserTransaction ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
ut.begin();
Feeds feed = loadFeed(url);
try{
em.persist(feed);
uf.setFeedId(feed.getFeedId());
uf.setUserId(user_id);
em.persist(uf);
}catch (EntityExistsException e){
ut.rollback();
return false;
}catch (IllegalArgumentException ea){
ut.rollback();
return false;
}
if (feed.getFeedId()!= null && feed!=null) {
ut.commit();
}else{
ut.rollback();
return false;
}
Run Code Online (Sandbox Code Playgroud)
当我运行我的应用程序时,我收到下一条错误消息
Caused by: java.lang.IllegalStateException: BaseTransaction.checkTransactionState
- ARJUNA016051: thread is already associated with a transaction
Run Code Online (Sandbox Code Playgroud)
谁知道原因是什么以及如何解决?