neodatis.odb 第五篇 保存

  ODB odb = null;
  Sport soccer = new Sport("足球");  
  
  SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd");
  Player 亨利 = new Player("蒂埃里·亨利", format.parse("1977-8-17"), soccer);
  try {
   odb = ODBFactory.open("test.odb");
   OID oid1 = odb.store(亨利);
……

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
1/4 2/4 3/4 4/4
database id database id database id  
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
  2 1 FALSE FALSE username
database id nb classes first class info oid odb
last
close
status
databse
without
user,pw
no-user
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
username
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
  password
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
password 155
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
  18034 20 1 -1 -1 1
current id bolck position block size     prev block pos next block pos id block number
181 182 183 184 185 186 187 188 189 190               198 199 200 201 202 203 204 205 206 207 208 209 210
5 2
(代表CLASS) 
1 1
ACTIVE
18189 2
(代表CLASS) 
1
id block max id update id
type
oid id
status
class
position
of
id
id
type
oid
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
  1 18309 1
(代表OBJECT)
3 1 18589
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
  1
(代表OBJECT)
4 1 18765      
 
Player类
18189       18193 18194 18195               18203               18211              
120 1 2 1 -1 2
block size class
header
block
type
Class
info
category
class
id
prev
class
oid
next
class
oid
18219                 18227               18235               18243        
0   -1 -1 P l a y e
class nb objects   class
first
obj
pos
class last obj pos 值(2×字符数+8)
18248                             18263                       18275    
r m a r s . o d b . p o j o
  值(2×字符数+8)
18297       18301               18309  
3 18466  
Max attribute id class att def pos  
 
Sport类
18309       18313 18314 18315               18323               18331              
118 1 2 2 1 -1
block size class
header
block
type
Class
info
category
class
id
prev
class
oid
next
class
oid
18339                 18347               18355               18363        
0   -1 -1 S p o r t
class nb objects   class
first
obj
pos
class last obj pos 值(2×字符数+8)
                          18381                          
  m a r s . o d b . p o j o
  值(2×字符数+8)
18415       18419               18427  
1 18427  
Max attribute id class att def pos  
 
Sport属性
18427       18431 18432               18440       18445       18449        
39 2 ` 1 210(java.lang.String) n a m e
block size BLOCK_
TYPE_
CLASS_
BODY
class
nb
attributes
attribute
id
att
odb
type
id
 
 
Player属性
18466       18470 18471               18479       18484       18488                
123 2 3 1 210(java.lang.String) n a m e
block size BLOCK_
TYPE_
CLASS_
BODY
class
nb
attributes
attribute
id
att
odb
type
id
值(2×字符数+8)
                18505         18510       18514                        
  2   170(java.util.Date) b i r t h D a t e
  attribute
id
  att
odb
type
id
值(2×字符数+8)
                            18541       18546               18554      
  3 2 favoriteSport
  attribute
id
class
info
id
值(2×字符数+8)
 
Player对象
18589       18593   18594               18602               18610              
288 4
BLOCK_
TYPE_
NON_
NATIVE_
OBJECT
  3 1 -1
block
size
object
block
type
  oid class
info
id
[对象id]
prev instance
18618               18626               18634               18642       18646  
-1 [1211898399406] [1211898399859] 1  
next instance creation date update date object version number  
            18654 18655       18659       18663               18671        
-1 FALSE 3 1 18695 2
object reference pointer is
syncronized
with
external
db
nb
attr
[属性数量]
attr id att pos attr id
18675               18683       18687                 18695       18699 18700      
18747 3 -4 9 3
BLOCK_
TYPE_
NATIVE_
OBJECT
210
att pos attr id att pos native
block
header
block
size
native
block
type
 native
block
odb
type
id
18705       …… 18747       18751 18752       18757                
蒂埃里·亨利 9 3
BLOCK_
TYPE_
NATIVE_
OBJECT
170 [222278880000]
值(2×字符数+8) native
block
header
block
size
native
block
type
native block odb type id
 
Sport对象
18765       18769  
112 4
block size object
block
type
18770               18778               18786               18794          
4 2 -1 -1
oid class info id prev instance next instance
    18802               18810               18818       18822              
  [1211898576968] [1211898577203] 1 -1
  creation date update date object
version
number
object
reference
pointer
18830 18831       18835       18839               18847       18851 18852       18857     18617
FALSE 1 1 18847 9 3
BLOCK_
TYPE_
NATIVE_
OBJECT
210 足球
is
syncronized
external
db
nb attr attr id att pos/att real pos native
block
header
block
size
native
block
type
 native block odb type id 值(2×字符数+8)

你可能感兴趣的:(J#)