Monday, April 24, 2006

DADI Invitational

Tonight, I'm playing in the Donkey's Always Draw Invitational (DADI) Tournament on PokerStars. The winner receives a $1500 World Series of Poker buy-in. Fabulous prizes can be had for finishing 2nd through 4th. If you feel like it, pony up your $30 and get in. Otherwise, feel free to come sweat me and your other favorite bloggers.

Oh...and Wil Wheaton.

Come out if you can!

Update 4/25: Sorry to not update last night, but I finished 75th out of 78 players. Not exactly a good showing. I couldn't get anything going, and my quick exit represents that. I did get a mention on Beer City Poker (Thanks, StB!), mostly for my contribution (or what turned out to be the lack thereof) to a pretty strong table.

Thursday, April 20, 2006

EJB3 And Stored Procedures

Stored procedures support is present in EJB3 - or at least in the Hibernate implementation in JBoss 4.0.4CR2. However, what's missing is the documentation. The Hibernate 3 Annotations reference only states that stored procedures are supported by setting the callable property of the @org.hibernate.annotations.NamedNativeQuery annotation to true. I'm going to document here an example of using a stored procedure this way because it was non-obvious to me how I might go about it.

First, let’s define a stored procedure we want to call:

CREATE PROCEDURE fooProc
@bar varchar(14),
@i integer
as
select
CURRENT_TIMESTAMP as When,
@i as SomeNumber,
@bar as SomeText
from somedummytable


Then, an entity POJO that represents the resultset:
@Entity
public class Foo {
private Date when;

public Date getWhen() {
return when;
}

private int someNumber;

private String someText;

}

You get the idea.

Next, you'll want a session bean to use to access instances of Foo:

public interface IDAOFoo {
public Foo getAFoo(string bar, int i);
}

@Stateless
public class FooHome implements IDAOFoo {
@PersistenceContext EntityManager em;

public Foo getAFoo(string bar, int i) {

em....what do we do here?
}
}

Oh yeah. Well, we need to go back to our entity class and fix it up a little.

@Entity
@NamedNativeQuery(name="baz", query="call fooProc(:bar, :i)", callable=true, readOnly=true, resultClass=Foo.class)
public class Foo {
private Date when;
[....]
}

now we can use it:

@Stateless
public class FooHome implements IDAOFoo {
@PersistenceContext EntityManager em;

public Foo getAFoo(string bar, int i) {

Foo result = (Foo)em.createNamedQuery("baz").setParameter("bar", bar).setParameter("i", i).getSingleResult();
return result;
}
}

That’s really it. The important bits are the call fooProc(:bar, :i) - you have to use the SQL CALL statement, followed by your procedure name, followed in parenthesis by a list of all the named parameters.

Tags:

Wednesday, April 19, 2006

Buddy Up

From the eternal hawsomeness of Defective Yeti:

The Buddy System

Here here!

Tuesday, April 18, 2006

WWdN Tournament Results

PokerStars Tournament #22928623, No Limit Hold'em
Buy-In: $10.00/$1.00
98 players
Total Prize Pool: $980.00
Tournament started - 2006/04/18 - 20:30:00 (ET)

Dear RandomSam,

You finished the tournament in 4th place.
A $98.00 award has been credited to your Real Money account.


Congratulations!
Thank you for participating.

I'd say I'm back on the horse again...

Monday, April 17, 2006

Is There Dissension in the Ranks?

Dear RandomHumans.com:

I'm sorry that I haven't posted much lately. It's not that I don't care, it's that I suck. I'll try to do better.

Thanks for understanding. You kick ass!

Sam

-----------------------------------------------------------------------------------

How's it going, happy people? I hope everyone had a happy Easter! Mine wasn't too shabby. After church we demolished a decent ham. We also got to spend the afternoon with Gretchen's brother and our sister-in-law (Kurt and Heather) and our nephew, Connor. Not a bad day at all.

Last night, I got on Magic Online to sling some virtual crack. After winning in a 2-Headed Giant game, I hooked up with my brother-in-law Rex, whose wife (my sister Tamara) and family lives in the cabin on my mom's property in Dunlap, Tennessee. Anyway, Rex and I played a few games after their Easter dinner. Apparently, my mom was fooling around with the MTGO program and learned how to play! She really seems to dig the game and was beating on the computer while Rex and I slung spells at each other. Mom has always had an inner geek that was just itching to get out, and I think that it's closer and closer to jumping out and saying "Hi!" You go, mom!

In semi-related news, Team RandomHumans shall be visiting the Ohio Expo Center this Saturday for the Dissension Prerelease event. It looks to be Josh, Justin, Gordon, and myself. If I'm not back by Sunday, call Gretchen.

Pants.

Tuesday, April 11, 2006

Train Set Piece


Train Set Piece
Originally uploaded by chi-jin.
And they make great Saproling tokens, too!

(Saproling = Magic reference)

Saturday, April 08, 2006

Saturday, April 01, 2006

Birthday picture insanity

We celebrated a certain other blogger's wife's birthday at the Columbus Spaghetti Warehouse, which is to say we ate well, we drank well, and we did NOT go broke doing so. If you live in Columbus and you haven't been, GO!

Enjoy ...

Pictures!

Edit 4/1, 9:13 PM - Fixed the link. You're going to Justin's Flickr, so don't be scared. -- Sam