首页 \ 问答 \ JPA Hibernate帮助!(JPA Hibernate Help!)

JPA Hibernate帮助!(JPA Hibernate Help!)

我刚学过JPA。 我创建了一个简单的程序,它返回查询“SELECT ...”。 不幸的是,我总是得到一个例外

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to application.Model
   at application.Main.main(Main.java:33)

我无法理解为什么,但我尝试使用String.valueOf(...)到该行并返回相同的异常。

所有代码都在这里


I have just studied about JPA. And I had created a simple program which return the query "SELECT ...". Unfortunately, I always get an exception like

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to application.Model
   at application.Main.main(Main.java:33)

I can't understand why, yet I tried using String.valueOf(...) to the line and returns the same exception.

All of the codes are present here.


原文:https://stackoverflow.com/questions/5577827
更新时间:2023-08-24 11:08

最满意答案

这是您需要的基础知识。

Sub WriteToTextBox()
Dim tb As Shape
Dim sld As Slide
Dim pres As Presentation
Dim var1 As String


var1 = InputBox("Var1")
Set pres = ActivePresentation
Set sld = pres.Slides(23) 'Modify as needed

Set tb = sld.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 100, 50) 'Modify dimensions as needed
    tb.name = "unique name"  '< assign a unique name to the textbox so you can refer to it later
    tb.TextFrame.TextRange.Text = var1



End Sub

Sub ReadFromTextBox()
Dim s$
Dim sld As Slide
Dim pres As Presentation
Set pres = ActivePresentation
Set sld = pres.Slides(23) 'Modify as needed


s = sld.Shapes("unique name").TextFrame.TextRange.Text 'Read the value from the textbox
MsgBox s 

End Sub

Here's the basics of what you need.

Sub WriteToTextBox()
Dim tb As Shape
Dim sld As Slide
Dim pres As Presentation
Dim var1 As String


var1 = InputBox("Var1")
Set pres = ActivePresentation
Set sld = pres.Slides(23) 'Modify as needed

Set tb = sld.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 100, 50) 'Modify dimensions as needed
    tb.name = "unique name"  '< assign a unique name to the textbox so you can refer to it later
    tb.TextFrame.TextRange.Text = var1



End Sub

Sub ReadFromTextBox()
Dim s$
Dim sld As Slide
Dim pres As Presentation
Set pres = ActivePresentation
Set sld = pres.Slides(23) 'Modify as needed


s = sld.Shapes("unique name").TextFrame.TextRange.Text 'Read the value from the textbox
MsgBox s 

End Sub

相关问答

更多
  • 这是您需要的基础知识。 Sub WriteToTextBox() Dim tb As Shape Dim sld As Slide Dim pres As Presentation Dim var1 As String var1 = InputBox("Var1") Set pres = ActivePresentation Set sld = pres.Slides(23) 'Modify as needed Set tb = sld.Shapes.AddTextbox(msoTextOrienta ...
  • http://vba.relief.jp/powerpoint-vba-get-active-slide-number/ 设置当前幻灯片变量的方法是 foo = ActiveWindow.Selection.SlideRange.SlideIndex 然后使用Call slide2(slidesCount)调用该函数 请尝试以下方法 Sub CreatePres() Dim ppApp As PowerPoint.Application Dim ppPres As PowerPoint.Pr ...
  • 这应该工作。 如果没有,让我们知道出了什么问题: Option Explicit ' Always start with this; it forces you to ' declare your variables properly Dim var1 as integer Dim var2 as integer sub button1() var1 = 1 var2 = 0 end sub sub button2() var2 = 1 end sub sub button exit() If v ...
  • 我不清楚问题到底是什么。 您是否需要知道如何根据现有模板开始新的演示文稿? 如果是这样,你打开你的模板文件,好像它是一个演示文稿,然后立即将其保存为演示文稿(而不是开始一个新的演示文稿和应用模板,这将只给你设计,但没有任何内容..幻灯片...模板文件)。 我也不明白为什么你期望所有的应用程序,Word,Excel,PowerPoint和其他应用程序是相同的。 如果Word完成了PowerPoint所做的一切,那就不需要其中的一个了。 按理说他们将根据其使用情况设置不同的功能集。 在任何情况下,要在整个演示文 ...
  • 您可以将每个形状的动作设置设置为运行宏:(宏名称)当您在幻灯片放映过程中单击形状时,将运行名为(宏名称)的VBA子例程。 Mac PowerPoint有一些错误,使其不像在Windows PowerPoint中那样平稳运行,但下面的代码可以解决这些问题,并且可以在任一版本中使用。 Sub IncrementNumber(oSh as Shape) Dim oSl as Slide Dim oShTemp as Shape ' oSh.Parent returns a valid ref ...
  • 遵循这个MSDN示例,即您应该创建和访问PowerPoint -table的方式 var LApp, LSlide, LTable : Variant; begin LApp := CreateOleObject( 'PowerPoint.Application' ); LSlide := LApp.ActivePresentation.Slides.Add( 1, ppLayoutBlank ); LTable := LSlide.Shapes.AddTable( 5, 5, 100, 0 ...
  • 除了徘徊XML,它可能会或可能不会释放任何有用的东西,我不知道通过对象模型做任何方法,但你可以绘制一个矩形,调用按钮的动作来着色它,抓住颜色然后删除矩形。 以下是您在VBA中的表现: Function GetColorBucketColor() As Long Dim oSh As Shape Set oSh = ActivePresentation.Slides(1).Shapes.AddShape(msoShapeRectangle, 0, 0, 100, 100) oSh.Se ...
  • 您可以查看有多少其他演示文稿是打开的,只有在您的演示文稿是唯一的演示文稿时才会退出: ppPres.SaveAs(outputFilename); var presentations = ppApp.Presentations; if (presentations.Count <= 1) { ppPres.Close(); ppApp.Quit(); } You could check how many other Presentations are open, and only q ...
  • 您已经有效地回答了自己的问题。 您需要在PowerPoint中创建一个具有新布局的模板,该布局具有填充幻灯片的单个内容占位符。 在PowerPoint 2016中,您将执行以下操作: 文件 - >新建 - >空白演示文稿 删除第一张(也是唯一的)幻灯片 查看 - >幻灯片母版 幻灯片母版 - >插入布局 删除此布局上的所有现有占位符 幻灯片母版 - >插入占位符 - >内容 调整新占位符的大小以填充幻灯片 右键单击左侧布局列表中的布局 重命名布局 “整页内容” 文件 - >另存为 - >浏览 选择演示模板的 ...

相关文章

更多

最新问答

更多
  • 获取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的基本操作命令。。。