I have a use case that I am working on that I thought would be made easier 
by using jooq.  I've used jooq in the past but mostly with generated code.  
This use case cannot assume generated code.

I am attempting to develop a simple tabular abstraction for reading and 
writing tabular data from files.  My plan is to have SQLite be the backend, 
but this would be hidden from the user by the abstraction.  The purpose of 
the abstraction is to make working with simple tabular data files easier 
for novices (students). I don’t want to use CSV.

I considered using java's RowSet abstractions (specifically CachedRowSet) 
but thought that jooq's Result and Record abstractions would be better. 
 Also, I hoped to take advantage of some the batch processing within jooq 
or the loader API.  

Here are the assumptions:

1. user specifies 1 or more columns and their data types (limited to 
boolean, double, long, integer, string)

2. there will be readers for reading in rows and other methods to extract 
columns, or parts of the store data to arrays etc.

3. there will be methods for writing row based data as specified in 1.

4. the processing will be sequential.  Open, read, close.  Open, write, 
close.

5. strive for a very simple abstraction

Using jooq it is trivial to create the underlying database, fields, table, 
etc.  The issue that has stymied me is working with Result and Record.  I 
hoped to use them during the reading and writing process.  Since I do not 
have generated classes, there are limitations to this approach.

The basic issue is how to make instances of UpdatableRecord 
<https://www.jooq.org/javadoc/latest/org.jooq/org/jooq/UpdatableRecord.html> 
and TableRecord 
<https://www.jooq.org/javadoc/latest/org.jooq/org/jooq/UpdatableRecord.html> 
and 
my own instances of Result that contains the records.  The docs say to not 
use UpdatableRecordImpl 
<https://www.jooq.org/javadoc/latest/org.jooq/org/jooq/impl/UpdatableRecordImpl.html>
 
and TableRecordImpl 
<https://www.jooq.org/javadoc/latest/org.jooq/org/jooq/impl/TableRecordImpl.html>
.  

My research turned up this stack overflow question 
<https://stackoverflow.com/questions/18953219/how-to-create-tablerecord-object>.
  
But, that ultimately assumes generated code.  So, my questions are:

1.     Is JOOQ a good underlying abstraction for this use case?

2.     Is so, what is the basic strategy to approach this problem using 
JOOQ?

3.     Is it possible to create UpdatableRecords and TableRecords w/o 
generated code? If so, what is the basic approach?

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/651f8037-769b-4347-977e-577e73ea823an%40googlegroups.com.

Reply via email to