Hi,
Could the javadoc of empire-db win a price?
I do not know, but the doc is realy poor! It does not motivate... But I like
you project, so I want to contribute in order to help you.
Anyway, I'm comming with a real issue: The SQL keyword UNION.
I'm using Mysql 5.1 and lets see bellow:
cmd.select(db.album.id,db.album.title,db.album.index,db.album.serieId,
db.serie.title);
DBCommand cmdUnion = db.createCommand();
cmdUnion.select(db.album.id,db.album.title,db.album.index,db.album.serieId,db.album.title);
cmd.union(cmdUnion);
cmd.orderBy(db.serie.title);
generates:
SELECT t1.alb_id, t1.alb_title, t1.alb_index, t1.alb_ser_id, t4.ser_title
FROM album t1, serie t4
ORDER BY t4.ser_title
Whereas
expected:
SELECT alb_id, alb_title, alb_index, alb_ser_id, ser_title FROM
Album, Serie WHERE alb_ser_id = ser_id
UNION (SELECT alb_id, alb_title, alb_index, alb_ser_id, alb_title FROM Album
WHERE alb_ser_id IS NULL)
ORDER BY ser_title;
When I read (I try) your "javadoc" about addSQL() at DBCommendExpr.java
----------------------
addSQL()
public void addSQL(java.lang.StringBuilder buf,
long context)
Creates the SQL-Command.
Specified by:
addSQL in class DBExpr
Parameters:
buf - the SQL-Command
context - the current SQL-Command context
----------------------
Doh! Please advise!
Thank
you.