/usr/share/GNUstep/Documentation/GDL2Intro_4.html is in gnustep-dl2 0.12.0-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- C2006 Free Software Foundation
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions.
-->
<!-- Created on May 20, 2013 by texi2html 1.82
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>GNUstep Database Library Introduction 0.1: 4. Classes</title>
<meta name="description" content="GNUstep Database Library Introduction 0.1: 4. Classes">
<meta name="keywords" content="GNUstep Database Library Introduction 0.1: 4. Classes">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Classes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="GDL2Intro_3.html#Class-specific-implementation" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Model-classes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro_3.html#Key-Value-Coding" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Classes-1"></a>
<h1 class="chapter">4. Classes</h1>
<hr size="6">
<a name="Model-classes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Classes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Database-specific-classes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section">4.1 Model classes</h2>
<p>The model related classes are important in that they define a databases
structure. Giving GDL2 a way to map a relational database into a set of
objects.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#EOModel-class">4.4 EOModel class</a></td><td> </td><td align="left" valign="top"> EOModel
</td></tr>
<tr><td align="left" valign="top"><a href="#EOEntity-class">4.5 EOEntity class</a></td><td> </td><td align="left" valign="top"> EOEntity
</td></tr>
<tr><td align="left" valign="top"><a href="#EOAttribute-class">4.6 EOAttribute class</a></td><td> </td><td align="left" valign="top"> EOAttribute
</td></tr>
<tr><td align="left" valign="top"><a href="#EORelationship-class">4.7 EORelationship class</a></td><td> </td><td align="left" valign="top"> EORelationship
</td></tr>
<tr><td align="left" valign="top"><a href="#EOModelGroup-class">4.8 EOModelGroup class</a></td><td> </td><td align="left" valign="top"> EOModelGroup
</td></tr>
</table>
<hr size="6">
<a name="Database-specific-classes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Model-classes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Data-oriented-classes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section">4.2 Database specific classes</h2>
<p>The database specific classes loadable through bundles provide a method
for GDL2 to connect to and abstract implementation details between
different database implementations.
</p>
<p>Currently adaptors for SQLite3 and PostgreSQL exist.
</p><table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#EOAdaptor-class">4.9 EOAdaptor class</a></td><td> </td><td align="left" valign="top"> EOAdaptor
</td></tr>
<tr><td align="left" valign="top"><a href="#EOAdaptorChannel-class">4.11 EOAdaptorChannel class</a></td><td> </td><td align="left" valign="top"> EOAdaptorChannel
</td></tr>
<tr><td align="left" valign="top"><a href="#EOAdaptorContext-class">4.10 EOAdaptorContext class</a></td><td> </td><td align="left" valign="top"> EOAdaptorContext
</td></tr>
</table>
<hr size="6">
<a name="Data-oriented-classes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Database-specific-classes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOModel-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section">4.3 Data oriented classes</h2>
<p>The data oriented classes relate to actual data manipulation and management.
</p><table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#EODataSource-class">4.12 EODataSource class</a></td><td> </td><td align="left" valign="top"> EODataSource
</td></tr>
<tr><td align="left" valign="top"><a href="#EOEditingContext-class">4.13 EOEditingContext class</a></td><td> </td><td align="left" valign="top"> EOEditingContext
</td></tr>
<tr><td align="left" valign="top"><a href="#EOGenericRecord-class">4.14 EOGenericRecord class</a></td><td> </td><td align="left" valign="top"> EOGenericRecord
</td></tr>
</table>
<hr size="6">
<a name="EOModel-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Data-oriented-classes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-5" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOModel-class-1"></a>
<h2 class="section">4.4 EOModel class</h2>
<a name="index-class_002c-EOModel"></a>
<hr size="6">
<a name="overview-5"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOModel-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOEntity-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOModel-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.4.1 overview</h3>
<p>A model represents GDL2s interface to a database. It contains
information required to connect to the database along with entities
and stored procedures.
</p>
<p>All the model classes can be written to and read from property list files
in the form of .eomodel or .eomodeld files. While .eomodel files contain a
model and all its entities and objects in a single property list, .eomodeld files
are a directory with each of the property lists in their own file.
</p>
<p>Typically you won’t create an model through manual instantiation of the classes
but store them in and read them from a property list. We have provided an
example .eomodel file See section <a href="GDL2Intro_5.html#Example-model-file">Example model file</a>.
</p>
<p>An EOModel Typically has:
</p><ol>
<li>
A Name
</li><li>
An adaptor name
</li><li>
A connection dictionary
</li><li>
An array of entities
</li></ol>
<hr size="6">
<a name="EOEntity-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview-5" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-1" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOEntity-class-1"></a>
<h2 class="section">4.5 EOEntity class</h2>
<a name="index-class_002c-EOEntity"></a>
<hr size="6">
<a name="overview-1"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOEntity-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Class-properties" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOEntity-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.5.1 overview</h3>
<p>An entity contains information pertaining to a table in a database
in the form of attributes and relationships.
</p>
<p>Additionally an entity contains:
</p><ol>
<li>
An array of class properties
</li><li>
An array of primary key attributes
</li><li>
A class name
</li><li>
An External name
</li></ol>
<hr size="6">
<a name="Class-properties"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview-1" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Class-name" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOEntity-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.5.2 Class properties</h3>
<p>A class property of an entity can be either an attribute or a relationship.
typically class properties are the set of attributes or relationships
which are user visible and need to be set or accessed by the user.
Primary and Foreign keys attributes are usually derived from other
attributes or generated automatically and so they are not typically
class properties.
</p>
<p>A class property will be available through Key Value Coding for access
and modification, in an instance of an Enterprise object.
</p>
<hr size="6">
<a name="Class-name"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Class-properties" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Primary-Key-Attributes" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOEntity-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.5.3 Class name</h3>
<p>an EOEntity’s class name represents the name of the class which will be
instantiated when creating an Enterprise Object such as EOGenericRecord
or a custom object.
</p>
<hr size="6">
<a name="Primary-Key-Attributes"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Class-name" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#External-name" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOEntity-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.5.4 Primary Key Attributes</h3>
<p>Primary key attributes specify which attributes uniquely identify a row
in the table, they are typically generated automatically by GDL2.
They correspond directly to the relational database concept.
</p>
<hr size="6">
<a name="External-name"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Primary-Key-Attributes" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOEntity-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.5.5 External name</h3>
<p>The external name represents the table name in the database server,
and in any SQL the adaptor might generate.
</p>
<hr size="6">
<a name="EOAttribute-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#External-name" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-6" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOAttribute-class-1"></a>
<h2 class="section">4.6 EOAttribute class</h2>
<a name="index-class_002c-EOAttribute"></a>
<hr size="6">
<a name="overview-6"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOAttribute-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Name" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.1 overview</h3>
<p>An attribute typically maps a table column to an instance variable,
in which case the attribute is a class property. Some attributes
represent foreign keys which are used to create realationships yet do
not correspond to a property in the enterprise object. Other attributes
may represent primary keys which needn’t be class property either. In fact
some parts of framework work more smoothly if primary key attributes and
foreign key attributes are not class properties.
</p>
<p>Attributes typically contain:
</p><ol>
<li>
A name
</li><li>
A column name
</li><li>
An adaptor value type
</li><li>
An external type
</li><li>
A value type
</li><li>
A value class name
</li><li>
A value factory method name
</li><li>
a factory method argument type
</li></ol>
<p>Some additional properties an attribute may have:
</p><ol>
<li>
Read only
</li><li>
Allows null
</li><li>
Width
</li><li>
Precision
</li><li>
Scale
</li></ol>
<hr size="6">
<a name="Name"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview-6" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Column-name" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.2 Name</h3>
<p>The attributes name when the attribute is a class property is used
as the key when doing key value coding on an enterprise object.
</p>
<p>It also uniquely identifies the attribute in its entity
there many not be an attribute with the same name as another attribute or
relationship in an entity.
</p>
<hr size="6">
<a name="Column-name"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Name" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Adaptor-value-type" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.3 Column name</h3>
<p>The adaptor uses the column name in generating SQL.
</p>
<hr size="6">
<a name="Adaptor-value-type"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Column-name" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#External-type" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.4 Adaptor value type</h3>
<p>Indicates the type of the attribute as contained in the database
</p>
<p>Valid adaptor value types are:
</p><ol>
<li>
EOAdaptorNumberType
</li><li>
EOAdaptorCharactersType
</li><li>
EOAdaptorBytesType
</li><li>
EOAdaptorDateType
</li></ol>
<p>Corresponding to numerical, string, raw data, and date value types.
</p>
<hr size="6">
<a name="External-type"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Adaptor-value-type" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Value-type" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.5 External type</h3>
<p>An external type is a string representing an adaptor specific database type
different adaptors may use different names
where the PostgreSQL adaptor might use ’char’.
The SQLite3 Adaptor might use ’TEXT’
</p>
<p>it gives you full control on how the data is stored in the specific adaptor
where the adaptor value type allows you to specify a few generic values.
</p>
<hr size="6">
<a name="Value-type"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#External-type" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Value-class-name" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.6 Value type</h3>
<p>Value types are a string with a single character such as ’f’ for floats
’c’ for chars a full list of the standard types is available in the
GDL2 API reference for EOAttributes -valueType method.
</p>
<p>The value type allows you to further refine the adaptor value type
where EOAdaptorNumberType might represent a integer, float, or double type.
</p>
<hr size="6">
<a name="Value-class-name"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Value-type" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Value-factory-method-name" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.7 Value class name</h3>
<p>The value class name specifies the class which will be present in an
Enterprise Object containing the attribute.
</p>
<p>A property of this class will be instantiated when a field is retrieved from
the database, similarly a instance of this will be converted into the
external type when being sent to the datbase server.
</p>
<hr size="6">
<a name="Value-factory-method-name"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Value-class-name" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Value-factory-argument-type" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.8 Value factory method name</h3>
<p>When the Value Class Name is a custom object for instance NSImage
created from a blob of data. The value factory method name denotes
the initializer for the class, used to create a new instance of the custom
class.
</p>
<p>The value class name is an NSString representing a selector accepting a single
argument suitable for passing to the NSSelectorFromString function.
</p>
<hr size="6">
<a name="Value-factory-argument-type"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Value-factory-method-name" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EORelationship-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAttribute-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.6.9 Value factory argument type</h3>
<p>This is the type of the argument sent to the value factory method name.
</p>
<p>Valid types are
</p><ol>
<li>
EOFactoryMethodArgumentIsNSData
</li><li>
EOFactoryMethodArgumentIsNSString
</li><li>
EOFactoryMethodArgumentIsBytes
</li></ol>
<hr size="6">
<a name="EORelationship-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Value-factory-argument-type" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EORelationship-class-1"></a>
<h2 class="section">4.7 EORelationship class</h2>
<a name="index-class_002c-EORelationship"></a>
<hr size="6">
<a name="overview"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EORelationship-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOModelGroup-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EORelationship-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.7.1 overview</h3>
<p>A relationship represents a connecton between entities and are described
with EOJoin’s. A join defines source and destination attributes – The
attributes of the joining entity which must match.
</p>
<p>A relationship may be of type to-one or to-many. In a to-many the
destination will be an array of objects, and a to-one relationships
destination a single object.
</p>
<p>Typically a relationship is a class property. Yet some relationships may
soley be used for flattening other relationships which are class properties,
yet need not be class properties themselves.
</p>
<hr size="6">
<a name="EOModelGroup-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-8" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOModelGroup-class-1"></a>
<h2 class="section">4.8 EOModelGroup class</h2>
<a name="index-class_002c-EOModelGroup"></a>
<hr size="6">
<a name="overview-8"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOModelGroup-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOAdaptor-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOModelGroup-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.8.1 overview</h3>
<p>When models have relationships to other models, they ask their model group.
</p>
<p>There is a special model group - the default model group - which contains
all the models in the applications resources and the resources of any
frameworks the application uses. If your model file is not available through
application or framework resources you will need to add it to a model group.
</p>
<hr size="6">
<a name="EOAdaptor-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview-8" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-7" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOAdaptor-class-1"></a>
<h2 class="section">4.9 EOAdaptor class</h2>
<a name="index-class_002c-EOAdaptor"></a>
<hr size="6">
<a name="overview-7"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOAdaptor-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOAdaptorContext-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOAdaptor-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.9.1 overview</h3>
<p>An adaptor abstracts the difference between different database
implementations. It can connect to the database with the help of a
connection dictionary and create and execute SQL statements.
</p>
<p>While an adaptor is made up of many different classes. The EOAdaptor class is sort of an entry point into the different available classes.
</p>
<p>And a typical use for the EOAdaptor class is creating an instance of a
specific adaptor, either by name or through the adaptor name in a model.
</p>
<p>Typical methods for the EOAdaptor class are:
</p><ol>
<li>
-createAdaptorContext
</li><li>
-runLoginPanel
</li><li>
-assertConnectionDictionaryIsValid
</li><li>
+adaptorWithModel:
</li></ol>
<hr size="6">
<a name="EOAdaptorContext-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview-7" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOAdaptorChannel-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOAdaptorContext-class-1"></a>
<h2 class="section">4.10 EOAdaptorContext class</h2>
<p>An EOAdaptorContext can create an adaptor channel and will transparently handle
transactions for the channel, It can begin, commit, roll back transactions.
</p>
<p>Additionaly you can enable debugging on the context and its channels.
</p>
<p>Typical methods for an EOAdaptorContext:
</p><ol>
<li>
-createAdaptorChannel
</li><li>
-setDebugEnabled:
</li></ol>
<hr size="6">
<a name="EOAdaptorChannel-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOAdaptorContext-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOAdaptorChannel-class-1"></a>
<h2 class="section">4.11 EOAdaptorChannel class</h2>
<p>An adaptor channel can open and close a connection to the adaptors database server. Along with fetch rows from the database and create, update, and delete rows in the database.
</p>
<p>It is the main communication channel for gdl2, in creating the connection to the database, and executing any SQL statements which have been prepared through
EOSQLExpression. Though it also has methods for building SQL expressions from entities, and possibly turning the results back into enterprise objects.
</p>
<p>Because EOAdaptorChannel can create most SQL statements for you,
you’ll rarely need to do that yourself, though it is available if needed.
</p>
<p>Typical methods for an EOAdaptorChannel:
</p><ol>
<li>
-openChannel
</li><li>
-closeChannel
</li><li>
-isOpen
</li></ol>
<hr size="6">
<a name="EODataSource-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOAdaptorChannel-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-4" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EODataSource-class-1"></a>
<h2 class="section">4.12 EODataSource class</h2>
<a name="index-class_002c-EODataSource"></a>
<hr size="6">
<a name="overview-4"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EODataSource-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Fetch-objects" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.12.1 overview</h3>
<p>EODataSource is an abstract base class, and implements no real functionality on its own,
instead you’ll access EODataSource subclass.
</p>
<p>A data source represents a collection of rows inside of a table.
It can create rows, delete and provide access to the individual rows
represented as Enterprise objects.
</p>
<p>Typical methods for an EODataSource subclass:
</p><ol>
<li>
-fetchObjects
</li><li>
-createObject:
</li><li>
-deleteObject:
</li><li>
-insertObject:
</li><li>
-dataSourceQualifiedByKey:
</li></ol>
<hr size="6">
<a name="Fetch-objects"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview-4" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Creating-objects" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.12.2 Fetch objects</h3>
<p>The -fetchObjects method will return an array of enterprise objects.
Typically these will be retrieved directly from data in the database server.
Then the caller will save the array for access or modification.
</p>
<hr size="6">
<a name="Creating-objects"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Fetch-objects" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Inserting-objects" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.12.3 Creating objects</h3>
<p>The -createObject: method will create a new enterprise object for insertion into the database.
A subclass will generally insert this new object into an editing context.
Though the caller is responsible for inserting the object into the data source with -insertObject:.
</p>
<hr size="6">
<a name="Inserting-objects"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Creating-objects" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Deleting-objects" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.12.4 Inserting objects</h3>
<p>The -insertObject: method will schedule the object for addition into the database server
EditingContexts changes are saved to the database.
</p>
<hr size="6">
<a name="Deleting-objects"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Inserting-objects" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Qualified-DataSources" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.12.5 Deleting objects</h3>
<p>The -deleteObject: method will schedule the object for removal from the database server
when the EOEditingContexts changes are saved to the database.
</p>
<hr size="6">
<a name="Qualified-DataSources"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Deleting-objects" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EODatabaseDataSource-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.12.6 Qualified DataSources</h3>
<p>Subclasses may implement this method to return a detail data source.
</p>
<p>A detail data source is a datasource which is created from following a relationship
in an object of the receiever: the master object.
</p>
<p>in our example you might have a data source for the authors entity
and qualify a detail data source, with the toBooks key.
</p>
<hr size="6">
<a name="EODatabaseDataSource-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Qualified-DataSources" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOEditingContext-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EODataSource-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.12.7 EODatabaseDataSource class</h3>
<p>EODatabaseDataSource class is a subclass of EODataSource.
</p>
<p>To initialize an EODatabaseDataSource you’ll give it a reference to an EOEditingContext
and an entity name.
</p>
<p>EODatabaseDataSource initializers:
</p><ol>
<li>
-initWithEditingContext:entityName:
</li><li>
-initWithEditingContext:entityName:fetchSpecificationName:
</li></ol>
<p>Once initialized, you can call the EODataSource methods on it, to
create fetch insert, and delete objects from the datasource.
</p>
<hr size="6">
<a name="EOEditingContext-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EODatabaseDataSource-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-2" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOEditingContext-class-1"></a>
<h2 class="section">4.13 EOEditingContext class</h2>
<a name="index-class_002c-EOEditingContext"></a>
<hr size="6">
<a name="overview-2"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOEditingContext-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#EOGenericRecord-class" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOEditingContext-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.13.1 overview</h3>
<p>An editing context is responsible for managing changes to enterprise objects
and provides the ability to save and undo those changes. Including inserts, updates, and deletes.
</p>
<p>Typical methods of the EOEditingContext class:
</p><ol>
<li>
-saveChanges:
</li><li>
-revert:
</li><li>
-undo:
</li><li>
-redo:
</li><li>
-insertObject:
</li><li>
-deleteObject:
</li></ol>
<p>You may have noticed that there is no mention of a method for modifying an object through an EOEditingContext. As you will modify the objects directly, and EOEditingContext will merely take note of the changes, and save snapshots of the objects as they are being modified so you can undo those changes.
</p>
<hr size="6">
<a name="EOGenericRecord-class"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#overview-2" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#overview-3" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#Classes" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="EOGenericRecord-class-1"></a>
<h2 class="section">4.14 EOGenericRecord class</h2>
<a name="index-class_002c-EOGenericRecord"></a>
<hr size="6">
<a name="overview-3"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#EOGenericRecord-class" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#EOGenericRecord-class" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection">4.14.1 overview</h3>
<p>EOGeneric record represents an actual row in a table being the default
enterprise object it contains no custom business logic and is accessible solely
through key value coding.
</p>
<p>Where an entity represents the description of the table. It’s columns and types.
enterprise objects represent the data contained in the table.
</p>
<p>EOGenericRecords are generally created with a reference to an entity.
They export as keys the class properties of the entity, for access and modification.
</p>
<p>If you have an EOGenericRecord from the ’authors’ entity
of our example model you could set the authors name as so.
See section <a href="GDL2Intro_5.html#Example-model-file">Example model file</a>.
</p>
<table><tr><td> </td><td><pre class="verbatim">[anAuthor takeValue:@"Anonymous" forKey:@"name"];
</pre></td></tr></table>
<p>And retrieve the author name with:
</p><table><tr><td> </td><td><pre class="verbatim">[anAuthor valueForKey:@"name"];
</pre></td></tr></table>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Classes" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_5.html#Model-creation" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="GDL2Intro.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_11.html#Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="GDL2Intro_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>root</em> on <em>May 20, 2013</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</font>
<br>
</p>
</body>
</html>
|