Hacker News new | ask | show | jobs
by fiftyacorn 73 days ago
Im comparing against node equivalent ORMs and find spring consistently better. Yeah ive got to read up on annotations - but when it comes to transactions its always worth revisiting them to check for changes
1 comments

Meh...

    await using cn = await pool.connect();
    const records = await cn.query<MyType>`
      SELECT ...
      FROM ...
      WHERE ...
    `;
    for await (const record of records) {
      ...
    }
Oh, spring is so much better...
Spring version:

  var records = jdbcClient
     .sql("select * from posts")
     .query(Post.class)
     .toList();
     
  records.forEach(p -> ...);
I'm not seeing a RecordsRequestFactoryHandlerProviderFactory in there... maybe it's not as bad as I remember.