在JPA,关系数据库等中,什么是元组? [英] In JPA, relational databases and etc., What is a Tuple?

查看:137
本文介绍了在JPA,关系数据库等中,什么是元组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Hibernate和JPA,并且一直都在找这个名词.有人可以用一种实用的方式向我解释一下,这个术语是什么,以及它与JPA/Hibernate/Databases有什么关系?

I'm studying Hibernate and JPA, and I am finding this term all the time. Could someone explain me in a practical and didactic way, what is this term, and how it relates to JPA / Hibernate / Databases ?

我想知道它是否是包含任何数据类型的数据结构,但是我不确定是否确实如此.另外,在使用JPA进行查询时,我也不知道它的关系...任何人都可以给我一些启发吗?

I wonder if it's a type of data structure that contains any type of data, but I'm not sure if it is really so. Also, I do not know its relation in a query with JPA... can anyone give me some light?

伙计们,不要沉淀.我在Wikipedia的词典(英语)中搜索过google,这里社区(stackoverflow)中,还有JPA Tuple API中.

Guys, do not precipitate. I have searched on google, in a dictionary (english), in wikipedia, here in the community (stackoverflow), and also the JPA Tuple API.

以下是我的一些搜索字词:

Here are some of my search terms:

  • 什么是元组
  • 元组
  • 数据库元组
  • JPA元组

关于ple的Java EE 6的所有文档如下:

All the documentation of the Java EE 6 says about Tuple is as follows:

用于提取查询结果元素的接口元组.

解释为很多".

我找不到具体,扎实,简洁的东西,无法真正解释它的含义.对于像我这样出生的凡人,他们一无所知并不容易.我不会说英语,也无法访问整个宇宙的内容,有时我会尝试使这个社区在问答中变得最实际,最简单,友好和受人尊敬.这还远远不够.不要以为我来这里之前没有研究任何东西,我是无知的,懒散的,懒惰的等等.这是先入为主的观念!

I can not find something concrete, solid, concise, really explaining what it is. It is difficult for some mortals like me, born not knowing everything. I do not speak English natively, I do not have access to the entire contents of the universe, and sometimes I try to make this community the most practical, simple, friendly, and respectable in questions and answers. It's never enough. Do not presume that I did not research anything before coming here, that I am ignorant, lay, lazy or etc. This is preconception!

为了上帝的爱...我使用翻译来写作,而且我对某些事情没有实际的理解,以至于对其他人来说很容易理解.我的问题甚至遵循此处对stackoverflow提出的问题的规则.当我问一些问题时,它总是某种东西.当我尝试给出答案时,我总是会尝试进行研究,并尽可能地对其他用户做出回应.有时会在某些社区中引起我的悔恨……我要的是知识,而不是地位,我相信其他人可能也有同样的问题.人们常常把这个社区视为禁忌,而不是一个交流知识的地方.再次...为了上帝的爱...

For the love of God... I use a translator to write, and I do not have practical understanding about certain things that for others is so easy to understand. My question even follows the rules for questions imposed here on stackoverflow. It's always something when I ask something. When I try to give answers, I always try to research before, and respond as best I can to other users. Give me some remorse sometimes participate in some communities... I ask for knowledge, not for status, and I'm sure others may have the same questions I have. Often people treat this community like a taboo, and not as a place to exchange knowledge. Again... for the love of God...

推荐答案

元组是从数学中提取的通用术语,仅表示按特定顺序的几个值".如果您可以说给我这个东西的第二个价值",那么那东西就是元组.

Tuple is a generic term taken from mathematics, which just means "several values in specific order". If you can say "give me 2nd value of this thing" then the thing is a tuple.

它们没有单一的符号,但是您可以想象(1,2,3)("a","b","c")("John", "Smith", 12, false)都是元组的示例,分别具有3、3和4项.请注意,元组的概念对值没有任何限制,因此它们可以具有不同的类型.

There is no single notation for them, but you can imagine that (1,2,3), ("a","b","c") and ("John", "Smith", 12, false) are all examples of tuples, having respectively 3, 3 and 4 items. Note that the idea of tuple puts no restrictions on the values, so they can have different types.

从技术上讲,ListString[]Vector都是元组.但是在Java之类的语言中,该术语通常用于不同类型的项目,否则我们将讨论序列.

Technically a List, String[] and Vector are all tuples. But in languages like Java, the term is used mostly when the items are of different types - otherwise we talk about sequences.

在像JPA这样的库中,该术语与 record row 可以互换使用.元组可以用特殊的类表示,但是Java中经常使用的一种方法就是拥有Object[].

In libraries like JPA the term is used interchangebly with terms record and row. Tuples can be represented by special classes, but one way often used in Java is just to have an Object[].

这篇关于在JPA,关系数据库等中,什么是元组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆