11/* 
2-  * Copyright (c) 2011-2019  Contributors to the Eclipse Foundation 
2+  * Copyright (c) 2011-2021  Contributors to the Eclipse Foundation 
33 * 
44 * This program and the accompanying materials are made available under the 
55 * terms of the Eclipse Public License 2.0 which is available at 
1111
1212package  io .vertx .mssqlclient .impl .codec ;
1313
14- import  io .vertx .mssqlclient .impl .protocol .datatype .MSSQLDataType ;
1514import  io .vertx .sqlclient .desc .ColumnDescriptor ;
1615
1716import  java .sql .JDBCType ;
1817
1918public  final  class  ColumnData  implements  ColumnDescriptor  {
20-   /* 
21-     Protocol reference: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/58880b9f-381c-43b2-bf8b-0727a98c4f4c 
22-    */ 
23-   private  final  long  usertype ;
24-   private  final  int  flags ;
25-   private  final  MSSQLDataType  dataType ;
26-   private  final  String  colName ;
2719
28-   //  CryptoMetaData support? 
29-   String  tableName ;
20+   private  final  String  name ;
21+   private  final  DataType  dataType ;
22+   private  final  DataType .Metadata  metadata ;
3023
31-   public  ColumnData (long  usertype , int  flags , MSSQLDataType  dataType , String  colName ) {
32-     this .usertype  = usertype ;
33-     this .flags  = flags ;
24+   public  ColumnData (String  name , DataType  dataType , DataType .Metadata  metadata ) {
3425    this .dataType  = dataType ;
35-     this .colName  = colName ;
26+     this .name  = name ;
27+     this .metadata  = metadata ;
3628  }
3729
38-   public  long  usertype () {
39-     return  usertype ;
40-   }
41- 
42-   public  int  flags () {
43-     return  flags ;
44-   }
45- 
46-   public  MSSQLDataType  dataType () {
30+   public  DataType  dataType () {
4731    return  dataType ;
4832  }
4933
50-   public  String  colName () {
51-     return  colName ;
52-   }
53- 
54-   public  String  tableName () {
55-     return  tableName ;
34+   public  DataType .Metadata  metadata () {
35+     return  metadata ;
5636  }
5737
5838  @ Override 
5939  public  String  name () {
60-     return  colName ;
40+     return  name ;
6141  }
6242
6343  @ Override 
@@ -67,22 +47,6 @@ public boolean isArray() {
6747
6848  @ Override 
6949  public  JDBCType  jdbcType () {
70-     return  dataType .jdbcType ();
71-   }
72- 
73-   public  static  final  class  Flags  {
74-     public  static  final  int  NULLABLE  = 0x0001 ;
75-     public  static  final  int  CASESEN  = 0x0002 ;
76-     public  static  final  int  UPDATEABLE  = 0x0004 ;
77-     public  static  final  int  IDENTITY  = 0x0010 ;
78-     public  static  final  int  COMPUTED  = 0x0020 ;
79-     // 2-BIT RESERVED for ODBC 
80-     public  static  final  int  FIXED_LEN_CLR_TYPE  = 0x0100 ;
81-     // 1-BIT RESERVED 
82-     public  static  final  int  SPARSE_COLUMN_SET  = 0x0400 ;
83-     public  static  final  int  ENCRYPTED  = 0x0800 ;
84-     public  static  final  int  HIDDEN  = 0x2000 ;
85-     public  static  final  int  KEY  = 0x4000 ;
86-     public  static  final  int  NULLABLE_UNKNOWN  = 0x8000 ;
50+     return  dataType .jdbcType (metadata );
8751  }
8852}
0 commit comments