Hello,
I had 2 problems when I tried to run the BasicTests for my Oracle
database. Database version is Oracle 8i 8.1.5. Is it the same for
everyone?:
1) In empTest() the following line causes an Exception (when flush()
is called):
empDL.insertRecords(new Object[][]{ // Twice should not cause
grief
{"200", "Two00", "123 456 7890", "20000", "0", d200, e100},
{"300", "Three00", "123 456 7890", "30000", "1", null, e100}});
The stack trace is:
1.main -Flushing '[Employee 300 NewRecord]'INSERT
1.main -FlushSQL INSERT INTO XX_EMPLOYEE (EMPEE_ID, NAME,
PHONE_NR, SALARY, NR_DEPENDENTS, DEPT_ID, MANAGER_EMPEE_ID) VALUES
(?, ?, ?, ?, ?, ?, ?)
SException simpleorm.core.SException$JDBC: ???Setting Values
[Employee 300 NewRecord]'INSERT INTO XX_EMPLOYEE (EMPEE_ID, NAME,
PHONE_NR, SALARY, NR_DEPENDENTS, DEPT_ID, MANAGER_EMPEE_ID) VALUES
(?, ?, ?, ?, ?, ?, ?)' Field 6: java.sql.SQLException: Invalid column
type
java.sql.SQLException: Invalid column type
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:273)
at oracle.jdbc.driver.OraclePreparedStatement.setObject
(OraclePreparedStatement.java:2034)
at oracle.jdbc.driver.OraclePreparedStatement.setObject
(OraclePreparedStatement.java:2148)
at simpleorm.core.SRecordInstance.flush
(SRecordInstance.java:319)
at simpleorm.core.SConnection.flush(SConnection.java:285)
at simpleorm.examples.OracleTest.empTest(OracleTest.java:235)
Exception in thread "main"
at simpleorm.examples.OracleTest.main(OracleTest.java:24)
When I assign "d200" for the DEPARTMENT of Employee(300), this
Exception is gone.
2) The SConnection.detatchAndClose(); line in the main() method
causes an Exception: (Oracle says that the Connection is closed,
while executing SLog.slog.connections("Detatching Connection " +
scon); )
SException simpleorm.core.SException$JDBC: ??? Nested :
java.sql.SQLException: Closed Connection
java.sql.SQLException: Closed Connection
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:273)
at oracle.jdbc.driver.OracleConnection.getMetaData
(OracleConnection.java:974)
at simpleorm.core.SConnection.toString(SConnection.java:325)
at java.lang.String.valueOf(String.java:2173)
at java.lang.StringBuffer.append(StringBuffer.java:369)
at simpleorm.core.SConnection.detatch(SConnection.java:209)
at simpleorm.core.SConnection.detatchAndClose
(SConnection.java:232)
at simpleorm.examples.OracleTest.main(OracleTest.java:28)
Exception in thread "main"
P.S. I didn't have either problems when I used Hypersonic database.
I had to overwrite protected String forUpdateSQL(boolean forUpdate)
to return "" instead of "FOR UPDATE" to make it work for Hypersonic.
Regards,
Turgay Zengin.
Hello Mark
Thanks for pointing out the broken links. ORMs have been poping up
like mushrooms. And I really must write up a comparitive evaluation.
(If you have any notes I would much appreciate them.)
I think that SimpleORM's generalized design really is an advantage, and
enables things to be controlled much better while minimizing the amount
of user written code. It is also database-centric, and handles
sophisitcated DB concepts like multi column identifying foreing keys.
The big minus is that it is not finished.
I think that one question to sort the sheep from the goats is that if an
O/R system does not use ugly JDO byte code post processing, then how
does it 1. detect updates, 2. do lazy foreign keys, 3. trap attempts to
access invalid objects?
Please let me know what you decide to use and why.
Regards,
Anthony
Mark D. Anderson wrote:
> FYI the link in http://www.simpleorm.org/ aka
http://www.uq.net.au/~zzabergl/simpleorm/
> to Webgain.com is no good.
>
> have you looked at any of these:
> http://jrf.sourceforge.net/
> http://jakarta.apache.org/turbine/torque/
> http://hibernate.sourceforge.net/
>
> i'm still looking for a solution where the porridge is just right....
>
> -mda
>
>
>
>
>
>
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
I’m a newbie with SimpleORM
and my goal is to evaluate this framework for our projects. I’m pretty
much impress by the simplicity and all features offered by this persistence framework.
Can someone with more experience answer to the followings questions?
1)SimpleORM
support Autoincrement
PK
2)Does simpleORM support
large Scale software
3)As I understand, SimpleORM
is full compliant with Postgress and MySql InnoDB table, is that true?
4)What about Oracle, DB2 and Sybase??
Thank you very much for your answer.
Regards
_________________
Claudio Parnenzini
mailto:claudio@...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/02
Hello,
I am just trying to understand and use SimpleORM and I like it very
much!
I have a few questions:
-How complete is SimpleORM now? Can I use it in production?
-Is there a need for a SFieldDate class? Or is it possible to use
SfieldString for date fields?
More questions may follow as I use SimpleORM...
A suggestion: Moving the project to sourceforge may get lots of
attention from interested people...
Thanks in advance,
Turgay Zengin.
Hello All,
I'm posting this again here for those who forgot to sign up to the
SimpleORMAnnounce group.
I have just released a new version of SimpleORM. It now works for
MySQL as well as PostgreSQL, and all reported bugs are fixed. Still
very early days, but this version should be much more solid than the
first public release.
It can be downloaded from the website, see
http://www.SimpleORM.org/README.html
As always, all feedback is most welcome.
Regards,
Anthony
Definitely not intended behaviour!
I have fixed the bug and will post it in version 00_05 today.
Current semanits:-
- getInt() etc. of a null column returns 0, following JDBC.
- getString() of a null returns null.
- It is possible to (temporarily) set a NOT NULL field to null. (That is
the intial state anyway.)
- isNull() === getObject() == null. (wasNull is a JDBC hack!)
Thanks for reporting the bug.
Anthony
> -----Original Message-----
> From: gelharwj [mailto:gelharwj@...]
> Sent: Friday, July 19, 2002 7:40 AM
> To: SimpleORM@yahoogroups.com
> Subject: [SimpleORM] Database NULL
>
>
> What is the design decision regarding database NULL's?
>
> When a row is queried and a column returns NULL and subsequently the
> column is queried (ie getString(COLUMN_NAME)), simply ORM throws a
> null pointer exception because the column object is returned as a
> java null and then .toString() is called on it throwing the exception.
>
> Is this the intended behavior? I would prefer get*() check for nulls
> and return a null rather than throw an exception. Any thoughts?
>
> Also the method .wasNull() such as in JDBC would be usefull for
> checking if the value was in fact a database NULL.
>
> Wally Gelhar
> University of Wisconsin - Eau Claire
> Facilites Planning & Management
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Will You Find True Love?
> Will You Meet the One?
> Free Love Reading by phone!
> http://us.click.yahoo.com/O3jeVD/R_ZEAA/Ey.GAA/5cFolB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> SimpleORM-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
What is the design decision regarding database NULL's?
When a row is queried and a column returns NULL and subsequently the
column is queried (ie getString(COLUMN_NAME)), simply ORM throws a
null pointer exception because the column object is returned as a
java null and then .toString() is called on it throwing the exception.
Is this the intended behavior? I would prefer get*() check for nulls
and return a null rather than throw an exception. Any thoughts?
Also the method .wasNull() such as in JDBC would be usefull for
checking if the value was in fact a database NULL.
Wally Gelhar
University of Wisconsin - Eau Claire
Facilites Planning & Management
while (res.hasNext()) { bean = (ContactBean)res.getRecord(); }
if( bean != null )
bean.setString(CONTACTLABEL2,"dummy"); <-- i get an exception during SetDirty(), because sConnection == null
SConnection.commit();
do i have to set the Connection manually?
i had a look at the white paper again to see what you want to implement in future releases.
i'm not sure if what you want to implement, is, what i'm busy on right now , this is why i ask you:
will you implement an automatic load mechanism for 1-1 relations in a record (where you retrieve the record and the related data combined in one statement) in a future version of simpleorm?
and concerning that: what about retrieving multiple records and there 1-1 related data with one single statement?
regards
andreas
To unsubscribe from this group, send an email to: SimpleORM-unsubscribe@yahoogroups.com
I cannot reproduce this in my current version, but I have fixed a number of isses with references so please retest when 00.05 comes out (soon).
Anthony
-----Original Message----- From: Abo [mailto:abo@...] Sent: Wednesday, July 17, 2002 1:31 PM To: SimpleORM; berglas@... Subject: [SimpleORM] exception during insertRecord
you probably know that error, but i'll tell it anyway:)
this will only happen if you use insertRecord() on a record that already exist. no problems when when you are using findOrCreate() to get the record :
if you retrieve a record with foreign keys in it, you will get an exception in retrieveRecord() :
--> qvalue = fMeta.queryFieldValue(rs, fx+1);
because fMeta will become SFieldReference on the foreign keys and SFieldReference.queryFieldValue() is emplemented to throw an error.
if you run the empTest twice, without deleting the tablebefore, you'll get that error during insertRecord (which is trying to find the record in the database..)
regards
andreas
To unsubscribe from this group, send an email to: SimpleORM-unsubscribe@yahoogroups.com
while (res.hasNext()) { bean = (ContactBean)res.getRecord(); }
if( bean != null )
bean.setString(CONTACTLABEL2,"dummy"); <-- i get an exception during SetDirty(), because sConnection == null
SConnection.commit();
do i have to set the Connection manually?
i had a look at the white paper again to see what you want to implement in future releases.
i'm not sure if what you want to implement, is, what i'm busy on right now , this is why i ask you:
will you implement an automatic load mechanism for 1-1 relations in a record (where you retrieve the record and the related data combined in one statement) in a future version of simpleorm?
and concerning that: what about retrieving multiple records and there 1-1 related data with one single statement?
you probably know that error, but i'll tell it anyway:)
this will only happen if you use insertRecord() on a record that already exist. no problems when when you are using findOrCreate() to get the record :
if you retrieve a record with foreign keys in it, you will get an exception in retrieveRecord() :
--> qvalue = fMeta.queryFieldValue(rs, fx+1);
because fMeta will become SFieldReference on the foreign keys and SFieldReference.queryFieldValue() is emplemented to throw an error.
if you run the empTest twice, without deleting the tablebefore, you'll get that error during insertRecord (which is trying to find the record in the database..)
finally i got my own mail, which i send to you yesterday through the simpeorm group! but it took 13 hours!!!
so if you don't mind, i'm sending further mails to the group AND to you. is that ok for you?
looking forward to get your examples!i know, i would like to have the column names consistent as well, but i have no choice.
there's another problem with foreign keys, but i will tell it to you later, because my mails getting bigger and bigger and soon you will add me to your spam filter:)
after the installation copy one of the mysql\my-*.cnf files to c:\my.cnf.
you have to add some additonal informations:
modify the installation directory if it is different than c:\mysql.
uncomment the inno table section
add 'default-table-type=innodb' within the [mysqld] section, otherwise you have to add INNO on every table creation
you have to create the "innodb_data_home_dir" and "innodb_log_group_home_dir" folders on their specified location, because the server will not do it for you!
now you can start the server with: mysqld-max --console
Hello Abo,
Please report all bugs. Will look at this tomorrow.
Anthony
Abo wrote:
> you probably know that error, but i'll tell it anyway:)
>
>
>
> this will only happen if you use insertRecord() on a record that already
> exist. no problems when when you are using findOrCreate() to get the
> record :
>
>
>
> if you retrieve a record with foreign keys in it, you will get an
> exception in retrieveRecord() :
>
>
>
> --> qvalue = fMeta.queryFieldValue(rs, fx+1);
>
>
>
> because fMeta will become SFieldReference on the foreign keys
> and SFieldReference.queryFieldValue() is emplemented to throw an error.
>
> if you run the empTest twice, without deleting the table before, you'll
> get that error during insertRecord (which is trying to find the record
> in the database..)
>
> regards
>
> andreas
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
Hello Abo,
The connection is associated with the current thread, and you should
never have to refer to it directly. Eventually you
SConnection.detatchAndClose() to remove it.
I can see no reason why your code should fail. Rereading the code, it
is a little odd that I am using the SRecordInstance.sConnection, cf.
flush which uses the thread one. (They should be the same.) Will
investigate and see if I can reproduce your problem.
As to 1-1 records, they are a pain. Good database design avoids them,
but these days good database design is rare. The basic issue of lazily
loading them works already as a special case of 1-m. Combining multiple
selects into a single Joined select is outstanding, and can only really
be done correctly using outer joins -- and is not limited to 1-1. How
big an issue is this for you?
For the implementation schedule, see README.html in the distribution (or
on the web site). Priorities change, largely in response to users.
MySQL is currently number one.
Thanks for your continued feedback. It is much appreciated in these
early days.
Regards,
Anthony
Abo wrote:
> hi again,
>
>
>
> the only way (at the moment) to select some or all rows of one table is
> to use meta.select() and get a preparedStatement, is that right?
>
> well, i have a problem doing that:
>
>
>
> SConnection.begin();
>
>
> SPreparedStatement stmt = ContactBean.meta.select( ....);
> SResultSet res = stmt.execute();
> ContactBean bean = null;
>
>
>
> while (res.hasNext()) {
> bean = (ContactBean)res.getRecord();
> }
>
>
>
> if( bean != null )
>
> bean.setString( CONTACTLABEL2,"dummy"); <-- i get an exception
> during SetDirty(), because sConnection == null
>
>
> SConnection.commit();
>
> do i have to set the Connection manually?
>
>
>
>
>
> i had a look at the white paper again to see what you want to implement
> in future releases.
>
> i'm not sure if what you want to implement, is, what i'm busy on right
> now , this is why i ask you:
>
> will you implement an automatic load mechanism for 1-1 relations in a
> record (where you retrieve the record and the related data combined in
> one statement) in a future version of simpleorm?
>
> and concerning that: what about retrieving multiple records and there
> 1-1 related data with one single statement?
>
>
>
> regards
>
> andreas
>
>
>
>
>
>
>
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
The following fragment demos how to implement inconsistent foreign keys.
Not recommended but possible. I noticed a couple of other issues with
foreign keys, to be fixed in the next release (in a few days I hope).
Anthony
static public class PaySlip extends SRecordInstance {
public static final SRecordMeta meta =
new SRecordMeta(PaySlip.class, "XX_PAY_SLIP");
static final SFieldString INCONSISTENT_EMP_NR = // not recommended
new SFieldString(meta, "INCONSISTENT_EMP_NR", SFD_PRIMARY_KEY);
static final SFieldReference EMPLOYEE =
new SFieldReference(meta, Employee.meta,
new SFieldMeta[]{INCONSISTENT_EMP_NR}, SFD_PRIMARY_KEY);
static final SFieldReference PERIOD =
new SFieldReference(meta, Period.meta,
(String)null, SFD_PRIMARY_KEY);
public static final SFieldString COMMENT =
new SFieldString(meta, "COMMENT");
public SRecordMeta getMeta() { return meta; };
}
> -----Original Message-----
> From: Melissa & Anthony Berglas [mailto:berglas@...]
> Sent: Tuesday, July 16, 2002 9:24 PM
> To: Abo; SimpleORM
> Subject: [SimpleORM] Re: WG: some startup problems
>
>
> Hello Andreas,
>
> I checked, you are listed in the group. Please see if you have mail.
> If not, then it is possible that you have over active spam filters.
>
> As to your first foreign key issue, your life will be much
> easier if you
> keep the column names consistent. Many tools match by column
> names, and
> your querying will be easier. However, it should still work but not
> quite they way you are trying. I'll make an example tommorow
> and send
> it to you.
now that i gave OJB a try i even like SimpleOrm more than before:)
i have started to build my database objects with simpleorm and i'm running into some troubles. i puzzled the whole day, maybe you can give me a hand...
i'm restricted to a given database structure. e.g. i can't change fieldnames.
1.)
some names of foreign keys in table A do not match the primary keys in table B
let's say my foreign key in A is "primaryMail_id" and the primary key in B is 'contact_mail_id'.
i tried to do it manually with:
public static final SFieldMeta PRIMARYMAIL_ID = new SFieldString(meta, "primaryMail_id"); static final SFieldMeta CONTACT_MAIL = new SFieldReference(meta, ContactMailBean.meta, new SFieldMeta[]{PRIMARYMAIL_ID}, 0);
but i end up with an exception in setkey:
if (!kf.getClass().isInstance(fkey)) throw new SException.Error( "Foreign key " + fkey + " not instance of key " + kf);
do i use a wrong syntax, or is it not possible yet?
2.)
i have to switch the language during runtime. so i have an additional language key in some language specific tables.
let's say:
table A
field1 (primary)
field2
text_id (foreign key )
table B
text_id (primary)
language_id (primary)
text
the language id is not reflected in table A or any other table in the database. i want to set it during runtime.
when i declare:
public class A extends SRecordInstance implements SConstants {
.
.
static final SFieldReference TEXT_ID = new SFieldReference(meta, TextBean.meta);
i get an additional foreign key(language_id) in this class A which does not exist in the table A
what is the best way to deal with this (if i don't set language_id in class B to primary, i'll run into other problems!?)
3.)
i have 3 different language specific tables like the table B descriped in 2.)
each contains the primary key "language_id".
this gives me an exception when i try to use the sdataloader, because it checks for duplicated columns over all classes:
public SFieldMeta(SRecordMeta sRecord, String columnName, long sfd_bitSet) {
.
.
if (fm.columnName != null && fm.columnName.equals(columnName)) throw new SException.Error("Duplicate Column Name " + columnName);
Hello Andreas,
I checked, you are listed in the group. Please see if you have mail.
If not, then it is possible that you have over active spam filters.
As to your first foreign key issue, your life will be much easier if you
keep the column names consistent. Many tools match by column names, and
your querying will be easier. However, it should still work but not
quite they way you are trying. I'll make an example tommorow and send
it to you.
Your second case is not actually a foreign key by any normal sense of
the term. For now you will have handle the relationship manually, which
is actually not hard. (ie. don't tell SimpleORM that the tables are
related.) You raise an interesting issue, and I will consider adding
some sort of false foreign key in a future version -- I'm not sure what
the implications really are.
I don't fully understand your last point but I think it is related to
the second.
Good to hear that you are using SimpleORM. I am working on it much as
possible, but it is still early days. So please stick to the basic
functionality. I will have a new version out soon with several bugs
fixed, a few new features, and more test cases.
Are you using SimpleORM with MySQL? I have downloaded it and will play
with it shortly.
Regards,
Anthony
Abo wrote:
> hi anthony,
>
>
>
> i did post this message to SimpleORM@yahoogroups.com
> <mailto:SimpleORM@yahoogroups.com> but i didn't get the mail back, so
> i'm not sure if it works...
>
> this was the message:
>
>
>
> good to hear that you want to support mysql.
>
> now that i gave OJB a try i even like SimpleOrm more than before:)
>
>
>
> i have started to build my database objects with simpleorm and i'm
> running into some troubles. i puzzled the whole day, maybe you can give
> me a hand...
>
>
>
> i'm restricted to a given database structure. e.g. i can't change
> fieldnames.
>
>
>
> 1.)
>
> some names of foreign keys in table A do not match the primary keys in
> table B
>
> let's say my foreign key in A is "primaryMail_id" and the primary key in
> B is 'contact_mail_id'.
>
> i tried to do it manually with:
>
>
>
> public static final SFieldMeta PRIMARYMAIL_ID =
> new SFieldString(meta, "primaryMail_id");
> static final SFieldMeta CONTACT_MAIL = new
> SFieldReference(meta, ContactMailBean.meta,
> new SFieldMeta[]{PRIMARYMAIL_ID}, 0);
>
>
>
> but i end up with an exception in setkey:
>
>
>
> if (!kf.getClass().isInstance(fkey))
> throw new SException.Error(
> "Foreign key " + fkey + " not instance of key " + kf);
>
>
>
> do i use a wrong syntax, or is it not possible yet?
>
>
>
> 2.)
>
> i have to switch the language during runtime. so i have an additional
> language key in some language specific tables.
>
> let's say:
>
>
>
> table A
>
> field1 (primary)
>
> field2
>
> text_id (foreign key )
>
>
>
> table B
>
> text_id (primary)
>
> language_id (primary)
>
> text
>
>
>
> the language id is not reflected in table A or any other table in the
> database. i want to set it during runtime.
>
> when i declare:
>
>
>
> public class A extends SRecordInstance implements SConstants {
>
> .
>
> .
>
> static final SFieldReference TEXT_ID =
> new SFieldReference(meta, TextBean.meta);
>
>
>
> i get an additional foreign key(language_id) in this class A which does
> not exist in the table A
>
>
>
> what is the best way to deal with this (if i don't set language_id in
> class B to primary, i'll run into other problems!?)
>
>
>
> 3.)
>
> i have 3 different language specific tables like the table B descriped
> in 2.)
>
> each contains the primary key "language_id".
>
> this gives me an exception when i try to use the sdataloader, because it
> checks for duplicated columns over all classes:
>
>
>
> public SFieldMeta(SRecordMeta sRecord, String columnName, long sfd_bitSet) {
>
> .
>
> .
>
> if (fm.columnName != null && fm.columnName.equals(columnName))
> throw new SException.Error("Duplicate Column Name " + columnName);
>
>
>
>
>
> what do you think?
>
>
>
> regards
>
> andreas
>
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
At 9:28 PM -0700 7/15/02, Melissa & Anthony Berglas wrote:
>I am getting enough demand for MySQL to warrant supporting it. The next
>release will address all known issues, including the subselects in the
>test cases.
Please keep us up to date on intentions/progress as you do so, in
particular with respect to whether the current release will work with
mysql. Thanks!
--
Brad Cox, PhD; bcox@... 703 361 4751
o For industrial age goods there were checks and credit cards.
For everything else there is http://virtualschool.edu/mybank
o Interactive Learning Environment http://virtualschool.edu/ile
o Java Web Application Architecture: http://virtualschool.edu/jwaa
Hello Willis,
Notes below...
Willis Boyce wrote:
> Anthony,
>
> I had a look at your source. Before I found your project, I started
> working on some ORM code of my own, and it's interesting how similar it is
> to yours. I was using reflection, but I think that your method of
> requiring that classes derive from a common base and thus controlling
> access to the fields explicitly is better since it avoids the needs to
> examine each object prior to committing the transaction to see if it needs
> to be updated or not. Also, my scheme uses an XML mapping. I imagine
> that you're not too fond of XML. Keeping the mapping separate from the
> class itself has one major advantage that I can see, which is that it
> enables someone who doesn't have access to the source code of a class to
> add attributes to it. Since the class has no attributes of its own, only
> an array of generic attributes, the XML is the authoritative source for
> the specific class attributes. I'm not sure whether the additional
> flexibility offered by an external mapping is sufficient to justify the
> additional complication, however. In particular, with an external
> mapping, it's impossible to simply new an object because the object won't
> know what its fields are.
One of the issues with XML is simply that somehow one needs to be able
to reference fields in the application. In the generalized design, that
is via constants. So one needs those definitions and cannot avoid them.
The XML becomes an extra file to have to edit. And it takes quite a
bit of code to parse it etc.
One option is to generate Java from XML. Certainly doable, but then one
cannot put business rules in the Java. And compilation becomes slower.
Java syntax is pretty ugly (I miss Lisp...) but gets the job done. Now
if someone had a decent macro processor for Java...
As to extra fields, the generalized design makes that easy. No need to
dynamically recompile anything. I was thinking of even allowing SELECT
* FROM, and then creating SFILEDMETA's for any non declared fields.
They could be retrieved using the column names as strings. But that's
for version 2.
>
> Regarding distributed caches, my experience has been that they're mostly
> hype. No version of TOPLink that we used, from version 2.5 to version
> 3.6, had a real distributed cache. Version 3.x had some hooks that you
> could use to build your own distributed cache system. There was an API
> that allowed you to register a listener for changes to objects in the
> cache and a corresponding API to invalidate an object in the cache, but
> you had to write the transport yourself. There are really only two ways
> to create a distributed cache, and both of them suck. You can either
> invalidate the remote caches before committing the local transaction,
> which doesn't scale well and introduces a delay, or you can commit the
> local transaction first and then invalidate the remote caches later, which
> leaves stale data in the remote caches for however long it takes to
> invalidate them all.
Indeed. I think that the Read Mostly cache will provide most of the
practical benefits with minimal effort.
>
> A better way to do thing would be to extend the database's transaction
> isolation concept to the object cache, but nobody does that as far as I
> know. They all let you change the local object and then try to figure out
> how to synchronize the caches later.
Yes.
>
> Have you worked with any object databases, by the way? I worked with
> ObjectStore for a few months, but it was far too weird. You have to
> postprocess the class files (kind of like JDO) of the would-be persistent
> classes, you (obviously) can't use SQL to access the database, and every
> time you change a persistent class, you have to go through a "schema
> migration" to synchronize the database with the new class definition.
> Ugh.
>
Object Design always seemed to me to be a very specialized DB, not a
general purpose one. The pointer swiggling is clever and no doubt
perfect for some special applications. But not many.
I have updated the white paper on the web site, you might like to look
up the JDO linkage section and let me know what you think.
Regards,
Anthony
PS. And please post to the SimpleORM group rather than to me directly.
> W
>
>
> On Sun, 14 Jul 2002, Melissa & Anthony Berglas wrote:
>
>
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
Hello Abo,
I am getting enough demand for MySQL to warrant supporting it. The next
release will address all known issues, including the subselects in the
test cases.
PostgreSQL does work under Windows -- that's how I develop. It is
included as a standard part of cygwin, precompiled. That said, it is
Unix oriented.
Regards,
Anthony
PS. Please try to post to the SimpleORM group rather than directly to
me. Others may have valuable input.
Abo wrote:
> Hi Anthony,
>
> As you suggested i switched to inno tables and it worked now.
> I didn't know that mysql in default don't support transaction!!!.
> Unfortunately i have to use mysql for this project, so no choice this
> time (anonther thing: i'm using windows xp and i think postgresql only
> support linux, right?).
>
> Mysql don't support subselects as well. They try to enable this in the
> 4.1 release.
> So if you don't use subselects internally this shouldn't be a problem.
>
> Thats all for now - thank you
>
> Cheers
> abo
>
>
> -----Ursprüngliche Nachricht-----
> Von: Melissa & Anthony Berglas [mailto:berglas@...]
> Gesendet: Sonntag, 14. Juli 2002 01:17
> An: Abo; SimpleORM@yahoogroups.com
> Betreff: Re: AW: first release?
>
>
> Hello Abo,
>
> Thanks for trying out SimpleORM.
>
> I will add you to the main SimpleORM group, whose address is above.
>
> The first question is, which My/Max SQL are you using. Per my recent
> responce
>
> >to the list there are actually four different database products, with
> >four different locking models.
> >
> >ISAM -- The old one, no transactions, unsupportable.
> >
> >BDB -- Crude page level locks, transactions. Traditional Read/Write
>
>>locks. > >Gemini -- Row locks, Traditional Read/Write locks,
>>
> SELECT...FOR UPDATE. >Dispute with Progres. > >InnoDB --
> Oracle/Postgres - like multi version locking. Plus SELECT
> >WITH LOCK IN SHARE MODE.
> >
> >Different tables can be in different models, scary.
> >
> >So when you say "MySQL", which "MySQL" and why?!
> >
> >I think that SimpleORM will only support one model, probably InnoDB.
> >That should work now but has not been tested. One addtion is to
> somehow >check that the tables are in the right mode, maybe through JDBC
>
> meta >data.
> >
> >See
> >
>
>>http://hotwired.lycos.com/webmonkey/backend/databases/tutorials/tutoria
>>
> l2.ht
> ml
> >
> >for a reasonable overview.
>
> And why MuSQL and not PostgreSQL?
>
> Thanks for the createdb. Oracle also needs the max size in bytes
> specified for Varchar, I'll have to add it. But in this regard
> PostgreSQL is better -- no need to specify a maximum.
>
> Please send me details of the exception that you found.
>
> The final issue is, I think, the fact that MySQL may not support
> subqueries (which are a basic feature). The query itself is just in the
>
> test code to check that things worked properly. Does MySQL support
> outer joins? If not it would have to be rewritten as a loop. Consider
> using PostgreSQL.
>
> Regards,
>
> Anthony
>
> PS. I'm not saying that I never want to support MySQL, just not
> initially. But if you are keen to use MySQL then I will.
>
> Abo wrote:
>
>
>>Hi Anthony,
>>
>>Thanks for providing me with your first release!
>>Here's me feedback:
>>
>>I'm using jbuilder 6.0 and the mysql database.
>>First i modified create.sql a bit to run it with mysql (the file is
>>attached..)
>>I had two exception while running the basicTests.
>>First i got a exception on rollback the database after inserting the
>>
> 900
>
>>Department.
>>(:some non_transactional changed tables couldn't be rolled back)and
>>
> then
>
>>a unhandled exception on executing the rawQuery ( "SELECT SUM("
>> + " (SELECT SALARY FROM XX_EMPLOYEE M "
>> + " WHERE M.EMPEE_ID = E.MANAGER_EMPEE_ID)) "
>> + "FROM XX_EMPLOYEE E"); // Sum of all manager's salary.)
>>
>>Do you have any idea or suggestion?
>>Cheers
>>Andreas
>>
>>did you already create a mailing list on yahoo?
>>
>>
>>
>>
>>-----Ursprüngliche Nachricht-----
>>Von: Melissa & Anthony Berglas [mailto:berglas@...]
>>Gesendet: Montag, 08. Juli 2002 06:09
>>An: Abo
>>Betreff: Re: first release?
>>
>>
>>Hello All,
>>
>>Thank you for you interest in SimpleORM. The current version can be
>>downloaded from
>>
>> http://SimpleORM.org/simpleorm-00_04.zip
>>
>>It all basically works, and there is a good set of examples. But it
>>is
>>early days and SimpleORM is not ready for complex production use, but
>>could be used in simple applications.
>>
>>As to simplicity, the .jar is currently just 54kb. The code is well
>>documented, and I have taken care with things like toString() and
>>exceptions. So if you do decide to use it seriously it should not be
>>hard to work with the source.
>>
>>SimpleORM currently only has been tested on PostgreSQL. I would be
>>interested to know what databases other people are using and require
>>support for. The database dependent code is (largely) separated out
>>into individual drivers, so extending the tool should not be too hard.
>>
>
>>What is difficult is testing it on multiple databases, for which I
>>
> would
>
>>ask your support.
>>
>>One thing that I will do is set up a mailing list for further
>>postings.
>>Probably on Yahoo unless anyone can suggest a better alternative.
>>
> I'll
>
>>announce this when done.
>>
>>All relevant feedback much appreciated. Please also let me know if
>>you
>>would be prepared to work on SimpleORM itself.
>>
>>And finally, please do not fork the code. If you make changes or
>>additions please send them to me so that I can incorporate them into
>>
> the
>
>>main code base.
>>
>>Regards,
>>
>>Anthony
>>
>>
>>Abo wrote:
>>
>> > Hi!
>> >
>> > i'm really looking forward to get your first relase. The white
>>paper > sounds promesing (and comparing to other mapping mechanism
>>this one i > like most....so far:) >
>> > Is there a prelease available?
>> >
>> > Cause i start a new project now and i want to know if i could use
>> > simpleorm or if i have to do the mapper myself:(
>> >
>> >
>> >
>> > cu
>> >
>> > andreas
>> >
>> >
>> >
>>
>>
>>--
>>Melissa & Anthony Berglas
>>If the correctness test is that the numbers look OK,
>>why bother to build the model in the first place?
>>
>>
>>
>
>
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
Hello!
I'm reading your SimpleORM documentation, and I like it already. I'll
probably give it a try on the new Java version of my web site, photoSIG:
http://www.photosig.com
It's currently written in PHP. It's recently reached the size at which
a scripting language like PHP stops being convenient and starts being a
liability (marginal type-safety, poor object support, no compiler), so I'm
rewriting it in Java.
It's nice to discover an ORM tool that doesn't consider the database to be
an ugly artifact of a bygone era that must be hidden from view. All of
the other ORM tools go to great lengths to shield the developer from the
database and from SQL, as if a developer who was able to learn Java, not
to mention the ORM tool itself and whatever weird query language it uses,
wouldn't be able to learn SQL. I recently used TOPLink on a system that
included about 120 tables (and corresponding objects), and I think that
most of TOPLink's value was not in its ability to shield the developers
from SQL but rather in its enforcing the separation of the business logic
of the application from the persistence code. JDO carries the "must hide
the database" attitude to a ludicrous extreme.
I think that the main problem with the "must hide the database" philosophy
is that the database isn't so much being hidden as being replaced by
something else, and the thing that's replacing it (the ORM tool) is
usually of poorer quality in terms of documentation, stability, and
support. We never had to deal with Oracle on the TOPLink project that I
mentioned earlier, but we were dealing with TOPLink constantly.
Marketing hype notwithstanding, designing and using objects that are
persisted to a relational database using TOPLink is not at all like
designing and using regular Java objects. In Java, you can create a class
A that has a Map of instances of B, write addB and removeB methods for A,
and be done. That pattern is death in TOPLink. It's possible to load an
instance of A without loading the Map of related instances of B, but as
soon the addB method or the removeB method attempts to access the Map,
TOPLink will have to load all of the B instances. If there are 1,000
related instances of B then TOPLink will load 1,000 rows from the database
and instantiate 2,000 instances of B (1,000 for the Map and 1,000 to store
the original states of the 1,000 in the Map) before it will let you add a
new one. What's worse is that when you commit the transaction, TOPLink
will then compare each of the 1,000 B instances in the Map with the
corresponding original state instance to determine if it has to generate
any updates. Of course the comparison uses reflection and takes forever.
Anyway I'll give your ORM tool a try and let you know how it goes.
Regards,
Willis
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
Hello Abo,
Thanks for trying out SimpleORM.
I will add you to the main SimpleORM group, whose address is above.
The first question is, which My/Max SQL are you using. Per my recent
responce
>to the list there are actually four different database products, with
>four different locking models.
>
>ISAM -- The old one, no transactions, unsupportable.
>
>BDB -- Crude page level locks, transactions. Traditional Read/Write
>locks.
>
>Gemini -- Row locks, Traditional Read/Write locks, SELECT...FOR UPDATE.
>Dispute with Progres.
>
>InnoDB -- Oracle/Postgres - like multi version locking. Plus SELECT
>WITH LOCK IN SHARE MODE.
>
>Different tables can be in different models, scary.
>
>So when you say "MySQL", which "MySQL" and why?!
>
>I think that SimpleORM will only support one model, probably InnoDB.
>That should work now but has not been tested. One addtion is to
somehow >check that the tables are in the right mode, maybe through JDBC
meta >data.
>
>See
>
>http://hotwired.lycos.com/webmonkey/backend/databases/tutorials/tutorial2.ht
ml
>
>for a reasonable overview.
And why MuSQL and not PostgreSQL?
Thanks for the createdb. Oracle also needs the max size in bytes
specified for Varchar, I'll have to add it. But in this regard
PostgreSQL is better -- no need to specify a maximum.
Please send me details of the exception that you found.
The final issue is, I think, the fact that MySQL may not support
subqueries (which are a basic feature). The query itself is just in the
test code to check that things worked properly. Does MySQL support
outer joins? If not it would have to be rewritten as a loop. Consider
using PostgreSQL.
Regards,
Anthony
PS. I'm not saying that I never want to support MySQL, just not
initially. But if you are keen to use MySQL then I will.
Abo wrote:
> Hi Anthony,
>
> Thanks for providing me with your first release!
> Here's me feedback:
>
> I'm using jbuilder 6.0 and the mysql database.
> First i modified create.sql a bit to run it with mysql (the file is
> attached..)
> I had two exception while running the basicTests.
> First i got a exception on rollback the database after inserting the 900
> Department.
> (:some non_transactional changed tables couldn't be rolled back)and then
> a unhandled exception on executing the rawQuery ( "SELECT SUM("
> + " (SELECT SALARY FROM XX_EMPLOYEE M "
> + " WHERE M.EMPEE_ID = E.MANAGER_EMPEE_ID)) "
> + "FROM XX_EMPLOYEE E"); // Sum of all manager's salary.)
>
> Do you have any idea or suggestion?
> Cheers
> Andreas
>
> did you already create a mailing list on yahoo?
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Melissa & Anthony Berglas [mailto:berglas@...]
> Gesendet: Montag, 08. Juli 2002 06:09
> An: Abo
> Betreff: Re: first release?
>
>
> Hello All,
>
> Thank you for you interest in SimpleORM. The current version can be
> downloaded from
>
> http://SimpleORM.org/simpleorm-00_04.zip
>
> It all basically works, and there is a good set of examples. But it is
> early days and SimpleORM is not ready for complex production use, but
> could be used in simple applications.
>
> As to simplicity, the .jar is currently just 54kb. The code is well
> documented, and I have taken care with things like toString() and
> exceptions. So if you do decide to use it seriously it should not be
> hard to work with the source.
>
> SimpleORM currently only has been tested on PostgreSQL. I would be
> interested to know what databases other people are using and require
> support for. The database dependent code is (largely) separated out
> into individual drivers, so extending the tool should not be too hard.
> What is difficult is testing it on multiple databases, for which I would
> ask your support.
>
> One thing that I will do is set up a mailing list for further postings.
> Probably on Yahoo unless anyone can suggest a better alternative. I'll
> announce this when done.
>
> All relevant feedback much appreciated. Please also let me know if you
> would be prepared to work on SimpleORM itself.
>
> And finally, please do not fork the code. If you make changes or
> additions please send them to me so that I can incorporate them into the
> main code base.
>
> Regards,
>
> Anthony
>
>
> Abo wrote:
>
> > Hi!
> >
> > i'm really looking forward to get your first relase. The white paper
> > sounds promesing (and comparing to other mapping mechanism this one i
> > like most....so far:)
> >
> > Is there a prelease available?
> >
> > Cause i start a new project now and i want to know if i could use
> > simpleorm or if i have to do the mapper myself:(
> >
> >
> >
> > cu
> >
> > andreas
> >
> >
> >
>
>
> --
> Melissa & Anthony Berglas
> If the correctness test is that the numbers look OK,
> why bother to build the model in the first place?
>
>
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
--
Melissa & Anthony Berglas
If the correctness test is that the numbers look OK,
why bother to build the model in the first place?
At 5:59 PM -0700 7/12/02, Anthony Berglas wrote:
>Further to the previous response I have investigated further.
>
>MaxSQL is actually four different database products, with four different
>locking models.
All this caused me to dig deeper too. Turns out I installed the
default version that only supports ISAM. Haven't checked the public
server yet. The mysql.com website now provides a FULL version that
supports all four DB types.
I looked at the InnoDB documentation with the intention of trying it
but quickly bounced off. The configuration process is complicated
enough to make the conversion into a real project which I can't
afford right now. Worse yet, the databases and log files are
documented as being larger, which I also can't afford; deployment
server space is limited and I fear it wouldn't fit.
The seed is planted but it will take some time to germinate. Need to
recuperate from a painful release cycle of all three application
(just completed today).
And most important, focus on finding a JOB! Suggestions would be welcome!!
Anyway, thanks for the help. I'll return to SimpleORM eventually,
just not right away.
--
Brad Cox, PhD; bcox@... 703 361 4751
o For industrial age goods there were checks and credit cards.
For everything else there is http://virtualschool.edu/mybank
o Java Interactive Learning Environment http://virtualschool.edu/jile
o Java Web Application Architecture: http://virtualschool.edu/jwaa
-----Original Message-----
From: Brad Cox [mailto:bcox@...]
Sent: Friday, July 12, 2002 6:07 PM
To: Anthony Berglas
Subject: RE: [SimpleORM] Orientation question
As I said, I'm no DBMS expert. I picked MySQL because it appeared to
be the dominant free DBMS years ago when I was choosing one. And the
fastest. Other than that, sheer inertia. The latest version claims to
support transactions but I've not tested that. All versions support
locking. ACID, I've no idea.
It'll take me some time to start work on this but I would like to
try. Have some other fires to fight first. If you're eager to get
started, download JWAA from http://virtualschool.edu and look at
DemoAccount.java. Pretty simple stuff.
JWAA is the latest version; I'm in the midst of upgrading the other
two apps but having some problems that may take awhile to sort out.
At 5:26 PM -0700 7/12/02, Anthony Berglas wrote:
>Hello Brad,
>
>SimpleORM currently has only been tested on PostgreSQL. It should work
fine
>on Oracle.
>
>For MySql, you would need to be using a fairly recent version which
supports
>transactions. Otherwise it MySQL is too primitive for any meaningful O/R
>mapping. (I don't know how anyone ever used it without transactions -- how
>do you lock records?)
>
>I haven't looked at the MySQL transaction model. My guess is that it is
the
>traditional one with read locks and write locks. The practical issue is
the
>"FOR UPDATE" clause that is generated for the SQL.
>
>If you are prepared to test MySQL then I will commit to supporting it.
Also
>in general if you start using SimpleORM I will commit to respond to any
>problems within a day or two. The tool is so simple that I should be able
>to fix most things quickly.
>
>Finally, why are you using MySQL? My feeling is that PostgreSQL is a
better
>tool and has a bigger community, but I have not done any proper evaluation.
>
>Regards,
>
>Anthony
>
>
>> -----Original Message-----
>> From: Brad Cox [mailto:bcox@...]
>> Sent: Friday, July 12, 2002 10:20 AM
>> To: Anthony Berglas; SimpleORM@yahoogroups.com
>> Subject: RE: [SimpleORM] Orientation question
> >
> >
> > Thanks, Anthony. Very helpful!
> >
> > I'm using MySQL. Does SimpleORM support that?
> >
--
Brad Cox, PhD; bcox@... 703 361 4751
o For industrial age goods there were checks and credit cards.
For everything else there is http://virtualschool.edu/mybank
o Java Interactive Learning Environment http://virtualschool.edu/jile
o Java Web Application Architecture: http://virtualschool.edu/jwaa
Further to the previous response I have investigated further.
MaxSQL is actually four different database products, with four different
locking models.
ISAM -- The old one, no transactions, unsupportable.
BDB -- Crude page level locks, transactions. Traditional Read/Write
locks.
Gemini -- Row locks, Traditional Read/Write locks, SELECT...FOR UPDATE.
Dispute with Progres.
InnoDB -- Oracle/Postgres - like multi version locking. Plus SELECT WITH
LOCK IN SHARE MODE.
Different tables can be in different models, scary.
So when you say "MySQL", which "MySQL" and why?!
I think that SimpleORM will only support one model, probably InnoDB. That
should work now but has not been tested. One addtion is to somehow check
that the tables are in the right mode, maybe through JDBC meta data.
See
http://hotwired.lycos.com/webmonkey/backend/databases/tutorials/tutorial2.ht
ml
for a reasonable overview.
But unless people are keen on MySQL I would prefer to stick to PostgreSQL
for the time being.
Anthony
-----Original Message-----
From: Anthony Berglas
Sent: Friday, July 12, 2002 5:37 PM
To: 'Brad Cox'
Subject: RE: [SimpleORM] Orientation question
Hello Brad,
SimpleORM currently has only been tested on PostgreSQL. It should work fine
on Oracle.
For MySql, you would need to be using a fairly recent version which supports
transactions. Otherwise it MySQL is too primitive for any meaningful O/R
mapping. (I don't know how anyone ever used it without transactions -- how
do you lock records?)
I haven't looked at the MySQL transaction model. My guess is that it is the
traditional one with read locks and write locks. The practical issue is the
"FOR UPDATE" clause that is generated for the SQL.
If you are prepared to test MySQL then I will commit to supporting it. Also
in general if you start using SimpleORM I will commit to respond to any
problems within a day or two. The tool is so simple that I should be able
to fix most things quickly.
Finally, why are you using MySQL? My feeling is that PostgreSQL is a better
tool and has a bigger community, but I have not done any proper evaluation.
Regards,
Anthony
> -----Original Message-----
> From: Brad Cox [mailto:bcox@...]
> Sent: Friday, July 12, 2002 10:20 AM
> To: Anthony Berglas; SimpleORM@yahoogroups.com
> Subject: RE: [SimpleORM] Orientation question
>
>
> Thanks, Anthony. Very helpful!
>
> I'm using MySQL. Does SimpleORM support that?
>
Thanks, Anthony. Very helpful!
I'm using MySQL. Does SimpleORM support that?
At 3:35 PM -0700 7/11/02, Anthony Berglas wrote:
>Hello Brad,
>
>The website and white paper (hopefully) give a clear and detailed
>explanation of where SimpleORM is comming from and what its advantages are.
>
>
>Basically, if you want to encapsulate all your rows as objects then
>SimpleORM will save you a lot of coding. More importantly it will ensure
>that object identity == primary key identity. This enables a business rule
>within one class to retrieve a record from a different table and know that
>it is not copying data previously retrieved by some unrelated business rule.
>And SimpleORM knows a lot about relationships etc. And it will trap bad
>locking...
>
>The other ugly but practical alternative is just to use lots of raw JDBC in
>your JSPs etc. If the main thing you are doing is shuffling data between
>the UI and database (which is what most apps do) then this will work OK.
>Create a few auxillery classes to bundle any non-trivial logic, and pass
>column values as paramenters, but handle DB access on a case by case basis.
>eg.
>
> <%= safeHTML(rs.getString("myCol") %>...
>
>However, I would advise against not using an O-R mapper and yet manually
>encapsulating all rows in classes like you propose. You will end up writing
>a lot of non-productive code and will sitll not be able to really write
>independent business rules because of the lack of primary key based
>identity. (When you load rows into objects, you are creating a simple in
>memory cache. That is what SimpleORM means by caching.)
>
>SimpleORM is different from other O-R systems because its goal is to try to
>only put a thin layer on JDBC that just does what is useful -- keys and
>relationships. It is not trying to say "JDBC lacks Object Oriented Buddha
>nature" or similar.
>
>However, as noted SimpleORM is still under (fairly active) development. But
>it is close to being very usable and SimpleORM is so simple that I think
>that you should be OK. So I suggest that you download a version and use it
>to build a very simple single table JSP. Should only take a few hours.
>Then you will have a feeling for what is involved.
>
>Regards,
>
>Anthony
>
>PS. What database are you using?
>
>> -----Original Message-----
>> From: bradjcox [mailto:bcox@...]
>> Sent: Thursday, July 11, 2002 12:05 PM
>> To: SimpleORM@yahoogroups.com
>> Subject: [SimpleORM] Orientation question
>>
>>
>> I need some orientation to decide whether SimpleORM is for me.
>>
>> I've a considerable background in OO programming but none in SQL
>> databases or object-relational mapping. Nonetheless I've managed to
>> build several database-centric applications (see h
>> ttp://virtualschool.edu) in perl, java and ruby by doing what came
>> naturally.
>>
>> In particular, applications consist of views (presentation),
>> controllers (logic), and models. The models are ordinary objects.
>> Each contains a row from some table. Models have at least one load
>> method (typically several) that create an instance by loading its
>> row, and a save method that replaces the instance in its row. That's
>> about it; no caching, nothing fancy. More complex situations (joins
>> across tables) are handled by defining inner classes to represent the
>> join results as artificial objects, with exactly the same load/save
>> protocol.
>>
>> With that as my mindset, could you please provide an introduction to
>> the advantages of the SimpleORM approach, sufficient to motivate the
>> investment in what appears to be a completely different approach.
>>
>> Thanks! I'd really appreciate it.
>>
>>
>> ------------------------ Yahoo! Groups Sponsor
>> ---------------------~-->
>> Free $5 Love Reading
>> Risk Free!
>> http://us.click.yahoo.com/TPvn8A/PfREAA/Ey.GAA/5cFolB/TM
>> --------------------------------------------------------------
>> -------~->
>>
>> To unsubscribe from this group, send an email to:
>> SimpleORM-unsubscribe@yahoogroups.com
> >
>>
>>
>> Your use of Yahoo! Groups is subject to
>> http://docs.yahoo.com/info/terms/
>>
>>
>
>
>To unsubscribe from this group, send an email to:
>SimpleORM-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
--
Brad Cox, PhD; bcox@... 703 361 4751
o For industrial age goods there were checks and credit cards.
For everything else there is http://virtualschool.edu/mybank
o Java Interactive Learning Environment http://virtualschool.edu/jile
o Java Web Application Architecture: http://virtualschool.edu/jwaa
Hello Brad,
The website and white paper (hopefully) give a clear and detailed
explanation of where SimpleORM is comming from and what its advantages are.
Basically, if you want to encapsulate all your rows as objects then
SimpleORM will save you a lot of coding. More importantly it will ensure
that object identity == primary key identity. This enables a business rule
within one class to retrieve a record from a different table and know that
it is not copying data previously retrieved by some unrelated business rule.
And SimpleORM knows a lot about relationships etc. And it will trap bad
locking...
The other ugly but practical alternative is just to use lots of raw JDBC in
your JSPs etc. If the main thing you are doing is shuffling data between
the UI and database (which is what most apps do) then this will work OK.
Create a few auxillery classes to bundle any non-trivial logic, and pass
column values as paramenters, but handle DB access on a case by case basis.
eg.
<%= safeHTML(rs.getString("myCol") %>...
However, I would advise against not using an O-R mapper and yet manually
encapsulating all rows in classes like you propose. You will end up writing
a lot of non-productive code and will sitll not be able to really write
independent business rules because of the lack of primary key based
identity. (When you load rows into objects, you are creating a simple in
memory cache. That is what SimpleORM means by caching.)
SimpleORM is different from other O-R systems because its goal is to try to
only put a thin layer on JDBC that just does what is useful -- keys and
relationships. It is not trying to say "JDBC lacks Object Oriented Buddha
nature" or similar.
However, as noted SimpleORM is still under (fairly active) development. But
it is close to being very usable and SimpleORM is so simple that I think
that you should be OK. So I suggest that you download a version and use it
to build a very simple single table JSP. Should only take a few hours.
Then you will have a feeling for what is involved.
Regards,
Anthony
PS. What database are you using?
> -----Original Message-----
> From: bradjcox [mailto:bcox@...]
> Sent: Thursday, July 11, 2002 12:05 PM
> To: SimpleORM@yahoogroups.com
> Subject: [SimpleORM] Orientation question
>
>
> I need some orientation to decide whether SimpleORM is for me.
>
> I've a considerable background in OO programming but none in SQL
> databases or object-relational mapping. Nonetheless I've managed to
> build several database-centric applications (see h
> ttp://virtualschool.edu) in perl, java and ruby by doing what came
> naturally.
>
> In particular, applications consist of views (presentation),
> controllers (logic), and models. The models are ordinary objects.
> Each contains a row from some table. Models have at least one load
> method (typically several) that create an instance by loading its
> row, and a save method that replaces the instance in its row. That's
> about it; no caching, nothing fancy. More complex situations (joins
> across tables) are handled by defining inner classes to represent the
> join results as artificial objects, with exactly the same load/save
> protocol.
>
> With that as my mindset, could you please provide an introduction to
> the advantages of the SimpleORM approach, sufficient to motivate the
> investment in what appears to be a completely different approach.
>
> Thanks! I'd really appreciate it.
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Free $5 Love Reading
> Risk Free!
> http://us.click.yahoo.com/TPvn8A/PfREAA/Ey.GAA/5cFolB/TM
> --------------------------------------------------------------
> -------~->
>
> To unsubscribe from this group, send an email to:
> SimpleORM-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
I need some orientation to decide whether SimpleORM is for me.
I've a considerable background in OO programming but none in SQL
databases or object-relational mapping. Nonetheless I've managed to
build several database-centric applications (see h
ttp://virtualschool.edu) in perl, java and ruby by doing what came
naturally.
In particular, applications consist of views (presentation),
controllers (logic), and models. The models are ordinary objects.
Each contains a row from some table. Models have at least one load
method (typically several) that create an instance by loading its
row, and a save method that replaces the instance in its row. That's
about it; no caching, nothing fancy. More complex situations (joins
across tables) are handled by defining inner classes to represent the
join results as artificial objects, with exactly the same load/save
protocol.
With that as my mindset, could you please provide an introduction to
the advantages of the SimpleORM approach, sufficient to motivate the
investment in what appears to be a completely different approach.
Thanks! I'd really appreciate it.
I need some orientation to decide whether SimpleORM is for me.
I've a considerable background in OO programming but none in SQL databases or
object-relational mapping. Nonetheless I've managed to build several
database-centric applications (see http://virtualschool.edu) in perl, java and
ruby by doing what came naturally.
In particular, applications consist of views (presentation), controllers
(logic), and models. The models are ordinary objects. Each contains a row from
some table. Models have at least one (typically several) that create an instance
by loading its row, and a save method that replaces the instance in its row.
That's about it; no caching, nothing fancy. More complex situations (joins
across tables) are handled by defining inner classes to represent the join
results as artificial objects, with exactly the same load/save protocol.
With that as my mindset, could you please provide an introduction to the
advantages of the SimpleORM approach, sufficient to motivate the investment in
what appears to be a completely different approach.
Thanks! I'd really appreciate it.