`
kevinhrw
  • 浏览: 187490 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

NamedQuery

阅读更多
JAVA 代码:

   1.
      @Entity
   2.
      @NamedQuery(name="findByName", queryString =
   3.
      "SELECT o FROM People o WHERE o.name = :queryname")
   4.
      public class People{
   5.
      ...
   6.
      }

则对接口public List<People> findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values);
调用
复制内容到剪贴板
JAVA 代码:

   1.
      List<People> peoples=XXXXXXX.findByNamedQueryAndNamedParam("findByName",
   2.
         new String[]{"queryname"},new String[]{"ABCD"});

相当于将name为findByName的queryString中的queryname参数换成ABCD.
效果就相当于执行SELECT o FROM People o WHERE o.name = 'ABCD'
分享到:
评论

相关推荐

    hibernate-jpa-named-query-xml-annotation-example.zip

    This tutorial show how to use Hibernate/JPA Named Queries. We start by explaining why we would use named queries. Next, we show an example of how to use named queries, either with annotations or XML ...

    Naquela - a NAmed QUEry Logfile Analyser-开源

    Naquela将分析您的BIND 8或9查询日志(它们很容易设置)。 它可以按要求的域名,原始IP,按天,按小时划分结果,无论您想要什么。

    CommonLibrary.NET类库源码2012726

    ImportExport Information IocContainer Location Logging Maps NamedQuery Notifications Paging Query QueueProcessor Repository Scheduler Scripts ToDo Validation Web Xml等类库源码。 一些底层的源码。 A ...

    kbmMw(ver 7.13.00)简单例子.rar

    7、命名查询(namedQuery) 8、事务操作(直接写SQL语句更新表的事务操作,有个重要的属性要设置,否则会更新不成功) 9、使用的数据库:sqlserver 2000,请到服务器的FDM单元把连接参数改下 10、数据库kbm_test结构参见...

    kbmmw+unidac+sqlserver2000例子

    7、命名查询(namedQuery) 8、事务操作(直接写SQL语句更新表的事务操作,有个重要的属性要设置,否则会更新不成功) 9、使用的数据库:sqlserver 2000,请到服务器的FDM单元把连接参数改下 10、数据库kbm_test结构参见...

    JPA 标注 JPA标签手册

    o @NamedQuery • O o @OneToMany o @OneToOne o @OrderBy • P o @PersistenceContext o @PersistenceContexts o @PersistenceProperty o @PersistenceUnit o @PersistenceUnits o @PrimaryKeyJoinColumn o @...

    kbmmw例子 V2.0 (unidac+mssql)[2012-08-15]

    7、命名查询(namedQuery) 8、事务操作(直接写SQL语句更新表的事务操作,有个重要的属性要设置,否则会更新不成功) 9、使用的数据库:sqlserver 2000,请到服务器的FDM单元把连接参数改下 10、数据库kbm_test结构参见...

    greenplum-db-6.2.1-rhel7-x86_64.rpm

    The PXF JDBC Connector now supports pushdown of OR and NOT logical filter operators when specified in a JDBC named query or in an external table query filter condition. PXF supports writing Avro-...

    javax.persistence.jar

    javax.persistence.NamedQuery.class javax.persistence.NonUniqueResultException.class javax.persistence.NoResultException.class javax.persistence.OneToMany.class javax.persistence.OneToOne.class javax....

    Hibernate注释大全收藏

    Hibernate注释大全收藏 声明实体Bean @Entity public class Flight implements Serializable { Long id; @Id public Long getId() { return id; } public void setId(Long id) { this.id = id;...

    CakePHP 1.3 Application Development Cookbook.pdf

    Code words in text are shown as follows: "Create a file named query_log.php and place it in your app/controllers/components folder with the following contents:" CakePHP is a rapid development ...

    Doctrine ORM for PHP.pdf

    Table of Contents Introduction....................................................................................................13 Code Examples.........................................................

    exemplo-jpa-pesquisa-com-jpql-criteria:例子

    Renato Ferreira-软件工程师 ...@NamedQuery:使用预定义参数的静态JPQL查询 使用条件的动态查询 条件查询 CriteriaBuilder 执照 根据MIT许可证分发。 有关更多信息,请参见LICENSE 。 接触 Renato Ferreira- - :

    MyJots-JPA:MyJots 服务的 JPA 库

    JPA 类JPA 类是使用 NetBeans 8“数据库表中的实体”向导设置以下选项生成的: 生成的 NamedQuery 注释JAXB 注释关联获取:默认 (LAZY) 集合类型: java.util.List 使用列名作为关系底层数据库持久化单元配置为以 ...

    java版按键精灵源码-javaee7-eclipse:使用Eclipse的JavaEE7

    java版女精灵源码使用 Eclipse 的 Java EE 7 项目创建 创建一个简单的动态 Web 项目 选择模块版本为“3.1” ...在Servers选项卡中,选择模块,右键单击...@NamedQuery ( name = " findAllStudents " , query = " select s

    DB Query Analyzer specification

    Then if you start DB Query Analyzer, the file named DBQueryAnalyzer.exe will decoded the four encoded files first and make them into a single file . Furthermore DBQueryAnalyzer.exe will allocate the ...

    Mybatis单个参数的if判断报异常There is no getter for property named 'xxx' in 'class java.lang.Integer'的解决方案

    今天小编就为大家分享一篇关于Mybatis单个参数的if判断报异常There is no getter for property named 'xxx' in 'class java.lang.Integer'的解决方案,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,...

    030105DNS服务器搭建

    allow-query { any; }; recursion yes; dnssec-enable yes; dnssec-validation yes; dnssec-lookaside auto; /* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key"; managed-keys-directory...

    namedparser:named.conf解析器

    directory "/var/na/named"; check-names master ignore; check-names slave ignore; check-names response ignore; allow-recursion { any; }; allow-query { any; }; allow-query-cache { any;

    Recursive Stratified Sampling: A New Framework for Query Evaluation on Uncertain Graphs

    In this paper, we first introduce two types of query evaluation problems on uncertain graphs, named expectation query evaluation and threshold query evaluation. Most previous solutions for these ...

Global site tag (gtag.js) - Google Analytics