Saturday, September 11, 2004
Tuesday, September 07, 2004
synergy makes kvm's pretty useless and unpractical if both your machines have a lan connection... you gotta use it to appreciate how insanely useful this piece of software is... it basically allows you to use one keyboard and mouse on two or more machines... works on unix and windows or a combination of it... even the mouse wheel works... yipee!
work stuff... naming conventions... the stuffs related to persistence was previously named like this:
e.g.
com.thecompany.hb.customers
contains both the interface and the implementation classes... hbm xdoclet generated files follows the same format except that its prefix is hbm, like hbm.thecompany.hb.customers
much to my front end pal's dismay i changed all the package names to follow this convention:
e.g.
com.thecompany.customers
to contain just the pojo and the dao and service interfaces... and for the actual implementation:
e.g.
com.thecompany.customers.hb
at least my co-developers will only need to worry about the interfaces and let me worry with the implementation... which is newly migrated to hibernate for now... but will likely try a jdo implementation in the near future...
spring framework is really doing a great job of supporting structures like this... and i can try varied implementations without driving my co-developers insane... also our discussions would be centered on services and dao's in a much more abstract way... shielding them away from the implementation and likewise do things in parallel based on assumptions... this also allows me to junit test the implementation as much as i want... the previous ejb cmp/cmr implementation was such a pain to test...
on hibernate... using the postgres sequence with it was not clearly documented... or it took me a good deal of google time to find out...
for example you have a sequence and a table like this:
create sequence customer_id_seq;
and you have a table like so:
create table customers (
id integer DEFAULT nextval('customer_id_seq') NOT NULL,
name varchar(20),
address varchar(5),
constraint custumers_pk primary key (id)
);
the correct xdocletized pojo class would be:
/**
* @hibernate.class table="customers"
*
**/
public class Customer {
// primary key field
private java.lang.Long id;
// other fields
private java.lang.String name;
private java.lang.String address;
// eclipse's generate getters and setters...
// here is the correct xdoclet tag to be able to use the
// postgres sequence
/**
* @return Returns the id.
*
* @hibernate.id generator-class="sequence"
*
* @hibernate.generator-param name="sequence" value="customer_id_seq"
**/
public java.lang.Long getId() {
return id;
}
// other getters and setters here....
...
}
there... hope this could be of help to anyone who wants to get his sequences to work with hibernate and is using xdoclet to generate the mapping files...
change topic... firefox crashes evertime i visit a flash enabled site... reinstalling and upgrading doesnt help... cant pinpoint if the problem is gentoo, xorg or linux specific...
e.g.
com.thecompany.hb.customers
contains both the interface and the implementation classes... hbm xdoclet generated files follows the same format except that its prefix is hbm, like hbm.thecompany.hb.customers
much to my front end pal's dismay i changed all the package names to follow this convention:
e.g.
com.thecompany.customers
to contain just the pojo and the dao and service interfaces... and for the actual implementation:
e.g.
com.thecompany.customers.hb
at least my co-developers will only need to worry about the interfaces and let me worry with the implementation... which is newly migrated to hibernate for now... but will likely try a jdo implementation in the near future...
spring framework is really doing a great job of supporting structures like this... and i can try varied implementations without driving my co-developers insane... also our discussions would be centered on services and dao's in a much more abstract way... shielding them away from the implementation and likewise do things in parallel based on assumptions... this also allows me to junit test the implementation as much as i want... the previous ejb cmp/cmr implementation was such a pain to test...
on hibernate... using the postgres sequence with it was not clearly documented... or it took me a good deal of google time to find out...
for example you have a sequence and a table like this:
create sequence customer_id_seq;
and you have a table like so:
create table customers (
id integer DEFAULT nextval('customer_id_seq') NOT NULL,
name varchar(20),
address varchar(5),
constraint custumers_pk primary key (id)
);
the correct xdocletized pojo class would be:
/**
* @hibernate.class table="customers"
*
**/
public class Customer {
// primary key field
private java.lang.Long id;
// other fields
private java.lang.String name;
private java.lang.String address;
// eclipse's generate getters and setters...
// here is the correct xdoclet tag to be able to use the
// postgres sequence
/**
* @return Returns the id.
*
* @hibernate.id generator-class="sequence"
*
* @hibernate.generator-param name="sequence" value="customer_id_seq"
**/
public java.lang.Long getId() {
return id;
}
// other getters and setters here....
...
}
there... hope this could be of help to anyone who wants to get his sequences to work with hibernate and is using xdoclet to generate the mapping files...
change topic... firefox crashes evertime i visit a flash enabled site... reinstalling and upgrading doesnt help... cant pinpoint if the problem is gentoo, xorg or linux specific...
life goes by pretty fast... rojan is turning three and gabriel is almost a month old now... gabriel, is now my coding companion... he wakes up at around 2am, just in time to remind me i need to get a break away from the keyboard and cuddle him for a while... rojan is now getting really interested on books and would argue if your telling the story the wrong way... hehehe...
seriously need a good computer chair for the home office setup... good back support is a must... should allow me to lean back safely to support both gabriel and me... and to withstand being pushed around the room by an almost 3 year old kid..
last song syndrome: shake yer head by the eraserheads... brings back fond memories of those years when am young and naive... *sigh*... its nice to be born upside down...
seriously need a good computer chair for the home office setup... good back support is a must... should allow me to lean back safely to support both gabriel and me... and to withstand being pushed around the room by an almost 3 year old kid..
last song syndrome: shake yer head by the eraserheads... brings back fond memories of those years when am young and naive... *sigh*... its nice to be born upside down...
Subscribe to:
Posts (Atom)