Sql Nested Case Syntax In Java