<classpathentry kind="lib" path="ext/xpp3_min-1.1.4c.jar" />
<classpathentry kind="lib" path="ext/junit-4.11.jar" sourcepath="ext/src/junit-4.11.jar" />
<classpathentry kind="lib" path="ext/jmock-1.0.1.jar" sourcepath="ext/src/jmock-1.0.1.jar" />
+ <classpathentry kind="lib" path="ext/snakeyaml-1.14.jar" sourcepath="ext/src/snakeyaml-1.14.jar" />
<classpathentry kind="lib" path="ext/hamcrest-core-1.3.jar" sourcepath="ext/src/hamcrest-core-1.3.jar" />
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" />
<classpathentry kind="output" path="bin/classes" />
- provided 'commons-dbcp:commons-dbcp:1.4'
- provided 'com.google.code.gson:gson:2.3'
- provided 'com.thoughtworks.xstream:xstream:1.4.7'
+- provided 'org.yaml:snakeyaml:1.14'
- test 'junit'
- build 'jacoco'
- Improved automatic date conversions
- Revised data type adapters to be specified separately with the @TypeAdapter annotation
additions:
- - Add a Dao feature similar to JDBI
+ - Add a DAO feature similar to JDBI
+ - Added Gson, XStream, and SnakeYaml type adapters
dependencyChanges: ~
contributors:
- James Moger
import com.iciql.Iciql.DataTypeAdapter;
/**
- * Base class for inserting/retrieving a Java Object (de)serialized as JSON using Google GSON.
- * <p>You use this by creating a subclass which defines your object class.</p>
+ * Base class for inserting/retrieving a Java Object (de)serialized as JSON
+ * using Google GSON.
+ * <p>
+ * You use this by creating a subclass which defines your object class.
+ * </p>
+ *
* <pre>
* public class CustomObjectAdapter extends GsonTypeAdapter<CustomObject> {
*
- * public Class<CustomObject> getJavaType() {
- * return CustomObject.class;
- * }
+ * public Class<CustomObject> getJavaType() {
+ * return CustomObject.class;
+ * }
* }
* </pre>
+ *
* @param <T>
*/
public abstract class GsonTypeAdapter<T> implements DataTypeAdapter<T> {
--- /dev/null
+/*
+ * Copyright 2014 James Moger.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.iciql.adapter;
+
+import org.yaml.snakeyaml.DumperOptions.FlowStyle;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.nodes.Tag;
+
+import com.iciql.Iciql.DataTypeAdapter;
+
+/**
+ * Base class for inserting/retrieving a Java Object (de)serialized as YAML using SnakeYaml.
+ */
+public abstract class SnakeYamlTypeAdapter<T> implements DataTypeAdapter<T> {
+
+ protected Yaml yaml() {
+ return new Yaml();
+ }
+
+ @Override
+ public String getDataType() {
+ return "TEXT";
+ }
+
+ @Override
+ public abstract Class<T> getJavaType();
+
+ @Override
+ public Object serialize(Object value) {
+ return yaml().dumpAs(value, Tag.MAP, FlowStyle.BLOCK);
+ }
+
+ @Override
+ public T deserialize(Object value) {
+ String yaml = value.toString();
+ Yaml processor = yaml();
+ T t = processor.loadAs(yaml, getJavaType());
+ return t;
+ }
+
+}
/**
* Base class for inserting/retrieving a Java Object (de)serialized as XML using XStream.
- * <p>You use this by creating a subclass which defines your object class.</p>
- * <pre>
- * public class CustomObjectAdapter extends XStreamTypeAdapter<CustomObject> {
- *
- * public Class<CustomObject> getJavaType() {
- * return CustomObject.class;
- * }
- * }
- * </pre>
- * @param <T>
*/
-public abstract class XStreamTypeAdapter<T> implements DataTypeAdapter<T> {
+public class XStreamTypeAdapter implements DataTypeAdapter<Object> {
protected XStream xstream() {
return new XStream();
}
@Override
- public Object serialize(T value) {
+ public Class<Object> getJavaType() {
+ return Object.class;
+ }
+
+ @Override
+ public Object serialize(Object value) {
return xstream().toXML(value);
}
@Override
- public T deserialize(Object value) {
+ public Object deserialize(Object value) {
String xml = value.toString();
XStream xstream = xstream();
- T t = (T) xstream.fromXML(xml);
+ Object t = xstream.fromXML(xml);
return t;
}
+
}
+++ /dev/null
-/*
- * Copyright 2014 James Moger.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.iciql.adapter.postgres;
-
-import java.sql.SQLException;
-
-import org.postgresql.util.PGobject;
-
-import com.iciql.adapter.GsonTypeAdapter;
-
-/**
- * Postgres JSONB data type adapter maps a JSONB column to a domain object using Google GSON.
- *
- * @author James Moger
- *
- * @param <T>
- */
-public abstract class GsonBTypeAdapter<T> extends GsonTypeAdapter<T> {
-
- @Override
- public String getDataType() {
- return "jsonb";
- }
-
- @Override
- public Object serialize(T value) {
-
- String json = gson().toJson(value);
- PGobject pg = new PGobject();
- pg.setType(getDataType());
- try {
- pg.setValue(json);
- } catch (SQLException e) {
- // not thrown on base PGobject
- }
- return pg;
- }
-}
+++ /dev/null
-/*
- * Copyright 2014 James Moger.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.iciql.adapter.postgres;
-
-import java.sql.SQLException;
-
-import org.postgresql.util.PGobject;
-
-/**
- * Postgres JSON data type adapter maps a JSON column to a domain object using Google GSON.
- *
- * @author James Moger
- *
- * @param <T>
- */
-public abstract class GsonTypeAdapter<T> extends com.iciql.adapter.GsonTypeAdapter<T> {
-
- @Override
- public String getDataType() {
- return "json";
- }
-
- @Override
- public Object serialize(T value) {
-
- String json = gson().toJson(value);
- PGobject pg = new PGobject();
- pg.setType(getDataType());
- try {
- pg.setValue(json);
- } catch (SQLException e) {
- // not thrown on base PGobject
- }
- return pg;
- }
-}
+++ /dev/null
-/*
- * Copyright 2014 James Moger.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.iciql.adapter.postgres;
-
-import java.sql.SQLException;
-
-import org.postgresql.util.PGobject;
-
-import com.iciql.Iciql.DataTypeAdapter;
-
-/**
- * Handles transforming raw strings to/from the Postgres JSON data type.
- */
- public class JsonStringAdapter implements DataTypeAdapter<String> {
-
- @Override
- public String getDataType() {
- return "json";
- }
-
- @Override
- public Class<String> getJavaType() {
- return String.class;
- }
-
- @Override
- public Object serialize(String value) {
- PGobject pg = new PGobject();
- pg.setType(getDataType());
- try {
- pg.setValue(value);
- } catch (SQLException e) {
- // not thrown on base PGobject
- }
- return pg;
- }
-
- @Override
- public String deserialize(Object value) {
- return value.toString();
- }
- }
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright 2014 James Moger.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.iciql.adapter.postgres;
-
-import java.sql.SQLException;
-
-import org.postgresql.util.PGobject;
-
-import com.iciql.Iciql.DataTypeAdapter;
-
-/**
- * Handles transforming raw strings to/from the Postgres JSONB data type.
- */
-public class JsonbStringAdapter implements DataTypeAdapter<String> {
-
- @Override
- public String getDataType() {
- return "jsonb";
- }
-
- @Override
- public Class<String> getJavaType() {
- return String.class;
- }
-
- @Override
- public Object serialize(String value) {
- PGobject pg = new PGobject();
- pg.setType(getDataType());
- try {
- pg.setValue(value);
- } catch (SQLException e) {
- // not thrown on base PGobject
- }
- return pg;
- }
-
- @Override
- public String deserialize(Object value) {
- return value.toString();
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright 2014 James Moger.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.iciql.adapter.postgres;
-
-
-
-/**
- * Postgres XML data type adapter maps an XML column to a domain object using XStream.
- *
- * @author James Moger
- *
- * @param <T>
- */
-public abstract class XStreamTypeAdapter<T> extends com.iciql.adapter.XStreamTypeAdapter<T> {
-
- @Override
- public String getDataType() {
- return "xml";
- }
-
-}
+++ /dev/null
-/*
- * Copyright 2014 James Moger.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.iciql.adapter.postgres;
-
-import java.sql.SQLException;
-
-import org.postgresql.util.PGobject;
-
-import com.iciql.Iciql.DataTypeAdapter;
-
-/**
- * Handles transforming raw strings to/from the Postgres XML data type.
- */
-public class XmlStringAdapter implements DataTypeAdapter<String> {
-
- @Override
- public String getDataType() {
- return "xml";
- }
-
- @Override
- public Class<String> getJavaType() {
- return String.class;
- }
-
- @Override
- public Object serialize(String value) {
- PGobject pg = new PGobject();
- pg.setType(getDataType());
- try {
- pg.setValue(value);
- } catch (SQLException e) {
- // not thrown on base PGobject
- }
- return pg;
- }
-
- @Override
- public String deserialize(Object value) {
- return value.toString();
- }
-}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2014 James Moger.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.iciql.adapter.postgresql;
+
+import java.sql.SQLException;
+
+import org.postgresql.util.PGobject;
+
+import com.iciql.adapter.GsonTypeAdapter;
+
+/**
+ * Postgres JSON data type adapter maps a JSON column to a domain object using
+ * Google GSON.
+ *
+ * @author James Moger
+ *
+ * @param <T>
+ */
+public abstract class JsonObjectAdapter<T> extends GsonTypeAdapter<T> {
+
+ @Override
+ public String getDataType() {
+ return "json";
+ }
+
+ @Override
+ public Object serialize(T value) {
+
+ String json = gson().toJson(value);
+ PGobject pg = new PGobject();
+ pg.setType(getDataType());
+ try {
+ pg.setValue(json);
+ } catch (SQLException e) {
+ // not thrown on base PGobject
+ }
+ return pg;
+ }
+}
--- /dev/null
+/*
+ * Copyright 2014 James Moger.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.iciql.adapter.postgresql;
+
+import java.sql.SQLException;
+
+import org.postgresql.util.PGobject;
+
+import com.iciql.Iciql.DataTypeAdapter;
+
+/**
+ * Handles transforming raw strings to/from the Postgres JSON data type.
+ */
+public class JsonStringAdapter implements DataTypeAdapter<String> {
+
+ @Override
+ public String getDataType() {
+ return "json";
+ }
+
+ @Override
+ public Class<String> getJavaType() {
+ return String.class;
+ }
+
+ @Override
+ public Object serialize(String value) {
+ PGobject pg = new PGobject();
+ pg.setType(getDataType());
+ try {
+ pg.setValue(value);
+ } catch (SQLException e) {
+ // not thrown on base PGobject
+ }
+ return pg;
+ }
+
+ @Override
+ public String deserialize(Object value) {
+ return value.toString();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2014 James Moger.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.iciql.adapter.postgresql;
+
+import java.sql.SQLException;
+
+import org.postgresql.util.PGobject;
+
+import com.iciql.adapter.GsonTypeAdapter;
+
+/**
+ * Postgres JSONB data type adapter maps a JSONB column to a domain object using
+ * Google GSON.
+ *
+ * @author James Moger
+ *
+ * @param <T>
+ */
+public abstract class JsonbObjectAdapter<T> extends GsonTypeAdapter<T> {
+
+ @Override
+ public String getDataType() {
+ return "jsonb";
+ }
+
+ @Override
+ public Object serialize(T value) {
+
+ String json = gson().toJson(value);
+ PGobject pg = new PGobject();
+ pg.setType(getDataType());
+ try {
+ pg.setValue(json);
+ } catch (SQLException e) {
+ // not thrown on base PGobject
+ }
+ return pg;
+ }
+}
--- /dev/null
+/*
+ * Copyright 2014 James Moger.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.iciql.adapter.postgresql;
+
+import java.sql.SQLException;
+
+import org.postgresql.util.PGobject;
+
+import com.iciql.Iciql.DataTypeAdapter;
+
+/**
+ * Handles transforming raw strings to/from the Postgres JSONB data type.
+ */
+public class JsonbStringAdapter implements DataTypeAdapter<String> {
+
+ @Override
+ public String getDataType() {
+ return "jsonb";
+ }
+
+ @Override
+ public Class<String> getJavaType() {
+ return String.class;
+ }
+
+ @Override
+ public Object serialize(String value) {
+ PGobject pg = new PGobject();
+ pg.setType(getDataType());
+ try {
+ pg.setValue(value);
+ } catch (SQLException e) {
+ // not thrown on base PGobject
+ }
+ return pg;
+ }
+
+ @Override
+ public String deserialize(Object value) {
+ return value.toString();
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright 2014 James Moger.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.iciql.adapter.postgresql;
+
+import com.iciql.adapter.XStreamTypeAdapter;
+
+/**
+ * Postgres XML data type adapter maps an XML column to a domain object using
+ * XStream.
+ *
+ * @author James Moger
+ *
+ */
+public abstract class XmlObjectAdapter extends XStreamTypeAdapter {
+
+ @Override
+ public String getDataType() {
+ return "xml";
+ }
+
+}
--- /dev/null
+/*
+ * Copyright 2014 James Moger.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.iciql.adapter.postgresql;
+
+import java.sql.SQLException;
+
+import org.postgresql.util.PGobject;
+
+import com.iciql.Iciql.DataTypeAdapter;
+
+/**
+ * Handles transforming raw strings to/from the Postgres XML data type.
+ */
+public class XmlStringAdapter implements DataTypeAdapter<String> {
+
+ @Override
+ public String getDataType() {
+ return "xml";
+ }
+
+ @Override
+ public Class<String> getJavaType() {
+ return String.class;
+ }
+
+ @Override
+ public Object serialize(String value) {
+ PGobject pg = new PGobject();
+ pg.setType(getDataType());
+ try {
+ pg.setValue(value);
+ } catch (SQLException e) {
+ // not thrown on base PGobject
+ }
+ return pg;
+ }
+
+ @Override
+ public String deserialize(Object value) {
+ return value.toString();
+ }
+}
\ No newline at end of file
}\r
\r
@Override\r
- public Object serialize(DcKey value) {\r
+ public Object serialize(Invoice value) {\r
String json = gson().toJson(value);\r
PGobject pg = new PGobject();\r
pg.setType(getDataType());\r
final Invoice invoice = gson().fromJson(json, getJavaType());\r
\r
return invoice;\r
- }\r
+ }\r
+}\r
---JAVA---\r
\r
Here you can see how the *InvoiceTypeAdapter* defines a [Postgres JSONB data type](http://www.postgresql.org/docs/9.4/static/datatype-json.html) and automatically handles JSON (de)serialization with [Google Gson](https://code.google.com/p/google-gson) so that the database gets the content in a form that it requires but we can continue to work with objects in Java.\r
public @interface InvoiceAdapter { }\r
---JAVA---\r
\r
-### Included DataTypeAdapters\r
-\r
-Not every DataTypeAdapter has to be a custom implementation.\r
-The following adapters are included in Iciql for general purpose use.\r
-\r
-- `com.iciql.adapter.JavaSerializationTypeAdapter`\r
-Uses Java serialization to store/retrieve your objects as BLOBs.\r
-- `com.iciql.adapter.GsonTypeAdapter`\r
-Uses Google Gson to store/retrieve your objects as TEXT.\r
-- `com.iciql.adapter.XmlTypeAdapter`\r
-Uses XStream to store/retrieve your objects as TEXT.\r
-- `com.iciql.adapter.postgres.GsonTypeAdapter`\r
-Uses Google Gson to store/retrieve your objects as JSON for Postgres.\r
-- `com.iciql.adapter.postgres.GsonBTypeAdapter`\r
-Uses Google Gson to store/retrieve your objects as JSONB for Postgres.\r
-- `com.iciql.adapter.postgres.XStreamTypeAdapter`\r
-Uses XStream to store/retrieve your objects as XML for Postgres.\r
-- `com.iciql.adapter.postgres.JsonStringAdapter`\r
-Allows you to use the Postgres JSON data type with a standard String.\r
-- `com.iciql.adapter.postgres.JsonbStringAdapter`\r
-Allows you to use the Postgres JSONB data type with a standard String.\r
-- `com.iciql.adapter.postgres.XmlStringAdapter`\r
-Allows you to use the Postgres XML data type with a standard String.\r
+### Included Data Type Adapters\r
+\r
+The following adapters are included in Iciql. They may require an optional dependency such as Gson, XStream, or SnakeYaml.\r
+\r
+<table class="table">\r
+<tr><td colspan="4"><b>Common Type Adapters</b></tr>\r
+<tr><td><i>Adapter</i></td><td><i>Java</i></td><td><i>SQL</i></td><td><i>Description</i></td></tr>\r
+\r
+<tr><td>com.iciql.adapter.JavaSerializationTypeAdapter</td><td>Object</td><td>BLOB</td><td>Uses Java serialization to (de)serialize your object</td></tr>\r
+\r
+<tr><td>com.iciql.adapter.GsonTypeAdapter<T></td><td><T></td><td>TEXT</td><td>\r
+Uses Google Gson to (de)serialize your object as JSON</td></tr>\r
+\r
+<tr><td>com.iciql.adapter.XStreamTypeAdapter</td><td>Object</td><td>TEXT</td><td>\r
+Uses XStream to (de)serialize your object as XML</td></tr>\r
+\r
+<tr><td>com.iciql.adapter.SnakeYamlTypeAdapter<T></td><td><T></td><td>TEXT</td><td>\r
+Uses SnakeYaml to (de)serialize your object as YAML</td></tr>\r
+\r
+<tr><td colspan="4"><b>PostgreSQL Type Adapters</b></tr>\r
+<tr><td><i>Object Adapters</i></td><td><i>Java</i></td><td><i>SQL</i></td><td><i>Description</i></td></tr>\r
+\r
+<tr><td>com.iciql.adapter.postgresql.JsonObjectAdapter<T></td><td><T></td><td>JSON</td><td>\r
+Uses Google Gson to (de)serialize your object as JSON</td></tr>\r
+\r
+<tr><td>com.iciql.adapter.postgresql.JsonbObjectAdapter<T></td><td><T></td><td>JSONB</td><td>\r
+Uses Google Gson to (de)serialize your object as JSONB</td></tr>\r
+\r
+<tr><td>com.iciql.adapter.postgresql.XmlObjectAdapter</td><td>Object</td><td>XML</td><td>\r
+Uses XStream to (de)serialize your object as XML</td></tr>\r
+\r
+<tr><td colspan="4"><i>String Adapters</i></td></tr>\r
+\r
+<tr><td>com.iciql.adapter.postgresql.JsonStringAdapter</td><td>String</td><td>JSON</td><td>\r
+Maps the JSON data type to a java.lang.String</td></tr>\r
+\r
+<tr><td>com.iciql.adapter.postgresql.JsonbStringAdapter</td><td>String</td><td>JSONB</td><td>\r
+Maps the JSONB data type to a java.lang.String</td></tr>\r
+\r
+<tr><td>com.iciql.adapter.postgresql.XmlStringAdapter</td><td>String</td><td>XML</td><td>\r
+Maps the XML data type to a java.lang.String</td></tr>\r
\r
+</table>\r
\r
### fluent, type-safe SQL DSL with rich object mapping\r
\r
-Born from the unfinished [JaQu][jaqu] subproject of H2 in August 2011, Iciql has advanced the codebase & DSL greatly. It supports more SQL syntax, more SQL data types, and all standard JDBC object types.\r
+Born from the unfinished [JaQu][jaqu] subproject of H2 in August 2011, Iciql has [advanced the codebase](jaqu_comparison.html) & DSL greatly. It supports more SQL syntax, more SQL data types, and all standard JDBC object types.\r
\r
---JAVA---\r
try (Db db = Db.open("jdbc:h2:mem:iciql")) {\r
\r
### dynamic, annotated DAO with standard crud operations\r
\r
-Inspired by [JDBI](http://jdbi.org), Iciql offers a similar Dao feature. There are some clear benefits to using SQL directly rather than SQL-through-a-DSL so use them both where it makes the most sense for your need.\r
+Inspired by JDBI, Iciql offers a similar [DAO feature](dao.html). There are some clear benefits to using SQL directly rather than SQL-through-a-DSL so use each one where it makes the mose sense.\r
\r
---JAVA---\r
// Define your DAO with SQL annotations and optional type adapters\r
}\r
---JAVA---\r
\r
+### flexible field data types\r
+\r
+The [Data Type Adapter feature](dta.html) allows you to customize how your SQL column data types map to/from Java objects.\r
+\r
+This is very useful for mapping your field domain models to SQL without having to flatten them out to additional columns within your table. In other words, you can use your database as an object store at the column level by implementing a `@TypeAdapter` (de)serialization step.\r
+\r
+You might use this to take advantage of the underlying database's type system. For example, PostgreSQL ships with the compelling JSON/JSONB/XML data types. Iciql provides String and Object adapters to facilitate use of those data types.\r
+\r
### Supported Databases (Unit-Tested)\r
- [H2](http://h2database.com) ${h2.version}\r
- [HSQLDB](http://hsqldb.org) ${hsqldb.version}\r
[jaqu]: http://h2database.com/html/jaqu.html "H2 JaQu project"\r
[orm]: http://en.wikipedia.org/wiki/Object-relational_mapping "Object Relational Mapping"\r
[jooq]: http://jooq.sourceforge.net "jOOQ"\r
-[querydsl]: http://source.mysema.com/display/querydsl/Querydsl "Querydsl"\r
+[querydsl]: http://source.mysema.com/display/querydsl/Querydsl "QueryDSL"\r
[hibernate]: http://www.hibernate.org "Hibernate"\r
[mybatis]: http://www.mybatis.org "mybatis"\r
[github]: http://github.com/gitblit/iciql "iciql git repository"\r