`
likaidalian
  • 浏览: 51920 次
社区版块
存档分类
最新评论

fetch 与 find 的区别

 
阅读更多

liferay中 findxxxx 与fetchxxx 方法区别在于数据不存在时前者抛出异常后者返回Null

 

fetchByPrimaryKey

 

/**

* Returns the product with the primary key or returns <code>null</code> if it could not be found.

*

* @param productId the primary key of the product

* @return the product, or <code>null</code> if a product with the primary key could not be found

* @throws SystemException if a system exception occurred

*/

public Product fetchByPrimaryKey(long productId) throws SystemException 

 

-------------------------------------------------------

findByPrimaryKey

 

/**

* Returns the product with the primary key or throws a {@link com.bluegrid.portlet.product.NoSuchProductException} if it could not be found.

*

* @param productId the primary key of the product

* @return the product

* @throws com.bluegrid.portlet.product.NoSuchProductException if a product with the primary key could not be found

* @throws SystemException if a system exception occurred

*/

public Product findByPrimaryKey(long productId)

throws NoSuchProductException, SystemException {

分享到:
评论

相关推荐

    对内核中“二次获取”漏洞的精确以及大范围检测.pdf

    (How to Find Double-Fetch Bugs?) 寻找“获取”对(Fetch Pair Collection) 符号执行(Symbolic Checking) 找到的漏洞(Findings) “二次获取”漏洞的补丁模式(Patching Double-Fetch Bugs) “二次获取”漏洞的一般性...

    find-mentor:查找和匹配导师和导师!

    寻找导师 该项目的目的是收集人们的反馈。 查找和匹配导师/受训者 没有合同, 没有协议, 没有自我 帮助了解成为受指导者/指导者的基本知识。... fetch ( "https://findmentor.network/activeMentorships.jso

    sqlserver存储过程

    create proc proc_find_users(@startId int, @endId int) as ---between and 表示在那个两个数字之间 select * from users where Id between @startId and @endId go exec proc_find_users 42, 64; ------------...

    find-es-resources

    查找资源 该项目旨在帮助您在已解析... fetch (例如,对于多语言用途,则为ala node-fetch )-直接提供给map调用的数组中的文字,该map返回fetch调用的结果: ( async ( ) =&gt; { await Promise . all ( [ './t

    HANA FAQ (frequently asked question)

    44. How are fetch sizes defined in SAP HANA environments? 45. What can be reasons for unexpected or wrong results of SAP HANA database requests? 46. What kind of temporary and non-persisted tables can...

    Android代码-GithubArchitectureComponents

    GithubArchitectureComponents ...You can find the related article on my Medium : ... When this screen appears, we will fetch (Retrofit) the Github information of Jake Wharton and pers

    fetch-mobile-localization-from-airtable:从Airtable获取Android iOS本地化文件

    辅助脚本,可将csv转换为iOS和Android区域设置文件设置准备Airtable API密钥和基本密钥安装套件yarn 准备环境变量cp .env.dist .envcp config.json.example config.json# fill in the env variables# Find Airtable ...

    meteor-comments:让我们为流星应用添加评论

    Comments.find({doc:_id},{sort: {createdAt: -1}}).fetch() Template.registerHelper 'CommentsByUser', (_id) -&gt; if typeof window['Comments'] != 'undefined' Comments.find({owner:_id},{sort: {createdAt...

    Python For ArcGIS(Springer,2015)

    This book introduces Python scripting for geographic information science (GIS) ... Researchers, government specialists and professionals working in GIS will also find this book useful as a reference.

    Python For ArcGIS 2016新书 无水印pdf 0分

    Hardcover: 538 pages Publisher: Springer; 1st ed. 2015 edition (January 18, 2016) ... Researchers, government specialists and professionals working in GIS will also find this book useful as a reference.

    一种为 React 组件获取数据的简单、声明性和可组合的方式

    需要以下 ES6 函数: Object.assign Promise fetch Array.prototype.find 检查兼容性表(Object.assign、Promise、fetch、Array.prototype.find)以确保您需要支持的所有浏览器和平台都有这些,并根据需要包含 ...

    homebrew-linux-dev:for用于Linux上Homebrew开发人员的工具

    fetch-failed-logs :获取针对指定公式运行的CI的失败部分。 find-formulae-to-bottle :生成在指定合并中遇到冲突的公式列表。 find-not-bottled :在中搜索没有Linux瓶的公式。 merge-homebrew :将Homebrew / ...

    active_fulfillment:Active Merchant库,用于与订单履行服务集成

    与订单履行服务集成的库。 安装 添加到您的gem文件,然后运行bundle install 。 gem 'active_fulfillment' 用法 # The authentication options differ per service. service = ActiveFulfillment.service('name')....

    DB.js:高效的集合查询接口

    // Initialize or fetch a collection.// Collections inherit from EventEmitter, so all EventEmitter methods will work.DB . collection ( 'people' ) ;// Configure the primary keyDB . collection ( 'people...

    find_a_pet:使用Petfinder API通过邮政编码查找宠物JavaScript应用

    使用Parcel,Babel和fetch-jsonp快速开始将您自己的API密钥添加到main.js # Install dependenciesnpm install# Serve on localhost:1234parcel# Build for productionparcel build应用程式资讯作者布拉德遍历版本...

    collective.recipe.nix:从列出的鸡蛋中生成Nix派生

    -env.nix,可与nix-build一起使用基于buildPythonPackage的[name]-[package] .nix可与nix-env -i -f一起使用对于像Plone这样的大型项目,建议使用本地镜像的包index / find-links以避免在配方解析每个包的fetchurl...

    cunta:错误的CMake宏,无法方便地获取目标

    find_or_fetch_package(fmt) 就是这样! 您将在系统中使用fmt(如果可用),否则将从源代码中构建它。 它还将查看extern目录,该软件包是否以git子模块的形式存在。 依存关系 CMake 3.11及更高版本,以及git,用于...

    EGit用户指南

    4.2.3.5.1 Find 4.2.3.5.2 Filter settings 4.2.3.5.3 Compare Mode 4.2.3.5.4 All Branches 4.2.3.6 View Menu actions 4.2.3.6.1 Configuring the View 4.2.3.7 Context Menu actions 4.2.3.7.1 Compare...

    Qt5 3D官方教程配套示例代码

    that Qt will find them. After building the tree the install step is invoked using the INSTALL_ROOT environment export to cause the installation rules to place all the files into a sandboxed install ...

    testing-snippets

    JEST Testing代码段存储库 在此处找到要测试的代码段... JavaScript基础 异步代码(例如Promises) 猫鼬 表示 ... 模拟猫鼬数据库调用,如User.find() 资源: 官方JEST入门指南: : 还有更多...

Global site tag (gtag.js) - Google Analytics