Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e57356e

Browse files
+ table fix
1 parent 8685e24 commit e57356e

File tree

1 file changed

+37
-17
lines changed

1 file changed

+37
-17
lines changed

‎README.md‎

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,32 @@
4040
- ManyToMany
4141

4242
8. __`get()` v/s `load()`__<br>
43-
`get()`|`load()`
44-
----------|----------
45-
Returns null if an object is not found. | Throws ObjectNotFoundException if an object is not found.
46-
get() method always hit the database. | load() method doesn't hit the database.
47-
get() returns the real object, not the proxy. | load() returns proxy object.
48-
get() should be used if you are not sure about the existence of instance. | load() should be used if you are sure that instance exists.
43+
<table>
44+
<tr>
45+
<th><samp>get()</samp></th>
46+
<td><samp>load()</samp></th>
47+
</tr>
48+
<tr>
49+
<td>Returns null if an object is not found.</td>
50+
<td>Throws ObjectNotFoundException if an object is not found.</td>
51+
</tr>
52+
<tr>
53+
<td><samp>get()</samp> method always hit the database.</td>
54+
<td><samp>load()</samp> method doesn't hit the database.</td>
55+
</tr>
56+
<tr>
57+
<td><samp>get()</samp> returns the real object, not the proxy.</td>
58+
<td><samp>load()</samp> returns proxy object.</td>
59+
</tr>
60+
<tr>
61+
<td><samp>get()</samp> should be used if you are not sure about the existence of instance.</td>
62+
<td><samp>load()</samp> should be used if you are sure that instance exists.</td>
63+
</tr>
64+
</table>
65+
66+
|
67+
|
68+
|
4969

5070
9. __Different Hibernate Inheritence Strategies__<br>
5171
- Table Per Hierarchy
@@ -74,33 +94,33 @@
7494
12. __What is Hibernate?__<br>
7595
Hibernate is a Java framework that simplifies the development of Java application to interact with the database. It is an open source, lightweight, ORM (Object Relational Mapping) tool. Hibernate implements the specifications of JPA (Java Persistence API) for data persistence.
7696

77-
14. __Configuration in Hibernate__<br>
97+
13. __Configuration in Hibernate__<br>
7898
- Combination of Configuration XML and Mapping XML file
7999
- Annotations
80100

81-
15. __Advantages and Jobs of ORM__<br>
101+
14. __Advantages and Jobs of ORM__<br>
82102
ORM stands for Object/Relational mapping. It is the programmed and translucent perseverance of objects in a Java application in to the tables of a relational database using the metadata that describes the mapping between the objects and the database. It works by transforming the data from one representation to another.
83103

84104
_Advantages:_
85105
- Speeds-up Development - eliminates the need for repetitive SQL code.
86106
- Overcomes vendor specific SQL differences - the ORM knows how to write vendor specific SQL so you don't have to.
87107

88-
16. __Criteria Query & How to create it__<br>
108+
15. __Criteria Query & How to create it__<br>
89109
Hibernate provides alternate ways of manipulating objects and in turn data available in RDBMS tables. One of the methods is Criteria API, which allows you to build up a criteria query object programmatically where you can apply filtration rules and logical conditions.
90110

91111
The Hibernate `Session` interface provides `createCriteria()` method, which can be used to create a `Criteria` object that returns instances of the persistence object's class when your application executes a criteria query.
92112

93-
17. __Significance of `hbm2ddl.auto`__<br>
113+
16. __Significance of `hbm2ddl.auto`__<br>
94114
`hibernate.hbm2ddl.auto` Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.
95115
- *validate*: validate the schema, makes no changes to the database.
96116
- *update*: update the schema.
97117
- *create*: creates the schema, destroying previous data.
98118
- *create-drop*: drop the schema when the SessionFactory is closed explicitly, typically when the application is stopped.
99119

100-
18. __Significance of Session object in Hibernate__<br>
120+
17. __Significance of Session object in Hibernate__<br>
101121
A Session is used to get a physical connection with a database. The Session object is lightweight and designed to be instantiated each time an interaction is needed with the database. Persistent objects are saved and retrieved through a Session object.
102122

103-
19. __Methods of Session object__<br>
123+
18. __Methods of Session object__<br>
104124
- `beginTransaction()`
105125
- `save()`
106126
- `update()`
@@ -112,7 +132,7 @@
112132
- `flush()`
113133
- `delete()`
114134

115-
20. __EAGER v/s LAZY loading__<br>
135+
19. __EAGER v/s LAZY loading__<br>
116136
Lazy loading:
117137
> Lazy Loading. It is the default behavior of an Entity Framework, where a child entity is loaded only when it is accessed for the first time.
118138
> It simply delays the loading of the related data, until you ask for it.
@@ -121,7 +141,7 @@
121141
> Eager Loading helps you to load all your needed entities at once; i.e., all your child entities will be loaded at single database call.
122142
> This can be achieved, using the Include method, which returs the related entities as a part of the query and a large amount of data is loaded at once.
123143
124-
21. __Significance of HQL__<br>
144+
20. __Significance of HQL__<br>
125145
It is more beneficial to use HQL instead of native SQ retrieve data from databases. The following are some of the reasons why HQL is preferred over SQL:
126146
- Provides full support for relational operations.
127147
- Return results as objects.
@@ -130,15 +150,15 @@
130150
- Supports many advanced features as compared to SQL, such as pagination, fetch join etc.
131151
- Provides database independency.
132152

133-
22. __Important components in Hibernate Architecture__<br>
153+
21. __Important components in Hibernate Architecture__<br>
134154
- Configuration Object
135155
- SessionFactory Object
136156
- Session Object
137157
- Transaction Object
138158
- Query Object
139159
- Criteria Object
140160

141-
23. __LifeCycle states of an object in Hibernate__<br>
161+
22. __LifeCycle states of an object in Hibernate__<br>
142162
- Transient State
143163
> A transient state is one where hibernate session is not associated with the object instance and does not represent a row in the database table.
144164
- Persistent State
@@ -148,7 +168,7 @@
148168
- Removed State
149169
> When the persistent object is deleted from the database, it is passed to the session’s `delete(obj)` method. At this state, java instance exists but any changes made to the object are not saved to the database.
150170
151-
24. __Different annotations used in `@ManyToMany` Association__<br>
171+
23. __Different annotations used in `@ManyToMany` Association__<br>
152172
- `@JoinTable`
153173
- `@JoinColumn`
154174

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /