Tuesday, July 31, 2012

NETBEANS IDE 6/7 KEYBOARD SHORTCUTS & CODE TEMPLATES (WINDOWS)



KEYBOARD SHORT-CUTS  & CODE TEMPLATES FOR WINDOWS


The NetBeans IDE has seen one of the popular among IDE's over the past years, particularly with the adaptation of a completely smart,intelligent, slick Java/J2EE  along with different open source appliaction editor. Here are the Keyboard Short-Cuts, Hope that You will like for reference.....

Searching, Finding, and Replacing



KEYACTION                                 
Ctrl-F3 For Search word at insert point
Ctrl-F/H For Find/Replace in file
Ctrl-Shift-PTo Find/replace in projects
Ctrl-R For Rename
Ctrl-U, and SToggle case of selection
Ctrl-U, then LConverting the selection to lowercase
Ctrl-U, then UConverting the selection to uppercase
Alt-Shift-VFormatted Paste
Alt-F7Finding usages
Alt-Shift-UFind usages results
Alt-Shift-HTurning off searched result highlights
F3/Shift-F3Find next/previous in file







NETBEANS IDE Mac OS Keyboard Shortcuts

Mac OS Keyboard Shortcuts NETBEANS 6/7

Here are the shortcuts of NETBEANS 6/7 in MAC OS


Scrolling and Selecting

KEYDESCRIPTION
Cmd-A Selects all text in the file.
Cmd-[
Moves the insertion point to the highlighted matching bracket.
Note that this shortcut only works when the insertion point is
located immediately after the opening bracket.
Ctrl-G Jumps to any specified line.
Cmd-Shift-[
Selects the block between a pair of brackets. Note that this shortcut
only works when the insertion point is located immediately after
either the opening or closing bracket.





Wednesday, July 25, 2012

Hibernate Interview Questions - PART-II


HIBERNATE



16. What’s the difference between load() and get()?

                                load()                             get()
Only use the load() method if you are sure that the object exists.Only use the load() method if you are sure that the object exists.
load() method will throw an exception if the unique id is not found in the database.
get() method will return null if the unique id is not found in the database.
load() just returns a proxy by default and database won’t be hit until the proxy is first invoked.  get() will hit the database immediately.


17.What is the difference between and merge and update ?

Use update() if you are sure that the session does not contain an already persistent instance with the same identifier, and merge() if you want to merge your modifications at any time without consideration of the state of the session.



18.How do you define sequence generated primary key in hibernate?

Using <generator> tag.

Example:-

<id column="ACC_ID" name="id" type="java.lang.Long"> 

   <generator class="sequence">

     <param name="table">SEQUENCE_NAME</param>

   <generator>

</id>