-
1. Re: User defined data types
rareddy Oct 12, 2011 12:28 PM (in response to lskv)1 of 1 people found this helpfulSunil,
Yes, there is way to model the data types for your enterprise. In the Teiid Designer, create a project and then create a new XMLSchema file. Select the newly created XMLSchema file, right click and open with "Model Editor", this open up a Simple Data Type Editor, where you can model your data types based on the other types available.
Once you define the data types, you can model your models using the defined data types. However, note that they all have to eventually map to a Teiid runtime type (SQL Type) in the end. Also, the metadata collected in the data types editor is not fuly utilized at runtime, however you can query the meta models for data type information for anylytical purposes using Modeshape or System tables.
Ramesh..
-
2. Re: User defined data types
mr.bee Aug 10, 2012 5:34 AM (in response to rareddy)Hi Ramesh,
I have been successfully able to create user-defined type and used it in a column of the Table in View Model, but when i deploy the VDB, Teiid set it to INVALID.
if i use build-in type i.e string instead of my defined type, it works.
Please find the teiid project in attachments...
Am i missing anything ? any help?
regards,
Nabeel
-
TimeSeries.zip 25.1 KB
-
-
3. Re: User defined data types
rareddy Aug 10, 2012 2:15 PM (in response to mr.bee)The attached VDB deployed fine for me on the latest trunk version, is that one with the string or user defined type?
-
4. Re: User defined data types
mr.bee Aug 13, 2012 2:04 AM (in response to rareddy)Yes, it is with user-defined type named "Tag".
I am using teiid-alpha2.
I will upgrade to teiid-beta2 and give it a try.
-
5. Re: User defined data types
mr.bee Aug 13, 2012 4:36 AM (in response to mr.bee)Hi Ramesh,
I have tried it on Teiid-Beta2, it's working.
How can i find this type in Database metadata object in my java application?
i.e i am trying to get this type as follows:
// metadata is an object of DatabaseMetaData
ResultSet rs = metadata.getColumns(vdbname, modelName, tableName, null);
and
String type = rs.getString("TYPE_NAME")
i always got the string instead of my defined type.
regards,
Nabeel
-
6. Re: User defined data types
rareddy Aug 13, 2012 9:05 AM (in response to mr.bee)Nabeel,
Currently all the user defined types are mapped to the runtime data types in Teiid engine, thus you are seeing above through JDBC metadata. JDBC API does not provide extensions to show the user defined types, so it has to be some some extension Teiid needs to provide on top of the JDBC API to provide that. I do not think there is facility for that now.
Thanks
Ramesh..