我正在使用Ejb3和JPA(目前基于Hibernate和Oracle 10g)
我有一个包含clob的实体
@Entity
@Table(name = "My_TAB")
public class ExampleEntity implements java.io.Serializable {
private Clob someText;
public void setSomeText(Clob someText) {
this.someText= someText;
}
@Column(name = "COLUMN_NAME")
public Clob getSomeText() {
return this.someText;
}
Run Code Online (Sandbox Code Playgroud)
然后我想保存这种类型的实体.
目前我正在做以下工作,完美无缺
ExampleEntity exampleEntity = new ExampleEntity();
exampleEntity.setSomeText(Hibernate.createClob(aStringValue));
someOtherDao.save(exampleEntity);
Run Code Online (Sandbox Code Playgroud)
然而,这将我的代码与Hibernate联系在一起!到目前为止,我已经特别避免了Hibernate扩展,只使用了JPA注释.代码有效,因为Hibernate确实是我当前的实现.
是否有某种JPA API允许我以通用方式创建clob?所以,如果以后我决定切换到Toplink/EclipseLink或其他东西我不需要改变一件事情?
我需要为新项目选择模拟框架.
这些框架的优缺点是什么?任何比较表?
我知道JustMock是我的beta阶段,但它现在看起来非常好(非常类似于TypeMock)
编辑:我怎么样MS鼹鼠?
我有一个带有以下 CSS 的居中包装器:
div.wrapper {
width: 1170px;
padding-left:30px;
margin-top: 80px;
margin-bottom:20px;
margin-left: auto;
margin-right: auto;
position:relative;
background-color:black; }
Run Code Online (Sandbox Code Playgroud)
在我里面我有一个带有以下 css 的 div:
position:absolute;
top:-26px;
left:517px;
height:63px;
z-index:3;
Run Code Online (Sandbox Code Playgroud)
这个 div 内部是一个宽度为 759px 的图像,这使得包装器变得更大,并使浏览器在较低的显示分辨率上显示 v-scrollbar。我想要的是使图像超出包装器但防止浏览器显示滚动条,以便仅在浏览器窗口足够大并且包装器保持其 1200px 宽度时才显示图像的右侧。我不能把它变成背景图片,因为它覆盖了其他一些内容。与 >= IE7 兼容的东西会很好。
我上传了一张页面图片来说明我的意思:http : //img153.imageshack.us/img153/6070/hpx.jpg
蓝色框是包装器,它有 1200 像素的宽度并且总是在窗口中居中(除非窗口小于 1200 像素,然后它会滚动)红色框是图像(绿色条不是它的一部分)
在我的应用程序中,我有一些链接按钮,但当我右键单击它们我不能(它们处于禁用模式)找到菜单项Open in new tab或Open in new window.
如何显示这些菜单项?
代码示例:
<asp:LinkButton id="lbnkVidTtile1" runat="Server" CssClass="bodytext" Text='<%#Eval("newvideotitle") %>' />
Run Code Online (Sandbox Code Playgroud) 是否有任何方法可以在启用NetFx40_LegacySecurityPolicy的情况下执行遗留设计时代码?
更具体地说,是否有任何方法可以让DevExpress 8.2 winforms设计师在VisualStudio 2010中工作?
由于这个问题我得到了错误,并没有找到关于设计时模式的帮助,只是关于运行时:
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
Run Code Online (Sandbox Code Playgroud)
我该如何解决winforms设计师的问题?
如果是,我们是否还可以获得有关网络配置的其他信息?
一种有用的方法是获取当前网络的SSID.有没有API可以做到这一点?
更新:我在这里发现了一个类似的问题:
我正在用Java编写模拟,其中对象在牛顿物理学下运作.物体可以施加力,并且所产生的速度使其在屏幕上移动.模拟的本质意味着对象根据动画循环的当前和上一次迭代之间的时间间隔以不连续的步骤移动; 例如
public void animationLoop() {
long prev = System.currentTimeMillis();
long now;
while(true) {
long now = System.currentTimeMillis();
long deltaMillis = now - prev;
prev = now;
if (deltaMillis > 0) { // Some time has passed
for (Mass m : masses) {
m.updatePosition(deltaMillis);
}
// Do all repaints.
}
}
}
Run Code Online (Sandbox Code Playgroud)
如果动画线程以某种方式延迟导致大量时间坍塌(经典案例在Windows下,单击并保持最小化/最大化防止重新绘制),则会出现问题,这会导致对象以惊人的速度移动.我的问题:有没有办法确定动画线程花费的时间而不是挂钟时间,或者有人可以建议一个解决方法来避免这个问题吗?
到目前为止,我唯一的想法是deltaMillis通过一些上限来构建.
我试图用cllocation和mkreversegeocoder来修改城市名称.在我的viewdidload方法我istance cllocationmanager:
self.locManager = [[CLLocationManager alloc] init];
locManager.delegate = self;
locManager.desiredAccuracy = kCLLocationAccuracyBest;
[locManager startUpdatingLocation];
Run Code Online (Sandbox Code Playgroud)
之后:
- (void) locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation
*)newLocation
fromLocation:(CLLocation *)oldLocation {
//some code to retrieve my information
MKReverseGeocoder *geoCoder = [[MKReverseGeocoder alloc]
initWithCoordinate:newLocation.coordinate ];
geoCoder.delegate = self;
[geoCoder start];
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark
*)placemark
{
MKPlacemark *myPlacemark = placemark;
citta.text = [placemark locality];
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{
citta.text =@ "Unknow";
Run Code Online (Sandbox Code Playgroud)
应用程序仅在我第一次获得我的价值时起作用.在第二次应用程序崩溃.我认为是因为地理编码器已启动,我认为我必须只有一个运行.(但我真的不是这个......).在哪种方式我可以控制地理编码器正在运行?
我已经看到我可以使用cllocationcoordinate2d在我的viewdidload中使用mkreversegeocoder但是...以这种方式我可以检索newlocation.coordinate?
我已经部分解决了将地理编码器声明为类变量并进行检查的问题
if (self.geocoder != nil) {
[geocoder release];
}
Run Code Online (Sandbox Code Playgroud)
但是....如果在我的
- …Run Code Online (Sandbox Code Playgroud) 我想定义一个名为的类型Int_1_100_Type,它是integer1到100范围内的变量.我该如何定义这个?
例如:我将此变量传递给接受变量类型的函数Int_1_100_Type,
funca(Int_1_100_Type Var1)
iphone ×2
java ×2
architecture ×1
asp.net ×1
c ×1
cllocation ×1
clob ×1
css ×1
detect ×1
devexpress ×1
hibernate ×1
html ×1
java-2d ×1
jpa ×1
justmock ×1
moq ×1
n-layer ×1
networking ×1
rhino-mocks ×1
ssid ×1
typedef ×1
typemock ×1
wifi ×1