logicannullata + common   18

Peter On Java: Reading and Writing UTC Timestamps to DB with Hibernate
package ch.meteoswiss.commons.hibernate;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.SimpleTimeZone;
 * <tt>timestamp</tt>: A type that maps an SQL TIMESTAMP to a Java
 * java.util.Date or java.sql.Timestamp using UTC time zone.
 * @author Peter Keller
public class UTCTimestampType extends org.hibernate.type.TimestampType {
    public Ob...
peter  keller  java  hibernate  read  timestamp  as  UTC  custom  TImestampType  howto  utils  very  common  problems  timezone  offset  agnostic  mysql  database  access 
november 2015 by logicannullata
Java Practices -> Implementing equals
//check for self-comparison if ( this == aThat ) return true; //use instanceof instead of getClass here for two reasons //1. if need be, it can match any supertype, and not just one class; //2. it renders an explict check for "that == null" redundant, since //it does the check for null already - "null instanceof [type]" always //returns false. (See Effective Java by Joshua Bloch.) if ( !(aThat instanceof Car) ) return false; //Alternative to the above line : //if ( aThat == null || aThat.getClass() != this.getClass() ) return false; //cast to native object is now safe Car that = (Car)aThat; //now a proper field-by-field evaluation can be made return EqualsUtil.areEqual(this.fName, that.fName) && EqualsUtil.areEqual(this.fNumDoors, that.fNumDoors) && EqualsUtil.areEqual(this.fOptions, that.fOptions) && EqualsUtil.areEqual(this.fGasMileage, that.fGasMileage) && EqualsUtil.areEqual(this.fColor, that.fC
standard  development  equals  common  compare  good  contains  object  code  howto  reference  utils  implementation  practice  java  snippets 
october 2013 by logicannullata

related tags

2.0.3  access  accordo.it  add  admin  administration  administrator  advantages  after  agnostic  amdinistration  api  article  as  async  atomic  beginner  bloackchain  blog  boot  boot-repair  bug  building  busybox  cache  check  chitarra  chitarre  CL  clojure  cloud  cloudcomputing  code  command  common  compare  complexity  computing  conceptual  configuration  cons  contains  custom  daabase  dapp  data  database  db  DBA  debug  deletion  description  design  detection  dev  developer  development  diff  disadvantages  discussion  django  down  drift  email  EMI  equals  errors  eth  ethereum  euca  euca2ools  eucalyptus  example  examples  explanation  failuer  fix  fixes  frequency  functional  geek  good  grub  guide  hibernate  history  how  howto  hunter  hybridfox  implementation  in  initramfs  insertion  installation  issues  java  java8  job  keller  kernel  language  limited  line  linux  lisp  listp  maintenance  manico  master  maven3  mistakes  moving  music  musica  mysql  neck  noobs  notes  object  of  offset  operation  operations  out  package  patch  peter  pop  possibilities  practice  problem  problems  programming  pros  push  questions  quick  range  read  reason  reference  refresh  regexp  remove  repair  replay  replica  requests  same  scalatura  scale  shell  shooting  signature  simple  snippets  solutions  solve  stackexchange  standard  startup  steps  streams  structure  suggestions  summary  sync  sysadmin  system  talk  thumbs  timestamp  TImestampType  timezone  tips  to  tricks  trojan  trouble  troubleshooting  truffle  tutorial  types  typica  ubuntu  update  upgrade  use  useful  UTC  utils  validation  various  very  virtualization  with 

Copy this bookmark: