what is Hibernate?

B

BigZero

Hello ppl,

can any body tell me what is this "Hibernate"?
i m new to java i just started learning java from last 4 month now i
came to known something called "Hibernate" concept, but i m not
understanding basic concept of Hibernate in java can any body tell me
the link to learn the basic idea or use of Hibernate in java.




Thanks
VM
 
A

Arne Vajhøj

D

Daniel Pitts

BigZero said:
Well i did that first then i came here for any quick way to learn it.

Fair enough, but I would suggest that you first do some reading about
it, and come here with specific questions. You'll get the most out of
this newsgroup if you've shown that you've used some initial effort to
try to figure something out.

Many people here will ask for an SSCCE before they help you (Google for
SSCCE if you don't know what it is). This will help us figure out
exactly what you are trying to do, and even help us point out bad
assumptions or mistakes.

I'm not trying to be ogre. I'm just letting you know the best strategy
for getting help that I've observed on this group :)

Good luck,
Daniel.
 
A

Arne Vajhøj

BigZero said:
Well i did that first then i came here for any quick way to learn it.

Buy a book and spend 6 months working with it.

It is way to big a topic to "learn quick".

Arne
 
B

BigZero

Well thanks,
But spending 6 month is too long for me, an simple application
developed by me using snmp protocol. the aim is to get hardware and
software information of client machine and store it back into server
database, this application is complete independent i mean it will work
on any os no matter the back end working or front end working the
application still runs.
but one single problem is database. now i have come to known something
called "Hibernate" by end of this month we going to release it as
"OPEN SOURCE" i have 22nd aug is date to complete it by end of this
month it going to be open source ill send the link......





Thanks
VM
 
D

Daniel Pitts

BigZero said:
Well thanks,
But spending 6 month is too long for me, an simple application
developed by me using snmp protocol. the aim is to get hardware and
software information of client machine and store it back into server
database, this application is complete independent i mean it will work
on any os no matter the back end working or front end working the
application still runs.
but one single problem is database. now i have come to known something
called "Hibernate" by end of this month we going to release it as
"OPEN SOURCE" i have 22nd aug is date to complete it by end of this
month it going to be open source ill send the link......

6 months was an exaggeration. Go to hibernate.org, download the library
and read some of the tutorials. You'll be up and running in less than a
week. You might make a lot of mistakes the first time around though, so
be prepared to re-write, or study longer than a week before starting.
 
A

Arne Vajhøj

BigZero said:
But spending 6 month is too long for me, an simple application
developed by me using snmp protocol. the aim is to get hardware and
software information of client machine and store it back into server
database, this application is complete independent i mean it will work
on any os no matter the back end working or front end working the
application still runs.
but one single problem is database. now i have come to known something
called "Hibernate" by end of this month we going to release it as
"OPEN SOURCE" i have 22nd aug is date to complete it by end of this
month it going to be open source ill send the link......

You can probably learn to use Hibernate to persist some
data with a simple database structure where performance
is not critical within that time frame.

Try read the first 10 chapters of
http://www.hibernate.org/hib_docs/v3/reference/en/html/ !

Arne
 
A

Arne Vajhøj

Daniel said:
6 months was an exaggeration. Go to hibernate.org, download the library
and read some of the tutorials. You'll be up and running in less than a
week. You might make a lot of mistakes the first time around though, so
be prepared to re-write, or study longer than a week before starting.

The 6 months was my invention.

I may have misunderstood what "learn" Hibernate meant.

It is of course possible to get started with Hibernate reasonable
quickly.

But to master mapping of existing table structure and performance
tuning requires a lot of reading and a lot of experimenting.

Arne
 
M

marlow.andrew

BigZero said:
Well thanks,
But spending 6 month is too long for me, an simple application
developed by me using snmp protocol.

A six month learning curve doesn't sound that long to me for a
reasonably big framework. Where I am currently working Hibernate is
being used and I anticipated a similar learning time. But I have been
told that Hibernate skills are so difficult to come by that the
Hibernate dependency will be removed and good ol' JDBC will be used
instead. Sigh.

-Andrew Marlow
 
B

BigZero

hey got the solution for the above my problem not good one but it's
working fine with me
small change to DB and making "two time commit" ....



Thanks
VM
 
A

Arne Vajhøj

A six month learning curve doesn't sound that long to me for a
reasonably big framework. Where I am currently working Hibernate is
being used and I anticipated a similar learning time. But I have been
told that Hibernate skills are so difficult to come by that the
Hibernate dependency will be removed and good ol' JDBC will be used
instead. Sigh.

If the database structure was not defined before Hibernate came
into the picture *and* the developers have a good understanding that
it takes time to learn things and that unit tests working may not
indicate optimal code, but that looking at the generated SQL and
working with caching options is a must, then Hibernate is not bad.
And if the developers are not able to learn to use Hibernate, then
I doubt that the direct JDBC calls will be good !

Arne
 
A

Arne Vajhøj

BigZero said:
hey got the solution for the above my problem not good one but it's
working fine with me
small change to DB and making "two time commit" ....

If you post some more info including code, then we may be
able to provide you with some help.

Arne
 
B

BigZero

by end of this month whole code going to release.any way i m giving
you the part my code that has problem.

These are the two table system_master and soft_detail and it has one-
to-many relationship.
Current database: snmp
system_master
+-------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+-------+
| ipAddress | varchar(20) | NO | PRI | NULL | |
| sysName | varchar(45) | YES | | NULL | |
| ramCapacity | varchar(20) | YES | | NULL | |
| hddCapacity | varchar(20) | YES | | NULL | |
| osRunning | varchar(25) | YES | | NULL | |
| sysMac | varchar(200) | YES | | NULL | |
| lastUpdate | varchar(45) | YES | | NULL | |
+-------------+--------------+------+-----+---------+-------+
soft_detail
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| ipAddress | varchar(20) | YES | MUL | NULL | |
| softName | varchar(250) | YES | | NULL | |
| lastUpdate | varchar(45) | NO | | NULL | |
+------------+--------------+------+-----+---------+-------+

and my mapping file is like this
[code map]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="com.s7.admintools.dao.Hardware" table="system_master">

<id name="ipAddress" column="ipAddress" type="java.lang.String">
</id>

<property name="sysName" column="sysName" />
<property name="ramCapacity" column="ramCapacity" />
<property name="hddCapacity" column="hddCapacity" />
<property name="osRunning" column="osRunning" />
<property name="sysMac" column="sysMac" />
<property name="lastUpdate" column="lastUpdate" />

</class>

<class name="com.s7.admintools.dao.Software" table="soft_detail">
<id name="ipAddress" column="ipAddress" type="java.lang.String">
</id>
<!-- <property name="ipAddress" column="ipAddress"/> -->
<property name="softName" column="softName"/>
<property name="lastUpdate" column="lastUpdate" />

</class>

</hibernate-mapping>
[/code map]

this code working but in two different commit, i mean that i making
two open transactions and commit. but i thinking we can do this within
one commit.




Thanks
VM
 
B

BigZero

Thanks sir,

here is the point i have two table with one to many relationship and
the data came from snmp protocol, ex system ipaddres system ram
capacity etc and in other table we ref with ipaddress and single
machine as more then one software in machine so we made a one to many
relationship ok.


and i want insert into data base, when map data to my mapping class
then it works for one table for other table it has list/collection
object and i want update both with single transaction and single
commit.

hope this may clear you otherwise ill upload code to some open source
site from that you can use it.



Thanks
VM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,264
Latest member
FletcherDa

Latest Threads

Top