小编Ank*_*mba的帖子

org.hibernate.QueryException:无法解析property:filename

我正在使用Hibernate Criteriafilename我的表中的列获取值contaque_recording_log.

但是当我得到结果时,它会引发异常

org.hibernate.QueryException:无法解析属性:filename of:com.contaque.hibernateTableMappings.contaque_recording_log

我的表bean是:

import java.util.Date;
import javax.persistence.*;


@Entity
@Table(name="contaque_recording_log")
public class contaque_recording_log implements java.io.Serializable{
    private static final long serialVersionUID = 1111222233334404L;
    @Id
    @Column(name="logId", insertable=true, updatable=true, unique=false)
    private Integer logId;

    @Column(name="userName", insertable=true, updatable=true, unique=false)
    private String userName;

    @Column(name="ext", insertable=true, updatable=true, unique=false)
    private String ext;

    @Column(name="phoneNumber", insertable=true, updatable=true, unique=false)
    private String phoneNumber;

    @Column(name="callerId", insertable=true, updatable=true, unique=false)
    private String callerId;

    @Column(name="fileName", insertable=true, updatable=true, unique=false)
    private String fileName;


    @Column(name="campName", insertable=true, updatable=true, unique=false)
    private String campName;

    @Temporal(javax.persistence.TemporalType.TIMESTAMP) …
Run Code Online (Sandbox Code Playgroud)

java hibernate hibernateexception hibernate-criteria oracle-sqldeveloper

28
推荐指数
1
解决办法
11万
查看次数

Java中的遗留类是什么?

我最近听说过Vector is a Legacy class,然后我在一个网站上看到了

旧版类用于在集合到来之前保存对象.

那么,为什么这些不被称为Deprecated类,为什么Legacy呢?

java collections

25
推荐指数
2
解决办法
4万
查看次数

为什么在_jax请求中将"_ = 1389258551926"作为查询字符串参数发送?

我正在使用JQuery Ajax向我的动作类发送请求,data: {campaignId: campaignId}_=1389258551926也作为数据发送.

我的ajax请求功能是:

$('#submit').click(function() {
    var campaignId = $('#campaign').val();
    alert("Ajax request ; Camp : " + campaignId);
    $.ajax({
        type: "get",
        url: "getCampData",
        data: {campaignId: campaignId},
        dataType: "json"
    }).done(function(data) {
        alert("Camp List : " + data.campList);
});
Run Code Online (Sandbox Code Playgroud)

查询字符串参数:

campaignId=Test&_=1389258551927
Run Code Online (Sandbox Code Playgroud)

为什么这个额外参数作为数据发送?

javascript ajax jquery

14
推荐指数
1
解决办法
6812
查看次数

什么是解除引用可能的空指针?

我想提出一个计划SFTPNetBeans.

我的代码的一部分:

com.jcraft.jsch.Session sessionTarget = null;
com.jcraft.jsch.ChannelSftp channelTarget = null;
try {
       sessionTarget = jsch.getSession(backupUser, backupHost, backupPort);
       sessionTarget.setPassword(backupPassword);
       sessionTarget.setConfig("StrictHostKeyChecking", "no");
       sessionTarget.connect();
       channelTarget = (ChannelSftp) sessionTarget.openChannel("sftp");
       channelTarget.connect();

       System.out.println("Target Channel Connected");
       } catch (JSchException e) {
            System.out.println("Error Occured ======== Connection not estabilished");
            log.error("Error Occured ======== Connection not estabilished", e);
       } finally {
            channelTarget.exit();     // Warning : dereferencing possible null pointer
            channelTarget.disconnect();  // Warning : dereferencing possible null pointer
            sessionTarget.disconnect();  // Warning : dereferencing possible null pointer
        }
Run Code Online (Sandbox Code Playgroud)

我收到警告 …

java netbeans nullpointerexception dereference

14
推荐指数
1
解决办法
4万
查看次数

如何从Java中的Date Object格式中删除毫秒

由于java.util.Date对象将Date存储为2014-01-24 17:33:47.214,但我希望Date格式为2014-01-24 17:33:47.我想删除毫秒部分.

我查了一个与我的问题有关的问题......

如何删除Date对象的子秒部分

我试过给出了答案

long time = date.getTime();
date.setTime((time / 1000) * 1000);
Run Code Online (Sandbox Code Playgroud)

但我的结果日期格式为2014-01-24 17:33:47.0.如何0从我的日期格式中删除???

java java.util.date

12
推荐指数
4
解决办法
3万
查看次数

"LANGUAGE plpgsql VOLATILE COST 100"在函数中意味着什么

我是Postgres触发器的新手.我在www.postgresql.org上看到了一个触发器的例子,我不明白LANGUAGE plpgsql VOLATILE COST 100;触发器函数的结尾是什么.

这条线有什么用?

我看到了一个与此相关的问题"LANGUAGE'plpgsql'VOLATILE"是什么意思? 但这只是关于volatile什么cost 100,language在这一行?

postgresql triggers plpgsql

8
推荐指数
2
解决办法
1万
查看次数

你在Java注释中导致错误信息,为什么?

// \u represent unicode sequence
    char c = '\u0045';
    System.out.println(c);
Run Code Online (Sandbox Code Playgroud)

代码只是这么多,eclipse显示以下错误消息

"Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    Invalid unicode
Run Code Online (Sandbox Code Playgroud)

现在,当我\u从评论中删除它工作正常,\u评论中的问题是什么?这是一个错误还是有一些关系,只要认为Java应该保留评论.

java unicode

8
推荐指数
2
解决办法
2315
查看次数

ServiceRegistry在创建SessionFactory中有什么用

我正在用Java学习Hibernate。由于要创建Session,我们必须使用SessionFactory.openSession(),对于创建,SessionFactory我们使用sessionFactory = config.buildSessionFactory(serviceRegistry);

ServiceRegistry在休眠状态下有什么用?

我创建的代码SessionFactory

Configuration config = new Configuration();
        config.addAnnotatedClass(user.class);
        config.addAnnotatedClass(emp.class);
        config.configure();

// Didn't understand the code below
            Properties configProperties = config.getProperties();
            ServiceRegistryBuilder serviceRegisteryBuilder = new ServiceRegistryBuilder();
            ServiceRegistry serviceRegistry = serviceRegisteryBuilder.applySettings(configProperties).buildServiceRegistry();
            SessionFactory sessionFactory = config.buildSessionFactory(serviceRegistry);
Run Code Online (Sandbox Code Playgroud)

java hibernate sessionfactory

7
推荐指数
1
解决办法
1万
查看次数

带有钻石操作符的通配符

如果我想做这样的事情:

List<?> unknownList = new ArrayList<>();
Run Code Online (Sandbox Code Playgroud)

那么代码编译并运行正常,但其类型ArrayList创造?

在这一行之后,如果我这样做了:

        unknownList.add("str"); //compilation error
Run Code Online (Sandbox Code Playgroud)

它给出了编译错误:

error: no suitable method found for add(String)
        unList.add("str");
              ^
method List.add(int,CAP#1) is not applicable
  (actual and formal argument lists differ in length)
method List.add(CAP#1) is not applicable
  (actual argument String cannot be converted to CAP#1 by method invocation conversion)
method Collection.add(CAP#1) is not applicable
  (actual argument String cannot be converted to CAP#1 by method invocation conversion)
where CAP#1 is a fresh type-variable:
    CAP#1 extends …
Run Code Online (Sandbox Code Playgroud)

java generics wildcard diamond-operator

7
推荐指数
1
解决办法
7734
查看次数

如何在JOptionPane的ok按钮上添加监听器?

如何在单击"确定"按钮时添加监听器JOptionPane.INFORMATION_MESSAGE.

我的JOptionPane是:

JOptionPane.showMessageDialog(null, "Your password is: " + password, "Your Password", JOptionPane.INFORMATION_MESSAGE);
Run Code Online (Sandbox Code Playgroud)

java swing mouseevent joptionpane

6
推荐指数
1
解决办法
1万
查看次数