黑客帝国4什么时候上映| 产妇可以吃什么水果| 脑供血不足吃什么药好得快| 肾结石吃什么药能化石| 打下巴用什么玻尿酸最好| rfc是什么意思| 食指戴戒指代表什么| 什么书最香| 奥特莱斯是什么店| 什么动物吃蛇| 不对劲是什么意思| 沐什么意思| 舌头肿大是什么原因引起的| 傍大款是什么意思| 家里进蝙蝠什么预兆| 别车是什么意思| quest是什么车| 7月30日什么星座| 贴图是什么意思| 疤痕贴什么时候用最佳| 普通门诊和专家门诊有什么区别| 身上老是痒是什么原因| 孔子的原名叫什么| 子宫糜烂有什么症状| 屏幕总成带框和不带框有什么区别| 月经推迟是什么原因导致的| 感冒可以吃什么水果| 天孤星是什么意思| 出球小动脉流什么血| cns医学上是什么意思| 腿弯疼是什么原因| 叶酸片什么时候吃合适| 6月18日是什么星座| 满月脸水牛背是什么病| 天津立冬吃什么| 喝茶对人体有什么好处| 结肠多发憩室是什么意思| 沙蟹吃什么| 梦见自己在飞是什么征兆| 腐女是什么意思| 毓读什么| 连续做噩梦是什么原因| 月经不调看什么科室| 书字五行属什么| 这厮是什么意思| 骨质疏松有什么症状| 梦到被蛇咬是什么意思周公解梦| 8.8是什么星座| 耳廓有痣代表什么| 青蛙怕什么| 三个代表是什么| 什么茶不能喝脑筋急转弯| 岁月匆匆像一阵风是什么歌| 对蚊子过敏是什么症状| 印堂发红是什么的征兆| 沙砾是什么意思| 子宫位于腹部什么位置| mask是什么意思| 孕早期不能吃什么食物| 十二月二十号是什么星座| 电饭煲内胆什么材质好| 什么叫前列腺炎| 霸屏是什么意思| 野生型是什么意思| 窦性心律不齐是什么| 今年农历是什么年| 01年是什么年| 梁五行属什么| 健康是什么| 眼球出血是什么原因引起的| 蝉蜕是什么| 壬申日是什么意思| 肾结石有什么症状哪里疼| 结节影是什么意思| 甲鱼补什么| 头不自觉的晃动是什么原因| 警惕是什么意思| 小孩急性肠胃炎吃什么药| 动一下就出汗是什么原因| 国手什么意思| 鸡眼挂什么科| 吃辣椒有什么好处| 河豚是什么意思| 白色情人节什么意思| 检查肝肾功能挂什么科| 白带是什么意思| 胃气虚吃什么中成药| 流产后吃什么| 经常上火是什么原因| 诸葛亮儿子叫什么| 海虾不能和什么一起吃| 立秋当天吃什么| 千张炒什么好吃| 什么三迁| 富士康体检都检查什么| FAN英语什么意思| 印度为什么叫阿三| 倒吊人是什么意思| 垂涎欲滴意思是什么| 动物的尾巴有什么用处| 调月经吃什么药好| 灌肠为什么能通输卵管| ntr是什么意思| 5月15日是什么星座| 孩子上吐下泻吃什么药| 血脂高吃什么中药| isis是什么组织| 邮戳是什么意思| 钢铁侠是什么意思| 棕色和什么颜色搭配好看| 什么东西人们都不喜欢吃| 抑菌液有什么作用| 可可和咖啡有什么区别| 圣诞节礼物什么时候送| 军士长是什么级别| 孕妇吃西红柿对胎儿有什么好处| 客服是什么工作| 兰桂齐芳是什么意思| 74年属什么| 了不起是什么意思| 嘴唇发黑是什么原因引起的| 晨起口干口苦是什么原因| 痢疾吃什么药效果最好| 殿后和垫后有什么区别| 头晕想吐是什么症状| 全身燥热是什么原因引起的| 红眼病是什么原因引起的| 手上有痣代表什么| 宝妈男是什么意思| 没腿毛的男人代表什么| 胰岛素抵抗吃什么药| 硫黄和硫磺有什么区别| 倒睫是什么意思| 哥文花园女装什么档次| 腰椎生理曲度变直是什么意思| 一什么地毯| 中规中矩什么意思| 间接喉镜检查能检查出什么| 为什么不要看电焊火花| 鹅蛋什么人不能吃| 流浓黄鼻涕是什么原因| 今年二十岁属什么生肖| 梦见白蛇是什么预兆| 960万平方千米是指我国的什么| 扁桃体2度是什么意思| 人肉是什么味道的| 宝宝湿疹用什么药膏| 月忌日是什么意思| 双子男喜欢什么样的女生| 口蜜腹剑是什么意思| 独一无二是什么生肖| 11月12号是什么星座| 鲁迅的原名叫什么| 酸菜鱼用什么鱼做好吃| 平安喜乐什么意思| 经常喝柠檬水有什么好处和坏处| 吃什么助眠| 英语什么时候学最好| 炖羊肉放什么调料| 白目是什么意思| 常染色体是什么| 白眼球有红血丝是什么原因| 热射病是什么病| 什么是npc| 眼神迷离是什么意思| 自相矛盾的道理是什么| 宝宝吐奶是什么原因引起的| 可小刀是什么意思| 口腔溃疡看什么科| 珠海有什么特产| 白发多吃什么可以改善| 羸弱是什么意思| 血糖降不下来是什么原因导致| 胸口长痘痘是什么原因| 什么叫反式脂肪| 胃痛吃什么好| 高亢是什么意思| 久坐脚肿是什么原因| 吃什么水果通便| 什么洗面奶最好用| 梦到人死了是什么意思| pms是什么| 糜烂型脚气用什么药| 碘伏和络合碘有什么区别| 鸡炖什么好吃又有营养| 前列腺增大伴钙化灶是什么意思| 碘酊和碘伏有什么区别| 补中益气丸治什么病| 小鸟站在高压线上为什么不会触电| 理想型是什么意思| 脑供血不足什么原因引起的| 陈年是什么意思| 黄体酮有什么作用与功效| 双子座是什么象星座| 耳根疼是什么原因| 海里是什么单位| 风热火眼是什么意思| 四个口是什么字| 夏枯草有什么功效| 什么的青草| 透声差是什么意思| 胃痛吃什么药| 喝酒有什么好处| 脾阳虚吃什么药| 黄棕色是什么颜色| 酱油是什么时候发明的| 财神位放什么最旺财| 清热利湿吃什么药| 丹参泡水喝有什么功效| 等离子体是什么| 脂肪肝是什么病| 无印良品属于什么档次| 胎儿畸形是什么原因造成的| 彩棉是什么面料| 舌头凉凉的是什么原因| 厉兵秣马是什么意思| 胃酸烧心吃什么药可以根治| 小脑是控制什么的| 什么是半月板| 一什么鹿角| 脱发看什么科| 8月23号是什么星座| 一凉就咳嗽是什么原因| 为什么早上起床头晕| 人生什么最重要| 口坐读什么| 痣长在什么地方不好| 专业服从是什么意思| aivei是什么品牌| 干什么挣钱快| 两面派是什么意思| 鼻子突然出血是什么原因| 胃溃疡是什么| 佬是什么意思| 喜鹊吃什么食物| 身份证照片穿什么颜色衣服| a型rh阳性是什么意思| 榴莲什么季节成熟| 基尼系数是什么意思| 白细胞计数偏高是什么意思| 肛门里面有个肉疙瘩是什么| 生物公司是做什么的| 左氧氟沙星有什么副作用| jay什么意思| 牛津布是什么材质| 艾灸有什么好处| 说风就是雨什么意思| 特警力量第二部叫什么| 一带一路指的是什么| 霸道是什么意思| 喝雄黄酒是什么节日| 吹空调嗓子疼吃什么药| 有什么植物| 二级护理是什么意思| 才能是什么意思| 梦见摘丝瓜有什么预兆| edm是什么| 猫砂是什么| dbm是什么意思| 美国什么时候建国的| 孕妇感染弓形虫有什么症状| 脚气什么样| 弱阳性和阳性有什么区别| 打了狂犬疫苗不能吃什么| 百度Jump to content

温州鼓词徐玉燕火烧01 故事全集1-18 温州鼓词火烧

From Wikipedia, the free encyclopedia
(Redirected from Object-relational mapping)
百度 互联网文化消费已趋普及,与其相关的消费者权益受损事件也屡屡发生,由于商家的各种限制条件、行业的种种潜规则、市场监管漏洞和缺失等因素,权益受损的消费者时常陷入徒唤奈何的境地,最终只能不了了之。

Object–relational mapping (ORM, O/RM, and O/R mapping tool) in computer science is a programming technique for converting data between a relational database and the memory (usually the heap) of an object-oriented programming language. This creates, in effect, a virtual object database that can be used from within the programming language.

In object-oriented programming, data-management tasks act on objects that combine scalar values into objects. For example, consider an address book entry that represents a single person along with zero or more phone numbers and zero or more addresses. This could be modeled in an object-oriented implementation by a "Person object" with an attribute/field to hold each data item that the entry comprises: the person's name, a list of phone numbers, and a list of addresses. The list of phone numbers would itself contain "PhoneNumber objects" and so on. Each such address-book entry is treated as a single object by the programming language (it can be referenced by a single variable containing a pointer to the object, for instance). Various methods can be associated with the object, such as methods to return the preferred phone number, the home address, and so on.

By contrast, relational databases, such as SQL, group scalars into tuples, which are then enumerated in tables. Tuples and objects have some general similarity, in that they are both ways to collect values into named fields such that the whole collection can be manipulated as a single compound entity. They have many differences, though, in particular: lifecycle management (row insertion and deletion, versus garbage collection or reference counting), references to other entities (object references, versus foreign key references), and inheritance (non-existent in relational databases). As well, objects are managed on-heap and are under full control of a single process, while database tuples are shared and must incorporate locking, merging, and retry. Object–relational mapping provides automated support for mapping tuples to objects and back, while accounting for all of these differences.[1]

The heart of the problem involves translating the logical representation of the objects into an atomized form that is capable of being stored in the database while preserving the properties of the objects and their relationships so that they can be reloaded as objects when needed. If this storage and retrieval functionality is implemented, the objects are said to be persistent.[1]

Overview

[edit]

Implementation-specific details of storage drivers are generally wrapped in an API in the programming language in use, exposing methods to interact with the storage medium in a way which is simpler and more in line with the paradigms of surrounding code.

The following is a simple example, written in C# code, to execute a query written in SQL using a database engine.

var sql = "SELECT id, first_name, last_name, phone, birth_date, sex, age FROM persons WHERE id = 10";
var result = context.Persons.FromSqlRaw(sql).ToList();
var name = result[0]["first_name"];

In contrast, the following makes use of an ORM-job API which makes it possible to write code that naturally makes use of the features of the language.

var person = repository.GetPerson(10);
var firstName = person.GetFirstName();

The case above makes use of an object representing the storage repository and methods of that object. Other frameworks might provide code as static methods, as in the example below, and yet other methods may not implement an object-oriented system at all. Often the choice of paradigm is made for the best fit of the ORM into the surrounding language's design principles.

var person = Person.Get(10);

Comparison with traditional data access techniques

[edit]

Compared to traditional techniques of exchange between an object-oriented language and a relational database, ORM often reduces the amount of code that needs to be written.[2]

Disadvantages of ORM tools generally stem from the high level of abstraction obscuring what is actually happening in the implementation code.

Object-oriented databases

[edit]

Another approach is to use an object-oriented database management system (OODBMS) or document-oriented databases such as native XML databases that provide more flexibility in data modeling. OODBMSs are databases designed specifically for working with object-oriented values. Using an OODBMS eliminates the need for converting data to and from its SQL form, as the data is stored in its original object representation and relationships are directly represented, rather than requiring join tables/operations. The equivalent of ORMs for document-oriented databases are called object-document mappers (ODMs).

Document-oriented databases also prevent the user from having to "shred" objects into table rows. Many of these systems also support the XQuery query language to retrieve datasets.

Object-oriented databases tend to be used in complex, niche applications. One of the arguments against using an OODBMS is that it may not be able to execute ad-hoc, application-independent queries.[citation needed] For this reason, many programmers find themselves more at home with an object-SQL mapping system, even though most object-oriented databases are able to process SQL queries to a limited extent. Other OODBMS provide replication to SQL databases, as a means of addressing the need for ad-hoc queries, while preserving well-known query patterns.[citation needed]

Challenges

[edit]

A variety of difficulties arise when considering how to match an object system to a relational database. These difficulties are referred to as the object–relational impedance mismatch.[3]

An alternative to implementing ORM is use of the native procedural languages provided with every major database. These can be called from the client using SQL statements. The Data Access Object (DAO) design pattern is used to abstract these statements and offer a lightweight object-oriented interface to the rest of the application.[4]

ORMs are limited to their predefined functionality, which may not cover all edge cases or database features. They usually mitigate this limitation by providing users with an interface to write raw queries, such as Django ORM.[5]

See also

[edit]

References

[edit]
  1. ^ a b "What is Object/Relational Mapping?". Hibernate Overview. JBOSS Hibernate. Retrieved 27 January 2022.
  2. ^ Barry, D., Stanienda, T. (1998). "Solving the Java object storage problem". Computer. 31 (11). Institute of Electrical and Electronics Engineers (IEEE): 33–40. doi:10.1109/2.730734. For this exercise, 496 lines of code were needed using the ODMG Java Binding compared to 1,923 lines of code using JDBC.
  3. ^ Object–Relational Mapping Revisited - A Quantitative Study on the Impact of Database Technology on O/R Mapping Strategies. M Lorenz, JP Rudolph, G Hesse, M Uflacker, H Plattner. Hawaii International Conference on System Sciences (HICSS), 4877-4886 (DOI:10.24251/hicss.2017.592)
  4. ^ Feuerstein, Steven; Bill Pribyl (September 1997). "Oracle PL/SQL Programming". 18.5 Modifying Persistent Objects. Retrieved 23 August 2011.{{cite web}}: CS1 maint: location (link)
  5. ^ "Performing raw SQL queries | Django documentation". Django Project. Retrieved 8 September 2024.
[edit]
离婚要什么手续和证件 87年属什么的 负压是什么意思 蛋白高是什么病 月子吃什么最下奶
双鱼座是什么星座 边缘性人格障碍是什么 阴是什么意思 艾灸肚脐有什么好处 药师佛手里拿什么法器
凤毛麟角是什么生肖 舌头发白是什么情况 fnh是什么病 龟奴是什么 bi是什么
欧阳修字什么 再生牙技术什么时候能实现 四月十七号是什么星座 为什么耳鸣一直不停 检查是否怀孕要做什么检查
小腿酸软无力是什么原因onlinewuye.com 半夜醒是什么原因hcv9jop0ns1r.cn 生吃番茄有什么好处hcv8jop0ns0r.cn 青少年吃什么钙片有助于长高hcv9jop2ns0r.cn 心慌胸闷是什么原因hcv9jop7ns5r.cn
三千烦恼丝什么意思hcv9jop4ns4r.cn 1.16是什么星座hcv8jop9ns3r.cn 儿女双全是什么意思weuuu.com 吃桑葚有什么好处hcv8jop1ns8r.cn 脚面浮肿是什么原因hcv9jop3ns8r.cn
什么粮食hcv8jop0ns4r.cn 蚊香对人体有什么危害hcv8jop2ns4r.cn 婴儿什么时候可以睡枕头hcv8jop3ns6r.cn 肝硬化早期有什么症状hcv9jop2ns5r.cn 身上起红点是什么病hcv7jop5ns0r.cn
不感冒是什么意思hcv7jop6ns9r.cn 孩子老是流鼻血是什么原因hcv7jop4ns6r.cn 波美度是什么意思hcv9jop2ns1r.cn 骶椎隐裂是什么意思hcv8jop6ns8r.cn 非钙化斑块是什么意思hcv8jop9ns3r.cn
百度