text:
The purpose of this meeting is to receive input from a broad range of local agencies, organizations, businesses, and individuals that have an interest in natural resource conditions and needs in Refugio County.
Input received will allow the Local Work Group to make recommendations on resource concerns to be addressed for county-based funding. These recommendations will be used in implementing the Environmental Quality Incentives Program (EQIP) and other conservation programs offered by NRCS.
The 2008 Farm Bill stipulates that conservation programs must continue to be locally led. Through stake holder meetings, the public is given an opportunity to help local conservation leaders set program priorities. These meetings are open to the public.
For more information, call the USDA Service Center office in Refugio, Texas at 361-526-2531 ext 3.
Service center locations and program information can be found on the Texas NRCS Web site at www.tx.nrcs.usda.gov


text:
Twenty-four hours after giving them notice, the city's Department of Facility Maintenance crews were taking what Occupy Honolulu protesters left on the sidewalk around Thomas Square.
It's the second time in a week and part of the effort to enforce the city's stored property law.
"We do follow ups at all of the places we've gone to regardless of whether we received any complaints," said Trish Morikawa, city housing coordinator.
After three sweeps of the area, D'Angelo McIntyre mans what's left of the Occupy Movement that set up camp in November.
"I think it's just an opportunity for me to be more creative on how I want to go about talking to my fellow Americans and Hawaiians,' said McIntyre.
The stored property ordinance passed in December has picked away at what, was at one time, a sprawling encampment.
City officials said its enforcement of the law is not an attempt to squelch free speech rights.
"Irrespective of who the individuals are, what group they're affiliated with, we'll be enforcing that ordinance," said Westley Chun, director of the Department of Facility Maintenance.
"We want them to do what they want to do, but if they're leaving their property, that's when it starts to infringe on other issues, so that's why we have to come," said Morikawa.
Occupy Honolulu protestors said it's likely their movement will now go mobile.
"I wouldn't be surprised if we were at Honolulu Hale or the state capitol because we're really strong people and very determined," said McIntyre.
Honolulu police were on standby, but made no arrests.
The city said all the property seized in the sidewalk sweeps are being stored and can be claimed by the owners within 30 days.

subset: commoncrawl


text:
Put it this way - in the past two or three years I don't think there is a single sport that the BBC cover that hasn't had it's coverage either cut back or completely dropped.
(Bar the American Football example, which had slipped my mind and I don't know loads about)
The message seems to be that time has moved on and if the game rejected SKY it would not be able to fall back on the BBC anymore.
Would this make a semi professional game today less financially viable as regards TV noney than it was in 1995?


text:
Sawhill Gallery Exhibition
Mon, 22 Oct 12 10:00 AM
Oct. 22-Dec. 7
10 a.m.-5 p.m. Monday-Friday and by appointment
Fourth floor, Warren Hall
professional gallery featuring changing exhibitions of regional, national and
international significance spotlights the work of Harlan W. Butt, a Regent
Professor of Art at the University of North Texas, where he has taught since
1976. His work, influenced by the colors, textures and shapes of the plants and
animals where he has lived, is exhibited in collections worldwide.
Free admission.
For information, call (540) 568-6407.
- Nov 15 JMU a national leader in study abroad
- Nov 12 Restore the Shore
- Nov 9 Preparing freedom's guardians
- Oct 23: - Dec 1: New Image Gallery Exhibition
- Nov 16: - Jan 5: College for Kids
- Nov 16: - Jan 12: Saturday Morning Physics


text:
I am new here and am having a hard time getting my milk supply. I had preemie twin boys born at 30 weeks they are now 34 weeks corrected. but 3 weeks old and I can't seem to get my milk supply up i am pumping ever hour or so and taking Fenugreek. I am willing to try just about anything. I have stated getting up in the night to pump to see if that helps get my milk in. I am willing to try just about anything at this point. Any suggestions?
Thank you


text:
Less than a month into the college softball season, the University of Illinois has put together an impressive résumé. The team's 8-0 start marked the best beginning of a season in school history.
During a 5-0 weekend at the season-opening Rosemont Rumble this month, the team showed it could react to a curveball off the field as well.
After winning its final game – 4-1 against Central Michigan – Illinois (8-2) was delayed in its return to Champaign by a disabled bus.
With no transportation available, the Illini made the best of the situation by eating lunch in a large group, laughing, joking and watching other games.
"We love being together, and being around each other," said senior catcher Jenna Mychko, a Huntley graduate. "We're telling jokes all the time. We have a good time."
As one of only two seniors on the squad, Mychko said the team has benefited from a youthful roster of exuberant personalities.
Mychko has enjoyed expanding her leadership on the team, which includes 12 freshmen and sophomores.
"If I'm confident behind the plate, our pitcher is going to be more confident and our infielders are going to be more confident," she said.
Mychko's confidence has grown immensely on offense.
Through 10 games, she leads the Illini with a .429 batting average and a .586 on-base percentage. Her six RBIs is halfway to her total from last season, when she started 34 games.
"I'm more confident in myself," she said. "We have a new hitting philosophy this year and it's really helped us. We're more disciplined, but we're always more aggressive earlier in an at-bat."
With Mychko's help, Illinois ranks third in the Big Ten this season with a .333 team batting average and a .482 slugging percentage.
Even while batting .235 last season, Mychko was a strong defensive presence. Over the past 44 career starts, she has made one error.
Mychko credits her development to a busy offseason playing for the Elgin-based Illinois Lightning summer team.
Her demanding offseason continued over the holidays when she and her father worked out at Huntley High School every day.
"We did a lot of hitting and catching drills," she said. "It's nice to see the hard work paying off."
Vaulting victor: Ames, Iowa, has been a special place this season for Minnesota pole vaulter Zach Siegmeier.
The Crystal Lake Central graduate won the Iowa State Classic indoor track and field title in his event last week with a vault of 17 feet, 6˝ inches.
Two weeks earlier, Siegmeier won the event at Iowa State's Bill Bergan Invitational with the same mark of 17-6˝.
Siegmeier, a senior, posted a career-best vault of 17-9, which ranks second in the Big Ten Conference and 14th nationally this season, Feb. 7 at the Thundering Herd Classic in Fargo, N.D.
Freshman finds groove: McHenry East grad Alexa McClaughry is batting a team-best .438 as the starting shortstop for D-II University of Illinois-Springfield's softball team.McClaughry, a freshman, ranks second on the team with seven hits and four runs scored for the Prairie Stars (4-2).
McClaughry has scored a run in four of the team's six games and posted a season-best 2 for 3 performance at the plate in a 4-1 loss last weekend to Northwest Missouri.
Senior night star: D-III Lake Forest College women's hockey goaltender Stacey Dierking enjoyed a memorable senior night last weekend.
Dierking (Crystal Lake Central) made 22 saves to help the Foresters (13-4-3) beat Northern Collegiate Hockey Association rival Adrian (Mich.), 6-3. The victory made Dierking only the second goalie in the program's history to achieve 30 career wins.
For the season, Dierking is 5-2-2 with a .882 save percentage.
Huskie happenings: Northern Illinois junior women's tennis player Nelle Youel (Crystal Lake Central) is off to a 4-0 start with partner Arantza De La Torre as the No. 1 doubles team for the Huskies.
Youel is 1-3 as the No. 1 singles player this season for NIU, which is 3-1 in dual meets.
• Barry Bottino writes a weekly column and a blog about local college athletes for the Northwest Herald. Write to him at firstname.lastname@example.com, check out his On Campus blog at McHenryCountySports.com and follow him on Twitter @BarryOnCampus.


text:
I don't even know what so say. This is bad. I think my Yankees are in some deep doo-doo. They are no longer atop the AL East, they have lost 4 in a row at HOME, and they are playing horribly! And all of a sudden, there are too many issues. The starting rotation is a giant question mark. The offense keeps dying. Why? What is this nonsense? Where are the World Champion-caliber New York Yankees that I know and love? Who ARE these guys?
After winning the first two games against the Rays, I thought the Yankees were in good shape. Yeah not so fast…they lost the next two, and completely erased the progress they had made. Now they dropped the first two games to the Triple A Red Sox. I hate so say it, but I'm honest: I thought that if they lost the first game against Boston, they would get swept, because the pitching matchups for the next 3 games were bad. So far, my prediction is still valid. WHY? Prove me wrong Yankees!!!
I'm just sick and tired of talking about the Yankees's problems. I wrote a whole post about that on FanVsFan. If you wanna see that, go here: http://pinstripepartisan.com/articles/what-is-wrong-with-the-yankees I tried answering my questions, but I couldn't! I just don't know what is wrong with them!
But what I do know, is that I'm tired of seeing the Yankees like this. They are embarrasing themselves. All of them. I don't want to see this anymore:
I want this:
No more of this:
I want to see this:
And I absolutely don't want to see this anymore:
I think it's time for some of this:
It's time to get serious…
Before I forget, I need some votes in my debate! It's about next year, and the Yankees getting Carl Crawford. I say they shouldn't get him…and I have my reasons. I think they should prioritize and sign Cliff Lee. He's going to take a lot, and since Crawford is not essential, I think the Yankees should pass on him and strengthen more important areas. To vote, register at the top right corner, then VOTE VIRGINIA!!! But hurry! Voting ends soon…
I will be very greatful🙂
6 Comments
That pic of the Yankees in the dugout really says it all. They look so defeated and they need to stop it! They should be up on their feet looking intense and hungry!
With the speed in which the AL East division is changing hands anything could happen in this final week and probably will, afterall the Rays got beat up today, so the Yankees just have to win one against the BoSox, that shouldn't be hard should it?
I don't blame you one bit. I'd be having a fit if my team was playing this way down the stretch. Wait a minute…they did and blew it! Yea! Like I said…I don't blame you one bit. Girardi is doing some awfully goofy stuff lately! I like a nice strong finish. So I know if I wouldn't be happy, you can't be happy.
I sense some jitters among the Yankees faithful. Good reason too. Mo can't keep doing this, right? For your sake, I hope not.
As I told you, I registered and voted for you.
Even without my team in the playoffs, I am looking forward to watching it. I can watch it without any preasures.
I am totally with you on Lee. That's the move the Yankees need to make in the off-season. This has been a frustrating month. The team could have done so much more this month with just a few more wins. Hopefully, our guys will start playing (and pitching) like we know they are capable of!


text:
Patients whose physicians "collaborate" with genetic testing corporations should beware. Today, Navigenics and all genetic testing businesses can legally sell genomic data. There is no way to know which ones sell or use data without informed consent and which don't. Americans' personal health information is extremely valuable to corporate America. Genomic data requires extreme privacy protection because it can be used to harm not only an individual but all his/her relatives.
According to Navigenics, the personal data shared is "aggregated" and "de-linked" from "your account information", but Navigenics offers no proof that it cannot be re-identified.
As we learned from the NIH experience, it is very difficult to "de-identify" or "anonymize" genetic data. The NIH closed a public research data base of "de-identified" genetic data after researchers proved the data could be re-identified See: . Corporations that share "de-identified" or "anonymized" health data should be required to publish the algorithms that were used and prove the data cannot be re-identified.
Questions abound:
• How can anyone be sure that Navigenics protects the privacy of genomic tests without trusted external audits of their privacy practices and policies?
• Does Navigenics pay MDVIP's doctors a "kickback" for "collaborating" each time a patient gets genomic tests? Does MDVIP inform patients that it has a contract with Navigenics and what each doctor is paid?
• Who is being paid for "collaboration"? What exactly are the financial and contractual terms of "collaboration" between MDVIP and Navigenics?
• Do MDVIP's patients really understand the risks of using Navigenics to do the testing or the risks of letting Navigenics share their genomic data with unknown researchers and research organizations—-that can put their data into public data respositories and publish it in studies? Or the security risks that a particular public respository can be hacked?
• Are MDVIP's patients coreced into taking Navigenics tests by their doctors? Most patients want to do what their doctors recommend. What is the consent process?
• Did MDVIP contractually sell or give their patients' genomic data or to Navigenics to own or sell? Should the public trust Navigenics, a for-profit corporation, when personal genomic data is a very valuable commodity?
• Should any for-profit collaboration "define the standards in which preventive genomic medicine will be integrated into patient care for decades to come"? No consumer health privacy expertise, assessment, or input was sought.
• There is not yet an operational, trusted, consumer-led privacy certification organization to audit genomic testing corporations to certify they don't sell genomic data and that consumers control sensitive personal genomic data in their data bases. In the absence of a trusted privacy certification organization, the privacy principles developed in 2007 by the bipartisan Coalition for Patient Privacy or the Code of Fair Information Practices could be used as guides for building a genomic testing and preventive healthcare system that consumers will trust and be willing to use.
• Would MDVIP's patients still feel "the experience (was) positive", "empowered rather than anxious", and "desire to change their lifestyles and more productively work with their physicians" if they knew their doctors were paid by Navigenics and their data was sold and/or put in public data repositories with unknown security and privacy protections?
This blog is in response to the article: Physician network to use genomic-based preventive healthcare


text:
Related Articles
802.11b Tips, Tricks, and Facts
My introduction to wireless networking was right here at O'Reilly Network, where our own Rob Flickenger has set up an 802.11b network spanning the three buildings that house the home offices of O'Reilly & Associates.
The idea of a wireless network was right on my wavelength. "You mean I can get Ethernet-speed web browsing, file transfers, and the whole works -- with nary a cable connection in sight -- from as far away as the coffeehouse across the street? Um, I'll be working from there this morning. IM me if you need me."
Needless to say, it wasn't long before I started thinking about other applications for this technology. I wanted Net access on my notebook computer from anywhere in or near my apartment, too. I started thinking about how I might control my stereo. I envisioned working on my laptop at a little garden table on a beautiful day under a stand of trees on my property, while birds chirp, leaves rustle, a light breeze wafts by, and one of Beethoven's symphonies blares from my window at, say, 80 dB. Freude! Naturally, the IEEE 802.11b wireless networking standard was the logical candidate for a means of implementing this nefarious scheme.
However, OEM wireless "residential gateway" hardware isn't exactly cheap, running into the hundreds of dollars and even thousands before you even start thinking about radios for the portables. And bona fide access points are even pricier. Why go to all that expense, I reasoned, when hardware that's gathering dust in my friends' closets -- hardware that they're not using, and would part with for nothing -- will do the job just as well, with only a little extra effort on my part. People have been using free operating systems to build dedicated firewalls and routers on i386 and i486 machines for years. Why not add wireless?
So I set about about building a wireless gateway using Linux, 802.11b, and an old PC. The project was a stunning success. Doing it right took some research, and a bit of trial-and-error, but it seemed to me that, in the end, the task was straightforward enough that anyone with the right hardware and a little know-how could easily replicate our results. Therefore I've endeavored to produce my "recipe" for an 802.11b gateway for you to follow at home. (It didn't hurt that my manager, Peter, was interested in building one for his house.) Those of you who own the home version of our show should be able to play along.
Ingredients for a wireless gateway:
apt-get or the equivalent, to make sure your distribution is up to date. In addition to the usual stuff, you'll definitely want to install the following packages:
pcmcia-cs modules.
ipchains or
pcmcia-cs package works a lot better. Trust us.
make dep
make modules
make modules_install
make bzImage or
make bzlilo
If you use LILO (which we do), and you prefer to
make bzImage and install the kernel by hand (which we did), don't forget to edit
/etc/lilo.conf and then run
/sbin/lilo (which we also did the first time).
make modules_install and the kernel image installation steps. We did this, and it saved us a lot of time and trouble. It's hard to get a sense of how much faster computers really are these days -- until you try compiling a current Linux kernel on a 486 processor with 16 megabytes of RAM, and discover how long you end up waiting for it to finish.
make config. Answer the questions. Sensible defaults are provided, and it's normally OK to enable CardBus support even if you don't have 32-bit PCMCIA cards.
make all
make install
make suffices to build the package, but, amusingly, the package doesn't come with a
make install option (as of this writing, anyway). You'll have to copy the
iwpriv, and
iwspy binaries to
/usr/local/sbin (or wherever you prefer to keep them) by hand. Likewise with the main pages (such as, the
.8 files).
ESSID, which will uniquely identify your local wireless net, and another string to serve as your WEP (Wired Equivalent Privacy) encryption key. Set the rate to "auto", and the mode to "ad hoc".
/etc/pcmcia/network.opts (sample). For our example, we set the IP address (IPADDR) to 192.168.1.1 and net mask to 255.255.255.0. You may want to flavor these settings to taste.
/etc/sysconfig/network-scripts/eth0 to DHCP, or setting the IP address to a static value. If you're using a modem-based PPP link, you'll need to configure PPP in
/etc/ppp/options (sample). The PPP how-to document may be of service here. If you're on DSL, but don't have a DSL router, and need to use PPP-over-Ethernet (PPPoE), things get a little trickier, but not much. See the Roaring Penguin PPPoE site for information and downloads.
/etc/rc.d/init.d, and then create "symlinks" in each
rc*.d directory, or use
chkconfig. If you're running a 2.4.x kernel, you'll want to use
iptables instead, but the basic concepts are the same.
/etc/dhcpd.conf (sample). Providing DHCP on your wireless net ensures that you won't have to worry about manually setting IP addresses on each of the notebook machines -- you can just configure them to request an available address from the gateway when they need one.
/etc/rc.d/rc*.d directories, or use
chkconfig. If you don't know what a service is, or what it does, TURN IT OFF. You can always turn it back on later, if you wind up needing it. Be sure to leave network and PCMCIA services running, as well as
ipchains and
wireless.opts configuration, but, if you don't, be sure that the
MODE, and
KEY settings are the same on the clients. If you want to run Windows on your notebook, refer to Rob Flickenger's reference on setting it up for 802.11b.
pump or
dhcpcd. You can set the wireless card to try to obtain a lease via DHCP every time the interface comes up, by setting the DHCP variable to "true" in
/etc/pcmcia/network.opts. In Windows, you'll want to turn on the "Obtain IP address automatically" feature on the wireless network interface in the Control Panel, and reboot.
The morning after I set all this up in my home, I found myself reading the news, checking my mail, chatting on AIM, and playing MP3s on the stereo in the living room, all before I got out of bed. (This wireless stuff can be hazardous to your health, eh?)
Furthermore, once you've got this up and running, adding more gee-whiz features is easy. For example, I put a sound card in my gateway box, and connected it to my stereo. Now I can play MP3s from anywhere in the vicinity of my apartment, using an
xmms session running on the gateway. One could, as another example, set up
ntpd on the gateway, and have the client machines keep their system clocks synchronized wirelessly. The possibilities are almost endless -- if you come up with novel variations, please don't hesitate to let us know. We'd love to hear about them.
The coolest part of this whole project is that it isn't something that might happen next year, or even next month -- it's something you can go out this very afternoon, and put together for the cost of a PCMCIA adapter and a couple of 802.11b cards.
I think we have seen the future, folks, and it is definitely wireless. Here at O'Reilly Network, plans are afoot to mount a volunteer-sponsored community wireless cooperative. Rob and I have begun development on a floppy-based wireless Linux distribution, inspired by the Linux Router Project. We're hoping to plaster Sonoma County with homegrown, community-supported wireless access points. We'll have more to say about that once we really get started, so stay tuned!
Meanwhile, I've been having so much fun with my new wireless gateway that I haven't even had time to go out and price garden furniture.
Schuyler Erle had nothing to do with the Tunguska explosion of 1908. No, really.
Return to the Wireless DevCenter.
Copyright © 2009 O'Reilly Media, Inc.


text:
How Innovation Happens
Today's automobile is the most sophisticated technology owned by consumers. From the early stages planning, automakers design innovations into new vehicles, recognizing that technology provides many solutions to meet consumer needs.
An auto must function in the harshest climate conditions, from freezing cold to 100% humidity to desert temperatures… running on the roughest roads, from urban potholes to unpaved country roads… performing at highway speeds… for as much as a 150,000-mile lifetime… while meeting thousands of regulatory standards.
Virtually every aspect of the modern automobile is now high-tech, uses a high-tech material or was developed through a high-tech process. As a result, automakers rank at the top of lists on most innovative companies, and automakers are recognized leaders in R&D investments, both globally and in the U.S.
2014 Innovation Report: "How Automakers are Driving Innovation"
The Alliance has issued its 2014 report on the state of innovation in the auto industry.
Whether it's the nearly $100 billion automakers spend annually on R&D, or the thousands of new patents granted to the industry every year, this report has examples that help tell the story of how much technology automakers put into today's autos.
For more information, and to view the 2014 Innovation Report, click here.


text:
I Know I'm Sleeping Cause This Dream Is Too Crazy
78 comments:
- rachel / Red Lips Vintage said...
looks like a lovely afternoon!
- March 19, 2010 at 8:04 AM
- Rosie said...
That dress is so billowy and awesome, as is your floppy hat!
- March 19, 2010 at 8:06 AM
- Clara said...
i love your hat
and your dress is so cute
- March 19, 2010 at 8:09 AM
- my bat lightning heart said...
oh my goodness,
your necklace/watch is devine!
I love it!!!
- March 19, 2010 at 8:15 AM
- DearBeatrice said...
I love everything about this outfit ^.^
- March 19, 2010 at 8:25 AM
- Indy said...
This outfit is perfect! That hat looks gorgeous on you!
- March 19, 2010 at 8:27 AM
- Charmalade said...
By the way the sun is shining, I couldn't tell it's only 40 degrees! And this outfit is really-- I feel like it's so quintessentially YOU. I love the 70s feel with the floppy hat; your hair underneath the hat also looks cute. :)
Toast with Charmalade
- March 19, 2010 at 8:29 AM
- Julls said...
You are so pretty in this outfit.You should really wear more hats.Love it!
And your color is so..redish !
- March 19, 2010 at 8:34 AM
- natalie said...
Love your necklace and shoes!
- March 19, 2010 at 8:43 AM
- Chelsea said...
I like how there seems to be one stray yellow flower in the grass.
Great bohemian vibe coming from this outfit. I like it a lot.
- March 19, 2010 at 8:46 AM
- Liz OT said...
Absolutely stunning!
- March 19, 2010 at 8:49 AM
- Jenna said...
I know you are wearing all modern pieces, but you look like a poster girl for the 70s.
- March 19, 2010 at 8:54 AM
- Nico said...
i love everything about this!!! so cute.
- March 19, 2010 at 8:56 AM
- Nadine said...
This is such a cute dress!
- March 19, 2010 at 9:29 AM
- hannah said...
adorable as always! every detail is spot on spring on it's way. and man you really know how to style a hat! I always feel so silly in hats.
- March 19, 2010 at 9:32 AM
- Mamushka Marie said...
gorgeous, love the flowy dress on you, the print is so, so pretty :)
Mamushka Marie
- March 19, 2010 at 9:46 AM
- worn fashion journal said...
I love the necklace, horse accessories are so very spring.
- March 19, 2010 at 9:48 AM
- z a t i said...
i want ur dress ;D just too adorable
- March 19, 2010 at 9:57 AM
- Juliette said...
Love the vintage hat and dress!
- March 19, 2010 at 10:07 AM
- vintagewithatwist said...
this dress is lovely, and so is the hat :)
- March 19, 2010 at 10:07 AM
- Cheyne said...
I love this. The cute little liberty print, the bold hat, the grass. Everything is so perfect! :D
- March 19, 2010 at 10:09 AM
- Parapluie said...
I'd love lying in the sunshine rigth now
- March 19, 2010 at 10:20 AM
- be.aoi said...
beautiful dress!!
- March 19, 2010 at 10:59 AM
- wulanasihsetyarini said...
hi rebecca, i always love ur photos..
can u tell me the secret to be like those? hehe..
i love the place u're taking those too.. i can't find like that in here (indonesia) so jealous..
ur dress is sooooooooo adorable too..
love it
- March 19, 2010 at 11:03 AM
- libys11 said...
aaahhh that hat is such a statement piece! :D
- March 19, 2010 at 11:13 AM
- Mel said...
I love the dress and the hat! How perfectly lovely it would be to lie in the grass! Unfortunately if I did that here, it'd either be on someone else's lawn or in the park with the homeless, both filled with dog crap :(
- March 19, 2010 at 11:15 AM
- janettaylor said...
Amazing dress, Rebecca!
- March 19, 2010 at 11:19 AM
- M. said...
I'm still in love with that dress everytime you wear it, it's so great
lovelove, M.
- March 19, 2010 at 11:50 AM
- Catherine said...
These are some gorgeous photos! And I absolutely adore your necklace, it is so beautiful!
- March 19, 2010 at 12:00 PM
- Meghan V. said...
Looks great. I loved that dress on Modcloth but it looks way better on you.
- March 19, 2010 at 12:06 PM
- tywo said...
Lovely pictures!
- March 19, 2010 at 12:29 PM
- Kimberellie said...
Beautiful photos. This is definitely one of my fav photo shoots of yours! Oh, and I do love that dress on you. It IS so perfectly you! And with the black tights, shoes, and hat: perfect.
- March 19, 2010 at 12:34 PM
- kasey said...
What a beautiful outfit! :) That hat is to die for.
- March 19, 2010 at 12:51 PM
- Dhu said...
My mouth just dropped wide open, I love every aspect of this outfit. The horse clock is beyond amazing.
- March 19, 2010 at 1:12 PM
- Eli said...
me too! give me a little sun and Im outside enjoying it! Feels good to be on the west coast. Too bad to have to work indoors though
- March 19, 2010 at 1:17 PM
- Michelle said...
edward sharpe lyrics! i'm glad to see you've been listening to the rest of the album, too! :-)
- March 19, 2010 at 1:31 PM
- Faux Naif said...
oh you look marvelous! that hat is brilliant.
and hehe i know what you mean; people are walking around here in tshirts and flipflops when it really isn't all that warm - we just want to convince ourselves that winter is over!
- March 19, 2010 at 1:40 PM
- Raquel said...
oh I love your last picture, so countryside! I know what you mean about sunshine, today rained all day and I missed yesterday to show my arms to the sun.
PS: about your voice, I really liked it in the video, I like deep voices on women too! though I would like to hear your "normal voice", maybe another video? :)
- March 19, 2010 at 3:39 PM
- iñaki said...
That outfit seems PERFECT for this season!
- March 19, 2010 at 3:54 PM
- tess said...
I love how flowy your dress is
- March 19, 2010 at 3:55 PM
- Julia said...
A beautiful look -- I adore hats like that right now...I wish I looked good in hats, sigh...
- March 19, 2010 at 4:04 PM
- Alyssa said...
Have you seen the film 'The Hours'? This outfit reminds me of that film, and Virginia Woolf in it. You look as though you are from another era and it's fantastic. :)
- March 19, 2010 at 4:24 PM
- anne said...
great post! you look fantastic!!!
it looks so warm...i can't believe it is in the 40s :O!
- March 19, 2010 at 4:46 PM
- Delightfully Tacky said...
Oh wow! Green grass to lay in! The sun actually looks like it has some warmth in your photos. It's strange how the sunlight looks differently when it's cold or when it's warm.
- March 19, 2010 at 5:17 PM
- Twobreadsplease said...
i love your hat, perfect for some shade in the sun (even if there isn't that much of it) x
- March 19, 2010 at 5:47 PM
- bestie said...
Aw Rebecca you look stunning in that hat! Glad you wore it out again, and this time under the sun! Love the first photo (:
- March 19, 2010 at 7:51 PM
- Erika said...
LOVE the necklace!
- March 19, 2010 at 7:57 PM
- Kristi said...
I totally know what you mean with being the typical Northwest-er. The weather has been SO nice here in Seattle lately!! :)
- March 19, 2010 at 7:58 PM
- Annie Spandex said...
That floppy dress and hat look made for each other!
- March 19, 2010 at 9:37 PM
- Lucy in the Sky said...
Are the temperatures still in the 40s?? You're brave to wear an airy dress in that weather!
- March 19, 2010 at 11:44 PM
- MissKellie said...
I love everything about this outfit, you did such a great job styling that dress! :D
And last week, I came really close to ordering that necklace from Modcloth, just because I've seen you wear it with so many cute outfits! :)
- March 20, 2010 at 12:09 AM
- Alva said...
I'm in love with your hat!
- March 20, 2010 at 2:45 AM
- soft whispers said...
this outfit is lovely :)
- March 20, 2010 at 4:39 AM
- { I V Y } said...
you're beautiful!
- March 20, 2010 at 4:40 AM
- P' said...
So cute!! You look like from a drawing of Sarah Kay, do you know them? There's something about the 70' in your style... I love it!!!
Kisses from Paris ;)
- March 20, 2010 at 5:07 AM
- Mademoiselle H said...
Nice Outfit!
- March 20, 2010 at 5:09 AM
- Clare said...
Loving the hat and dress combination! Everytime you wear that horse necklace I get a little more jealous
- March 20, 2010 at 5:25 AM
- aurora. said...
cute outfit!
i love the hat
its a shame hats dont look right on me, i would love a hat like this!
also your necklace is so pretty i happen to be in love with clock necklaces and this one is darling :)
- March 20, 2010 at 8:38 AM
- Jen said...
your hair looks gorgeous here and i'm loving that hat of yours. if only i was a hat person! :)
- March 20, 2010 at 9:44 AM
- Dannie said...
you look sooo comfy and pretty, i loove that hat with that dress!
- March 20, 2010 at 11:11 AM
- indigotangerine said...
I am so wanting summer right now! And your lounging-in-the-sun-in-my-awesome-hat is not helping matters much. Thought what is this 40 degree weather you speak of? Its been gorgeously warm in Seattle (at least 60!)
- March 20, 2010 at 11:38 AM
- Daphne said...
I LOVE this! The hat and shoes (and location!) give the whole look a nostalgic feel that I really love.
- March 20, 2010 at 12:31 PM
- Sara Lynn said...
completely adorable!!
- March 20, 2010 at 2:28 PM
- denise, the prime magpie said...
Ha! As long as you're not Socks Wearing Sandals person, or the Walla Walla Wine Wine Woman Woman, I think you're safe from the Pemco ads. I actually think it's a pretty brilliant campaign, as it's so true! Your outfit, as always, is 100% unique and 100% fabulous. The wide brimmed hat is sun-safe and fashionable, all at the same time.
- March 20, 2010 at 5:56 PM
- Winnie said...
Ahhh I love the dress you're wearing, perfect for lovely summer days. These photos look so chilled out! I can't wait for the weather to get warmer so I can lie on the grass too!
- March 20, 2010 at 6:00 PM
- Amelia said...
I looove that hat! You should see the lawn at my school. The moment the sun comes out everyone's in sun dresses and shorts soaking it up even if it's in the 40s. I laugh at them, but sometimes I join in, too, haha.
- March 20, 2010 at 11:41 PM
- darlingdee said...
I love the necklace. It's cute!
I adore the backdrops of your photos, they are like out of a medieval fairytale
- March 21, 2010 at 12:07 AM
- Trishna said...
You have taken such a simple dress and turned it into an outfit full of mystery and allure. How do you do that??
- March 21, 2010 at 10:05 AM
- Kate said...
love the hat! and love the vintage feel of these photos, just gorgeous!
- March 21, 2010 at 1:12 PM
- indigotangerine said...
quick question: how do you make all of your lovely gifs, the little gif maker online told me my images were too big?
- March 21, 2010 at 4:23 PM
- Gillian Hannah Berry said...
These are so fantastical!
- March 21, 2010 at 7:25 PM
- BuzzChild said...
What a lovely lovely hat!
- March 22, 2010 at 2:30 AM
- Clare said...
I just gave you an award over on my blog...
tweet tweet tweet
- March 22, 2010 at 5:12 AM
- Melissa Blake said...
Beautiful as usual! I love your blog! xoxo
- March 22, 2010 at 5:39 AM
- Diana, The Girl Overboard said...
I do the same: wear short sleeves/lighter jacket when the sun's shining even if it's not that hot :)
You look gorgeous in these pics! Love esp the hat and the necklace!
- March 22, 2010 at 6:57 AM
- Becca Jane said...
I think this is one of my fave outfits of yours in a while - it just has such a romantic feel to it, very pretty!
I have to say I"m with you on enjoying the sun and whipping out the spring wear and enjoying the grass even if it's not actually that warm.. I think colder climes make for much greater appreciation of warm weather when it comes back to us in the spring
- March 22, 2010 at 12:37 PM
- lumikha said...
those shoes are too darling! :)
- March 22, 2010 at 2:33 PM
- Maeko @ thereafterish. said...
Looks like Prairie Diva with a hint of vintage glamour.... I love everything about this.
I try to wear shorter sleeves in slightly warmer weather, but it appears that my temperament is very limited in terms of what I can subject my skin to...
- March 23, 2010 at 8:09 AM


text:
H.A.S. starts business with help from grant
Highland Adventist School high school students have started a business. Thanks to a generous matching grant from the Tucker Community Foundation and donations from school supporters, the school has installed a 32 foot by 20 foot high tunnel near the school.
The high tunnel is in full production and is being managed by the H.A.S. high school entrepreneurship class.
Dr. Carol Carter, associate professor and chair of D&E's department of business and entrepreneurship, and Harry Henderson, associate professor in the same department, provided expert business advice as the project was in the planning phase. Carter also supplied the school with an entrepreneurship curriculum she co-authored.
After hours of hard work in preparing the ground for planting, and research to determine what plant species would be best for winter growing in the high tunnel, the students planted kale, spinach, hardy lettuce, and swiss chard and a few other experimental plants.
The students also enjoyed a visit from Mike Kwasniewski, owner of the Charm Farm in Beverly. Kwasniewski talked to the students about the basics of starting and running a small business followed by a visit to the greenhouse where he made some management and growing suggestions.
As the greenhouse crops have begun to grow, the students hand pick, package, and price the produce before selling it in the driveway of the school many days after school.
The students report that they have no trouble selling their winter vegetables and even have parents stopping in to see if there are any greens left on days when they sell out.
Cheryl Jacko, principal and entrepreneurship teacher, said, "The students are really enjoying this project and learning a lot about small business management. We are very appreciative to the Tucker Community Foundation and our matching donors, Carter, Henderson and all the others who have contributed to this project.
"Besides learning small business skills, a goal of this project is to help our students discover ways they can develop business opportunities right here in our area. We want to see our graduates stay here to build our local community while supporting themselves through private enterprise.
"They are also learning a lot about sustainable, local agriculture, which we promote. It is a win, win opportunity for our students."


text:
A school district in Walsh, Colo., a rural community in the breezy southeastern part of the state, is saving money with its new wind turbine, but the real payoff comes this fall.
Teachers are looking forward to using the new 2.4-kilowatt wind turbine that sits behind the high school as a tool to teach students about wind energy technology.
"It's always more exciting for kids to work with something real, instead of something that is hypothetical," says Kyle Hebberd, superintendent of Walsh School District. "Hopefully, the new turbine will connect better with the kids."
Making the turbine part of classroom activities gives the students hands-on experience and teaches them about the benefits of renewable energy, Kyle says.
Teachers from both the elementary and high school—which consist of about 150 students total—expect to incorporate the turbine into the math and science curriculum this upcoming school year. A group of them have already attended renewable energy courses to learn more about wind technology. Kyle also wants to create a Web site that broadcasts the turbine's energy savings and usage data so students can easily view it in the classroom.
The project may also encourage interest in the wind power field, which is growing in this part of the state.
"Our high school principal is excited about the vocational aspect," says Kyle, mentioning the 162-megawatt Colorado Green Wind Power Project located 50 miles north of the high school that employs about 20 people in the area.
As part of the Department of Energy's Wind for Schools Program, five schools in Colorado—four on the Eastern Plains and one in northern Colorado—were chosen to receive wind turbines. In December, the Walsh school district became the first to erect one.
The program is a joint effort of the Governor's Energy Office, DOE, National Renewable Energy Laboratory, and Colorado State University. The unit, which currently helps power two maintenance buildings associated with the schools, has already produced over 500 kilowatt hours of energy.


text:
This member hasn't filled in their description.
violetshadow567's FML badges
You are connected to FML via the mobile site or an app. How modern.
Consolation prize
Your FML was denied. We had to at least give you a badge to cheer you up a bit.
Up and coming moderator
It's nice of you to help us sort out the submissions, using FML's moderate feature.
violetshadow567's favorite FMLs
Doh! This user still hasn't added any FMLs to their favorites. :(
- 1
- « Previous page
- Next page »


text:
Contains the full text of poetry, fiction, and drama written in English and Spanish by hundreds of Chicano, Cuban, Puerto Rican, Dominican, and other Latin authors working in the United States.
Miami University has a long and proud tradition of student involvement in both radio and television productions. This exhibit will celebrate five decades of students in broadcasting. Many of these productions can be found online in the WMUB Archives. For questions about the exhibit, contact Marcus Ladd at email@example.com or (513) 529-0462.
Classic Catalog | OhioLINK | Lane Public | WorldCat |
More Options:
Research by Subject |
Databases A-Z
More Options:
OhioLINK Home |
OhioLINK Catalog |
Research by Subject |
Databases A-Z
More Options:
Miami University Search |
Miami University Directory
Staff Spotlight—Thom Gerrish
New in November: Leisure Reading
ALA President Dr. Julie Todaro Releases Statement on Libraries, the Association, Diversity and Inclusion
Leonard Cohen (1934-2016): playlist and notable resources


text:
Castor is a multifaceted software tool being developed under the auspices of exolab.org, an informal organization involved in the development of open source, enterprise software projects based on Java and XML.
The primary function of Castor is to perform data binding. Data binding is a process that facilitates the representation of one data model in another. For example, an XML data model, described by an XML schema document, can be approximately represented by Java classes. Castor helps by generating these classes from the XML schema document. Object instances of these classes are then able to store XML document data, so long as such documents conform to the XML schema.
Such binding works both ways, of course: object instances of the generated classes can be easily transformed back into XML documents through a process known as marshalling. Castor's marshalling engine can introspect the Java data objects and generate corresponding XML document elements. Such marshalling can be refined through the use of user-defined mapping files, which Castor also supports.
Related Reading
Java & XML Data Binding
While XML data binding is very useful, this article will focus on another aspect of Castor: data binding of Java objects to tables, columns, and rows in a SQL database. This functionality falls under the heading of Castor JDO. The intent of the Java Data Objects (JDO) standard is to transparently persist Java objects. Although similar in name and intent to Sun's efforts, Castor JDO was developed largely independently of Sun's efforts, but aims roughly in the same direction. Be that as it may, the two technologies have different feature sets, and should not be assumed to be interoperable.
Castor is able to employ a mapping file as a simple way to bind Java objects to SQL database tables. Instead of writing complex procedural code in Java to manage the database queries and updates via JDBC, Castor hides this complexity by using the mapping file entries and transparently performing the proper queries and updates in the background. This declarative mechanism of descibing how the objects and the database are linked makes maintenance easier, because mapping files are relatively easy to understand and can be changed without recompiling code. It's also much simpler in that it operates at a higher level of abstraction than functionally equivalent JDBC mechanisms allow.
Unlike Castor's XML marshalling -- where there is a default mapping of a Java object to XML elements and attributes -- no default mapping exists for binding Java objects to SQL database tables: you must use a mapping file to enable this functionality. The mapping file contains explicit information on how Castor should represent a set of Java objects in a relational database.
Mapping files are written in XML, and can be validated against either a DTD or an XML schema supplied by the Castor group. This type of validation will catch syntax errors, but it does take some practice to understand the concepts behind mapping files and understanding Castor's JDO behavior. If Castor JDO appears not to be storing data in the database, it's likely due to missing entries in an otherwise syntactically valid mapping file.
Before going into the details of mapping, let's first present an overview
of the mapping elements. For every Java class whose instances are to be
stored in the database, a
class element is required in the
mapping file. These class elements reside one level below
mapping root element:
<description>Optional description of mapping file</description>
<!-- you can include other mapping files -->
<include href="other/mapping_file.xml"/>
<class name="Class1" map-to="db_table1">
<description>Optional description of this class mapping</description>
<field name="field> <!-- mapping of a class data member -->
<sql> ... </sql> <!-- maps Java field to database column -->
<field> ... </field>
<class name="Class2" map-to="db-table2">
For each class to be mapped to a database table (the
map-to attribute indicates which table), the data members of
the class to be persisted (referred to as fields by Castor) will
have corresponding field elements. Each field element in turn has a
sql child
element, which describes how such fields are stored in the database.
Once a mapping has been established, Castor takes care of the queries and updates that are needed to fetch and store data as Java objects. It also handles conversions between SQL and Java datatypes seamlessly.
A mapping file is written from the point of view of the Java class and describes how the properties of each object are to be stored in database tables, columns, and rows. These class properties are referred to as fields in the mapping file.
The general rules for mapping Java objects to database tables are:
get/set methods.
Castor uses the XML-format mapping file to determine:
Every element and attribute of a primitive type in Java (
double, etc.) can be mapped to a table column that is of a comparable SQL
type. Some nonprimitive types (classes), such as
java.lang.Long, etc., can be mapped to a single table column, as
well. All other Java classes must have a class element definition in
the mapping file to be persisted in a database.
Remember, Castor will not introspect a class and apply a set of default rules to guess the fields and attempt to persist them. This is different behavior from that of the XML marshaller.
There may be cases where a class instance only exists as a member of a containing parent object (in other words, it makes an appearance only as a child of some other object). The mapping file conveniently allows such dependent objects to be denoted as such. The advantages of recording dependencies in the mapping file will be explained later.
When reconstructing an object from a SQL database, Castor uses the mapping information to determine where the class' data members are stored in the database.
It is possible to set up the mapping file so that an object doesn't have
to be pulled from the database in its entirety, but can be lazily fetched.
This means that certain members of the class instance will only be retrieved
when the appropriate
get method is called. The result is that large
objects can be fetched incrementally -- avoiding the performance hit of
fetching a load of data from the database that might not be needed by the
program at that time.
We're now ready to start in on the mechanics of how a set of Java objects are mapped to a SQL database. For this example, we assume the following environment:
The main variable here is the database. Not all databases support the same features, and some support similar features differently. I will point out cases where the examples show a Postgres-specific way of doing things.
For purposes of illustration, it's best to have a set of classes that exhibit the following relations between objects:
The first three are self-explanatory cardinality relationships among class instances. Number 4 has already been covered. The fifth item, class related to another, is the case where a class has a data member reference to another, nondependent class. The referenced class in this case is a strong entity, whose instances exist independently of the parent class instance.
The sixth type of relation is that where a class extends (is derived from) another Java class. The extended class type may contain additional data members (fields) not defined in the base class. If the base class and its data members are already mapped to a database table, then it would be desirable to be able to reuse that mapping for a derived class. In this case, a new table is created to hold the extended class' data members, and the members that are inherited are stored in the table used for the base class. In other words, a class that extends another class can be mapped in way that, when instances of the extended class are saved, data member values of that class are stored in two tables: the base type table, and the extended type table.
I'll use for an example a description of a merchant shipping line. At the top level, the shipping line has ships, and each ship has ports-of-call. This gives us three main domain objects:
Each of these domain objects in turn will have properties, both simple and complex. The easiest way to show the relation between line, ship, and port, along with their respective properties, is to see the object marshalled into an XML document that contains sample information for all of the above:
<shipping-line name="Burble Bros. Shipping">
<ship name="Bubbles" registry="Liberian">
<port-of-call name="Seattle" pier="41">
<arrival-time day="2002-12-03" time="02:35" zone="GMT"/>
<departure-time day="2002-12-05" time="22:45" zone="GMT"/>
<port-of-call name="San Fransisco" pier="1">
<ship name="Spring Surprise" registry="Sierra Leone">
<port-of-call ...>
As you can see in this XML document, each shipping line has multiple ships, and each ship has multiple ports-of-call. In addition, each element above has one or more attributes. In Java, such attributes are represented as class properties. Later, I'll show how these same attributes correspond to columns in a database table.
ShippingLine Class
Each shipping line has a name and several ships. An interface to the
ShippingLine class might look like the following:
public interface IShippingLine {
public String getName();
public Ship getShip( int i );
public ArrayList getShips();
public void addShip( Ship s );
public void setName( String name );
// more methods...
ShippingLine class has a Java-bean-type interface, with
methods for every data member of the class. Because a
ShippingLine object can
contain many
Ship instances, the methods for adding and retrieving
objects are different, because they manipulate objects in a collection.
The actual data members of
ShippingLine are as follows:
public class ShippingLine {
private String _name;
private ArrayList _ships;
private int _id;
// methods...
You'll note the addition of an
_id data member that was not mentioned in
the interface methods shown previously. The
_id member will be used only by the
JDO persistence engine as a table row identifier. It holds, in effect, the
value of the primary key of the row in database table that contains
ShippingLine object data. The
_id key value will be
autogenerated (as you shall see), and will therefore be unique.
shipping_line Table
We will use the following SQL statement to create a table for holding
ShippingLine information in our Postgres database:
CREATE TABLE shipping_line ( id SERIAL, name VARCHAR(80) );
Since most SQL databases (including Postgres) are case-insensitive, we've
named the table
shipping_line rather than
shippingline to
make the table name easier to read. For the definition itself, the language
keywords have been capitalized, but again, that is only for legibility. Since
SQL does not have an array type, there isn't a
ships column in the
table definition. In order to incorporate ships in shipping line, we will
have to use two tables. The Mapping Extended Classes section describes how this is done. For now, I'll concentrate on binding just this one table's information in the section to follow.
Before moving on to explain how to map a Java class to a table, let's first explain the table column definitions above in more detail.
id: The
id column is defined as
SERIAL, which is a Postgres notational shortcut for defining an auto-incrementing integer field. Such
auto-incrementing fields are useful as primary keys; in other words, the
columns used to uniquely identify rows in a table. When defining a column
of type
SERIAL, a
SEQUENCE table is generated in the background. A
sequence table is a special database table that holds the last generated
sequence number and has methods for retrieving the next sequence value.
More on this in the key generators section to follow.
name: The
name column is defined as being of type
CHARACTER VARYING) of maximum length 80. Postgres doesn't
actually require a maximum
VARCHAR length to be specified, but most
database systems do.
VARCHAR columns vary the number of bytes being
stored based on the length of the string values, and are therefore more
storage efficient than fixed-lenghth columns.
It may be that the name of a shipping line is sufficient to identify it
from any other. It may be likely that such is the case, and if so, then
shipping_line.name is sufficient as a row identifier in our table. The
shipping line name would then serve as a natural key. To be safe,
though, I'm using a generated sequential
id, known as a surrogate
key. Surrogate keys have no semantics associated with them -- they merely
identify each row in the
shipping_line table, and therefore each shipping
line. With surrogate keys, it is easy to ensure that no identity collisions
take place.
For table joins performed during a SQL query, integer-based surrogate key
lookups will prove faster than natural keys that require string comparisons.
Therefore, our foreign-key/primary-key columns in the database will use these
surrogate keys instead of the natural ones. However, it will be necessary to
place a unique index on the natural key as well as the surrogate, so that the
two are always mapped one-to-one (and the
id is associated with one and only one
CREATE TABLE shipping_line ( id SERIAL, name VARCHAR(20)
CONSTRAINT uniq_name UNIQUE (name));
Note that it was not necessary to define
id as unique, since the
datatype covers that base already.
Let's now proceed to write the XML mapping file.
As mentioned earlier, unlike Castor's XML marshalling, which has a default mapping based on Java introspection of the class definitions, a class-to-table mapping file must be provided explicitly in order for Castor to persist objects in a database. There are some tools, such as Raccoon, that can generate a Castor mapping file from Java beans. For the examples to follow, I'll author the mapping file by hand. By default, Castor expects a mapping file named mapping.xml.
If you've used Castor mapping files in the past to marshal XML, then the
format for binding Java data objects to databases is will seem familiar. Here
is the mapping between the
ShippingLine Java class and the
shipping_line database table:
<class name="ShippingLine" identity="id">
<map-to table="shipping_line"/>
<field name="id" type="integer">
<sql name="id" type="integer"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
What follows is an explanation of the elements and their values:
class element names the class to be mapped and its
identity field. In cases where there are multiple fields that make up the
identifier for the class (and table), a space-separated list of
id fields
can be specified. Say, for instance, that
ShippingLine id was not unique,
but that
id + name would be. In that case, the identity attribute of the
class element would have this value:
<class name="ShippingLine" identity="id name">
map-to element identifies the database table that
will be used to persist the
ShippingLine class data.
The first field to be mapped is the
id field.
Its datatype is specified as
integer, which is compatible with both the
Java primitive datatype
class java.lang.Integer. A type
specification is not required, but by providing one, we add an extra bit
of type checking during the persistence process.
Values for the class data member
id are to be stored in the
column of the
ShippingLine table, according to the
child element of
field. The SQL type
integer is compatible with that of the
integer datatype used for the Java field.
The next field to be mapped is the
name field. One of
the attributes of the field element indicates that a value for the name
is required. When it comes time to persist a
ShippingLine object, that
object must have a name value or an exception will be thrown.
sql element maps the
name field to a like-named
column in
shipping_line. The type of the column is declared to be
varchar, which is compatible with the
java.lang.String type of the
Note: Field names generally refer to methods, not the names of data members of a class.
Let's take a look at the
ShippingLine class once more:
public class ShippingLine {
private String _name;
private ArrayList _ships;
private int _id;
// methods...
public int getId() { return _id; }
public void setId( int id ) { _id = id; }
You see that the name of
id data member actually has a preceding
_id. Note that we didn't see this underscore in the field name
of the class mapping. That's because Castor is not accessing the
_id variable
directly. Instead, it is inferring the names of the
getter/setter methods for
_id data member from the field name provided in the class mapping. Hence,
getId() and not
It is possible, however, to access data members directly. The section "Binding Through Class Data Members" will show you how this is done.
In order to ensure that the
id column of the
shipping-line table
is unique, we defined the column to be of type
SERIAL. The Postgres database
supports this nonstandard (non-SQL) type as a convenient way to specify
columns as unique identifiers for a table row. It's really more of a function
than a type. When a column of type
SERIAL is declared in Postgres SQL, the
Postgres database management system creates a
SEQUENCE table for that
SEQUENCE table is a special table designed specifically for the
autogeneration of incremental values. These values are most frequently used
as identifiers, or primary keys, of table rows. When the
shipping_line table
was created, Postgres's SQL interpreter sees the
SERIAL type of the
id column
and creates a separate
SEQUENCE table named
shipping_line_id_seq .
Note: Just about every database has support for
SEQUENCE tables,
although the syntax for using them may vary. Consult your database manual for
specifics. What follows is an explanation of how to use
SEQUENCE tables in
Postgres; different databases may require slight alterations in the syntax
used below.
Having a
SERIAL datatype for a column is only half of the process of the
auto-generation of keys. The remaining work to be done is to call the
auto-generating function of the sequence table prior to commiting a row
insertion. This is done by declaring a
key-generator element
in the mapping.xml file. In this element, Castor has to know the name of the
SEQUENCE table in order to be able to call the proper
SEQUENCE table method
for getting the next
id value.
The way to specify the
SEQUENCE table
name in the
key-generator element is
shown below.
<key-generator name="SEQUENCE" alias="seqgen">
<param name="sequence" value="{0}_{1}_seq"/>
key-generator element has two attributes. The
name attribute describes
the type of key being used. Castor supports various types of keys;
keys are the most common. The
alias attribute gives us a handle on the key
generator. It is possible to refer to the key generator by its name, but an
alias gives us the option of having two different
SEQUENCE generators
in the mapping file, each under a separate alias.
param child element indicates the
SEQUENCE table name. Here we are
using replacable parameters,
{0} and
{1}, to specify the
SEQUENCE table to be used. Every occurrence of the
SERIAL column type requires a new sequence table to be
created. The name of the table is generated from the table name where
occurs, along with the column name. Recall that the sequence table name for
shipping_line id column was:
shipping_line_id_seq. By using
the replaceable paramters
{0} (which resolves to the table name containing
SERIAL column) and
{1} (the
SERIAL column name), each time the
key-generator is called, the correct
SEQUENCE table is used.
With my
key-generator defined, I can next hook up a
key-generator to the
shipping_line table mapping definition by adding a reference to the
key-generator via a class element attribute:
<class name="ShippingLine" identity="id">
<map-to table="shipping_line"/>
<field name="id" type="integer" key-generator="seqgen">
<sql name="id" type="integer"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
Now, every new
shipping-line row added to our Postgres database will have
a unique, sequential value as an identifier.
Not all SQL tables have single-column keys; some keys are compound keys. A compound key uniquely identifies a row in a database table, but uses two or more columns to do so.
Let's say a ship's name uniquely identifies a ship within a
registry. That's not to say that a ship is uniquely identified by name; it is
instead identified by the compound identifier
registry.name::ship.id. This
means that each ship must have a
registry attribute, and that the combination of
registry attribute and
ship id must be unique within the XML document (regardless of which shipping line the ships are in). In XML schema, it is possible to define a unique constraint that
will enforce this for all ship elements in the document root:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="document_root">
<xs:element name="shippingLine" maxOccurs="unbounded">
<xs:element name="ship" maxOccurs="unbounded">
<xs:attribute name="name" type="xs:string"
<xs:attribute name="registry" type="xs:string"
<xs:attribute name="name" type="xs:string"/>
<xs:unique name="shipUniq">
<xs:selector xpath="shippingLine/ship"/>
<xs:field xpath="@name"/>
<xs:field xpath="@registry"/>
This same uniqueness constraint can be implemented in the database table
definition for
CREATE TABLE ship (
registry VARCHAR(80) NOT NULL,
name VARCHAR(80) NOT NULL
-- other column definitions here --
CONSTRAINT id_ship UNIQUE (registry, name)
The database mapping file used by Castor can enforce this constraint for us, instead:
<class name="Ship" identity="registry name">
<map-to table="ship"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
<field name="registry" type="string" required="true">
<sql name="registry" type="varchar"/>
</field> <!-- rest of fields mapped here -->
The value of the
identity attribute of the class element is, in this case, a
space-delimited list of fields that together uniquely identify each ship.
With the identity constraint defined here, there is no need to have a unique
constraint defined in the database table definition. Castor will handle
There are two basic ways of binding the properties of a class to columns
in a SQL table. The first method is to use public class methods to access the
properties. By default, Castor uses this type of access, inferring the name
of the public
accessor/mutator methods from the name of the field being
mapped. As was shown earlier, if the field name is
id, then the
accessor method is assumed to be
What if the method names are different from what Castor assumes? In that case, you have to inform Castor of the proper methods by specifying them in the field mapping element:
<class name="ShippingLine" identity="id">
<map-to table="shipping_line"/>
<field name="id" type="integer" key-generator="seqgen"
get-method="getID" set-method="setID">
<sql name="id" type="integer"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
Normally, Castor would be looking for the Java bean methods
getId() and
setId() associated with the
property. The class author (me) prefers to capitalize both letters of
ID when
it occurs in method names. Because the capitalization is different from what
Castor would expect, the method names must be given explicitly in the mapping
A second way to bind a class property to a SQL table column is to access the class data member directly, rather than through methods. The data member must be public for this mechanism to work. To specify direct access, the following attribute of the field element is used:
<class name="ShippingLine" identity="id">
<map-to table="shipping_line"/>
<field name="_id"type="integer" key-generator="seqgen" direct="true">
<sql name="id" type="integer"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
By accessing the data member directly in this way, you can reduce the
number of public methods in the class definition. Notice that I've had to add
the underscore character, since I'm now referring to the name of the data
member directly, and it has an underscore in its name. The drawback to this
mechanism is that, because of the need for a public data member, I
consequently allow direct access by outside class methods in the application.
In any case, you really don't have much protection from the wicked, but at
least with public
get/set methods you can deprecate their use where advisable
through Javadoc comments.
In Java, a class definition can extend another (base) class' definition through type-derivation. The new class will inherit all of the data members and methods of the base class, plus it might add a few of its own.
In the case where only the extended class is stored in the database, the mapping file entry for that class will be the same as for any other class; however, if the base class is by itself persisted in the database already, then there will be an entry in the Castor mapping file for that class. It would be silly to have to copy all of those field mappings for the base class in the new mapping entry of the derived class. It would also be a maintenance worry: the derived class definition may change, and you'd wind up with two mapping entries to update.
Better would be to store the new data members of the extended class in a
new table in the database using a new mapping, and store the existing members
of the base class in the table already set aside for it. Then Castor can
perform a
join operation between the two tables, generating a row that has
all of the values of the data members (both inherited and new) for the extended
class. Two joined table rows form one class instance.
extends Attribute
A mapping for a class extends another class mapping through use of the
extends attribute. Let's say I want to subtype the
class so that there are cargo ships and passenger ships. I then have the
following Java classes:
public class Ship
String name;
String registry;
public Ship() { ... }
public class CargoShip extends Ship
int cargoTonnage;
public CargoShip() { ... }
public class OilTanker extends Ship
int barrels;
public OilTanker() { ... }
To store these new classes, I can map them as follows:
<class name="Ship" identity="registry name">
<map-to table="ship"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
<field name="registry" type="string" required="true">
<sql name="registry" type="varchar"/>
<!-- rest offields mapped here -->
<class name="CargoShip" extends="ship" identity="id" key-generator="seqgen">
<description>Cargo is measured in net tonnage</description>
<map-to table="cargo_ship"/>
<field name="id" type="integer">
<sql name="id" type="integer" />
<field name="cargoTonnage" type="integer">
<sql name="cargo_tonnage" type="integer"/>
<class name="OilTanker" extends="ship" identity="id" key-generator="seqgen">
<description>Oil is measured in barrels</description>
<map-to table="oil_tanker"/>
<field name="id" type="integer">
<sql name="id" type="integer" />
<field name="barrels" type="integer">
<sql name="barrels" type="integer"/>
Because new tables are required to store the additional data members of
the extended classes, each extended class must have its own
id, in addition to
the identifying
name/registry it already inherits from the base
Ship class.
If we were dealing only with Java classes, having these extra identifiers in
the extended classes would be silly. But since we store the extended class
data in two relational tables, each row in the second (extension) table must
have a unique identifier; otherwise, the table would not be in First Normal
Form (where each row must be distinct). The unique identifer in each row
ensures that such is the case.
There can be cases where you might not want to create a new database table for each class to be persisted. It's possible in Castor to store data from a parent object and its child in one table.
The ships of the line, in addition to ferrying ubiquitous shipping containers across the seas, have to transport an odd-sized crate now and then. The dimensions of each crate are maintained in the database. The unit of measure of a dimension might be in either meters or feet.
public class Dimension
public double measurement;
public UOMType uom;
public class UOMType
private static String _feet = "ft";
private static String _meters = "m";
private String _unit;
public static UOMType FEET = new UOMType( _feet );
public static UOMType METERS = new UOMType( _meters );
private UOMType( String type ) { _unit = type;}
public void setUnit( String type ) {_unit = type; }
public String getUnit() {return _unit;}
The last class maintains public instances that denote two types of
measurement. Each
Dimension instance will refer to one of
UOMType objects. Since
UOMType is a separate class
Dimension, it would seem that
I'd have to have two class descriptions in the Castor mapping file. That's
overkill for the tiny
UOMType class, with its single primitive value.
An alternative approach is to store
UOMType data in the same table that
contains the
Dimension rows. To accomplish this, I use a dot path in the
class mapping for
Dimension, like so:
<!-- Mapping for class Dimension -->
<class name="Dimension" identity="id">
<map-to table="dimension"/>
<field name="id" type="integer">
<sql name="id" type="integer"/>
<field name="measurement" type="double">
<sql name="measurement" type="decimal"/>
<field name="uom.unit" type="string">
<sql name="uom" type="varchar"/>
A dot path denotes data that is nested at a lower level in a container
class than the class that is being mapped. By referring to nested data in
this way, both the
Dimension class data and the
UOMType class data are stored
in one table. With this approach, it's easy to look at the database row
values and see what is being measured.
I use the term object hierarchy to refer to the parent-child
hierarchy of class instances where an object has one or more objects as data
members. In the
ShippingLine example, the children of
ShippingLine objects
are instances of class
instances, in turn, have
PortOfCall child
objects as data members.
There are several ways to map such hierarchies to a relational database table. Each type of mapping is determined by factors such as the cardinality of parent-child relationship (one-to-one, one-to-many, many-to-many), and if children represent strong or weak entities.
One of the primary constraints to be determined in any business model is
the relative independence of data entities (represented as classes and their
instances in Java). Some entities come into and out of existence of their own
accord. For instance, new shipping lines are founded and others go out of
business as time passes. We want to be able to create new
classes at the drop of a hat. Shipping lines are strong entities in
our data model. When a new shipping line comes into existence, I can
construct a
ShippingLine object to contain information about it.
There are some entities in our model that don't have such a carefree existence. Such an entity is so dependent upon another that it couldn't exist without the existence of the referenced entity. When an entity instance depends upon another for its very existence, it is a weak entity. Ships are weak entities and must be associated with a shipping line before we can incorporate ship information in our model.
Note that I'm referring to business rules in the abstract, and not to
rules applicable to specific physical data models. There are two physical
models that this article focuses upon: one in Java and one in a SQL database.
If we tossed in XML documents, that would be a third. Each physical model has
different mechanisms for enforcement of weak entity dependencies. In Java, a
Ship's dependency upon a
ShippingLine would
usually be enforced by requiring
non-null ShippingLine.object parameter passed to the
Ship class
constructor. In the database, such a dependency would be enforced by having a
required foreign key column in the ship table that has a value that matches a
primary key in the
ShippingLine table. In XML, the
element might be the root element of a document, and
ships are child elements.
In fact, there may be different constraints for any one of these physical
data models. For example, an XML document might report on all shipping lines
in our database, and therefore would require a different root element. That's
not a business constraint, however, so much as a constraint enforced by the physical
data model representation. Those types of dependencies are best
expressed locally; in this instance, the reporting module would be sure that
shippingLine elements are within the document's root element (whatever
that may be).
I can go ahead and use the particular mechanisms that each physical model provides to enforce strong-strong and strong-weak entity constraints. There are drawbacks to this approach, however. The obvious one is that I must make sure that each mechanism is in fact enforcing these constraints in a manner compatible with the others. Also, changes in the strong-weak relationship of entities requires changes to schema and class definitions at separate locations. A more subtle drawback is that constraint mechanisms of a particular data model may be incompatible with the application's mechanisms for data storage and class construction. In fact, Castor's method of data binding often runs into trouble when columns in a database are defined with sophisticated column constraints.
Fortunately, the Castor mapping file has all of the appropriate features to ensure that entity relationships, both strong-strong and strong-weak, can be defined and enforced.
Castor uses the term dependent class to denote a class
representing a weak entity. Instances of a dependent class have a parent
master object that they are dependent upon. Through the use of a
depends attribute in the class mapping element, the JDO
persistence engine is able to ensure that a dependent class instance is only
saved as part of its master object. In other words, you can't save a
dependent class by itself.
There are other restrictions noted in the Castor documentation:
Before moving on, let's note two further advantages of enforcing dependencies through the mapping file.
Not all parent-child object relationships are strong-weak. A class representing a strong entity in the data model can refer to another strong entity class. A shipping line might be owned by a shipping magnate, or by a holding company. Both magnates and holding companies might be strong entities in our data model (they're certainly not dependent upon shipping lines for their existence (although, arguably, the magnate is)). Conversely, a shipping line may be owned by a magnate, or by a holding company, or it might be a wholly independent corporation -- so its existence is not dependent upon magnates or holding companies.
In such circumstances, even though one class might refer to the other, there isn't a strong-weak dependency there; it's possible to create magnates independently of shipping lines and vice versa. Both are strong entities in our model. For these cases, Castor declares them to be related classes. Related classes are not treated specially by Castor. This means that they come and go out of existence without regard for each other, and (most importantly) they must be saved independently.
A one-to-many relationship in Java is simply a class instance with a collection of objects of the same type. In a database, the one-to-many relationship is denoted by the appearance of identical foreign key values in a table (each row with the same foreign key value points to a single row in different table).
In the mapping file, fields that are collections of same-type objects are
denoted by the
collection attribute. The
attribute can take one of several values:
|Mapping Name
Map (HashMap)
Set (HashSet)
(Note: The classes in parenthesis are the default
implementations of the interface shown. Defaults are used where collection
instances are
One consequence of a shipping line having one or more ships is that the
ShippingLine class must have a collection whose elements are
Ships. Let's
say the collection is a Java
ArrayList. The mapping file below highlights
the way collections are mapped in class elements:
<class name="ShippingLine" identity="id" key-generator="seqgen">
<map-to table="shipping_line"/>
<field name="id" type="integer" get-method="getID" set-method="setID">
<sql name="id" type="integer"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
<field name="ships" type="Ship" collection="arraylist>
<sql many-key="id_shipping_line"/>
<class name="Ship" identity="registry name" depends="ShippingLine">
<map-to table="ship"/>
<field name="registry" type="string" required="true">
<sql name="registry" type="varchar"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
<field name="shippingLine" type="ShippingLine" required="true">
<sql name="id_shipping_line"/>
<!-- rest of fields mapped here -->
Here, we have a dependent one-to-many relationship between
Ship. This means that the collection of
Ships will be saved automatically
at the time
ShippingLine is saved. When mapping the collection to a database table, the
many_key attribute is used in the
sql element. The
many_key value refers to the column in the
ship table that contains the foreign key to
shipping_line. Let me restate that for emphasis: the
shipping_line mapping refers to a foreign key column in the
ship table. This value must match that of the
name attribute in the
sql element for the
Ship class mapping (highlighted).
The foreign key column type of
ship must match the type
of the identifier (primary key) it refers to. Since the
shipping_line table has a primary key on the
id column (an integer), the foreign key
id_shipping_line must also be of that type. However, note
that this type is not shown in the field mapping for
shippingLine. The type
is inferred from the field's declared type. That type is not
integer, but
ShippingLine. This is the one case where the type of the field does not
correlate with the type of the table column.
It's not enough, however, that I declare an
ArrayList in
ShippingLine to
Ship objects. I have to maintain a backlink to the master object from
the dependent object. This is simple enough to do. First, I add a
ShippingLine class instance to the
Ship class, with
get/set methods:
class Ship
private ShippingLine _shippingLine;
public ShippingLine getShippingLine()
return _shippingLine;
public void setShippingLine(ShippingLine shippingLine)
_shippingLine = shippingLine;
Next, I need to be sure that the reference to the master object is populated
at the appropriate time. The logical place to do this is in
addShip() method:
public void addShip(Ship vShip)
throws java.lang.IndexOutOfBoundsException
vShip.setShippingLine(this); //set the master object reference
What about the
removeShip() method? Should it delete the master object
reference from
Ship when an instance is removed from the
ShippingLine? It
depends on the application, but as far as we're concerned, since
Ship objects
can only be persisted in the database through a
ShippingLine, none of the
Ship instances will ever be saved with an invalid master object reference
(all instances will have gone through the
ShippingLine.addShip() method).
In order to properly represent many-to-many relationships in a database, an intersection table is required. An intersection table consists of two foreign key columns, one for each table in the many-to-many relation. Each column may have the same key value repeated in the table rows, although identical foreign key pairings should not appear in more than one row of the table.
Let's say that each
PortOfCall keeps track of the
Ships that visit it, in
addition to each
Ship maintaining its own
PortOfCall list.
PortOfCall sees many
Ships, each
Ship enters many
PortsOfCall. This is our many-to-many relation.
I might only have two Java classes, but I will have three database tables to store these two classes. First, an outline of the Java classes is in order:
public class Ship
String name;
// String registry; // commented out
ArrayList portsOfCall = new ArrayList();
public Ship() { ... }
public void addPortOfCall( PortOfCall poc )
portsOfCall.add( poc );
poc.addShip( this );
//other methods...
public class PortOfCall
String name;
ArrayList ships = new ArrayList;
public PortOfCall() { ... }
public void addShip( Ship ship )
portsOfCall.add( ship );
// other methods...
Note: Since they're not pertininent to the present discussion, I haven't shown how a ship's arrival and departure times figure into these two classes. Assume they are somehow associated with the
PortOfCall instances.
Due to a limitation in the current version of Castor, I've had to rely on name alone to identify a
Ship. The mapping files for both
Ship and
PortOfCall are as follows:
<class name="Ship" identity="name" depends="ShippingLine">
<map-to table="ship"/>
<field name="registry" type="string" required="true">
<sql name="registry" type="varchar"/>
<field name="name" type="string" required="true">
<sql name="name" type="varchar"/>
<field name="shippingLine" type="ShippingLine" required="true">
<sql name="id_shipping_line"/>
<field name="portOfCall" type="PortOfCall" collection="arraylist">
<sql name="poc_name" many-table="poc_ship" many-key="ship_name"/>
<class name="com.example.shipping.PortOfCall" identity="name">
<map-to table="port_of_call"/>
<field name="name" type="string">
<sql name="name" type="varchar"/>
<field name="ship" type="Ship" collection="arraylist">
<sql name="ship_name" many-table="poc_ship" many-key="poc_name"/>
Nothing need be changed in the
ship table, and the
port_of_call table is
simple enough:
CREATE TABLE port_of_call (
name VARCHAR(80)
I now have to add a third
join table,
poc_ship, that links many
port_of_call rows to many
ship rows through their respective foreign
keys (as described in the mapping file):
CREATE TABLE poc_ship (
poc_name VARCHAR(80), -- port_of_call fkey
ship_name VARCHAR(80) -- ship fkey
It's now possible to construct a test case, part of which is shown below:
ship[0].setName("Seven Seas");
ship[1].setName("Sea Six");
_shippingLine.addShip( ship[0] );
_shippingLine.addShip( ship[1] );
PortOfCall pocs[] = new PortOfCall[]
new PortOfCall("Pago Pago"),
new PortOfCall("Walla Walla")
ship[0].addPortOfCall( _poc[0] );
ship[0].addPortOfCall( _poc[1] );
ship[1].addPortOfCall( _poc[0] );
PersistenceFactory.getInstance().store(pocs[0], true);
// true means create, not update
PersistenceFactory.getInstance().store(pocs[1], true);
//stores all Ships instances as well
PersistenceFactory.getInstance().store(_shippingLine, true);
Now, if all went according to plan, I should see entries in the
poc_ship table when I execute a
SELECT * from poc_ship; SQL statement from the DBMS's command line:
poc_name | ship_name
Pago Pago | Sea Six
Walla Walla | Sea Six
Pago Pago | Seven Seas
If I see these entries, then I know I've successfully recorded a many-to-many join in the database using Castor JDO.
In order to be able to access the database, we need to establish a connection to it. Castor maintains connection information in a separate file from the mapping file. This file is typically named database.xml.
The database.xml file contains information about the database being used and its location. It also indicates the JDBC driver to be used (JDBC stands for Java Database Connectivity, an vendor-neutral API for communicating with relational database management systems).
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor JDO Configuration DTD
Version 1.0//EN" "http://castor.exolab.org/jdo-conf.dtd">
<database name="shippingDB" engine="postgresql">
<driver class-name="org.postgresql.Driver" url="jdbc:postgresql:shippingDB">
<param name="user" value="Administrator"/>
<param name="password" value=""/>
<mapping href="d:/shipping/mapping.xml" />
The database to connect to is indicated by the value of the
name attribute
in the database element. The engine attribute of that element tells Castor
that it's a Postgres database (formerly known as PostgreSQL, hence the name
of the Castor database engine).
The driver element has a
class-name attribute that indicates the class in
the Java classpath that functions as the JDBC driver. The
url attribute is
the connection string that the JDBC driver uses to make a connection to the
Postgres database. A JDBC driver is often supplied by the database vendor or
distributor. For Postgres, an up-to-date JDBC driver can be found at http://jdbc.postgresql.org.
Related Reading
Database Programming with JDBC & Java
param elements have user and password
information that the driver needs to log in to the database. Other JDBC
drivers may have more (or possibly fewer) parameters, so additional
elements can be provided as children of the
driver element.
Finally, the location of the JDO mapping file is given in
href format.
Once the JDBC connection is established, Castor reads in the mapping.xml file
and is ready to start storing and retrieving data.
The storing of class instances in the relational database is straightforward, thanks to the JDO mapping file and Castor's support of Object Query Language (OQL). OQL is a query language developed by the Object Database Management Group (ODMG), a consortium of object database vendors and users. OQL is a lot like SQL with objects thrown in.
Unlike SQL, where a myriad of statements must be used to store even a simple Java object (and requiring an inate understanding by the programmer as to how each object is mapped to the various database tables), OQL can store entire hierarchies of objects in a single statement.
Castor relies primarily on connection information in the database.xml file. To make the connection, first a JDO instance is created using a default constructor. The JDO is then configured with the database name to open and provide the location of the database.xml file. A database.xml file may contain connection information for more than one database, hence the need to specify a database name.
Optionally, database log information can be sent to an output stream of your choosing. The log information is useful for debugging, since it records all SQL commands and return statuses that Castor sends to and receives from the database during transaction commits.
package com.example.shipping;
import org.exolab.castor.jdo.*;
import java.io.PrintWriter;
import java.io.ByteArrayOutputStream;
class PersistenceFactory
private static String _databaseName = "shippingDB";
private static String _databaseConfiguration = "d:/shipping/database.xml";
public PersistenceFactory() throws PersistenceException
_jdoLogWriter = new PrintWriter(new ByteArrayOutputStream(400));
private void open() throws PersistenceException
JDO jdo; // Define the JDO object
jdo = new JDO();
jdo.setConfiguration(_databaseConfiguration); // Obtain a new database
_db = jdo.getDatabase();
// other persistence methods...
The core of the connection procedure is highlighted above. Once the
connection is made, all subsequent database transaction go through Castor's
Database class instance.
As mentioned earlier, Castor uses OQL to store and retrieve data from the database. OQL is an object-oriented extension of SQL, so it is possible to use SQL commands, although for object manipulation, it's not the preferred choice.
Before doing anything with the database, you must first start a
transaction using the
begin() method of
Changes are not made to the database until the transaction is committed using
commit() method. Both methods' calls are highlighted below:
public void store(Object obj, boolean create)
throws PersistStoreException
try {
if (create)
catch (ClassNotPersistenceCapableException ex)
{ throw new PersistStoreException(ex.toString()); }
catch (DuplicateIdentityException ex)
{ throw new PersistStoreException(ex.toString()); }
catch (TransactionNotInProgressException ex)
{ throw new PersistStoreException(ex.toString()); }
catch (TransactionAbortedException ex)
{ throw new PersistStoreException(ex.toString()); }
catch (PersistenceException ex)
{ throw new PersistStoreException(ex.toString()); }
Once a transaction is started, you may save a new object in the database
or, if changes were made to an object previously fetched from the database
(as it could have been from a prior transaction), you may "update" it. If the
create() method is called, then an object with the same identifier
must not already exist in the database, or an exception will occur. Updates,
on the other hand, require that the object be in the database, inasmuch as it
has the same identifier.
Dependent objects are not created or updated directly, as you may recall. What counts is whether the master object exists previously in the database or not.
In the code above, I've elected to collapse all of the possible exceptions
that Castor can throw during the transaction into one exception that I've
defined. I'm assuming that any exception that gets thrown here is essentially
fatal, but another (more clever?) person might be able to program a recovery
under certain circumstances. Also, while having
the transaction
begin/commit calls inside of this one method simplifies the
storage and update of single objects, you would normally want to commit
multiple objects at one time in a single transaction for better efficiency.
In that case, you'd begin your transaction before the first object is stored
and commit after the last object is stored.
ShippingLine Objects
OQL queries for fetching object data look very much like SQL queries, except that you don't get a row cursor returned (where each row then has to be manhandled into a class instance); instead, you receive a cursor to a list of fully-formed objects. Very nice.
public Object fetch(String objName, String id)
throws PersistFetchException
Object object = null;
try {
Query oql;
QueryResults results;
oql = _db.getOQLQuery(
"SELECT o" +
" FROM com.example.shipping." + objName + " o" +
" WHERE o.id=\"" + id + "\"" );
results = oql.execute();
while (results.hasMore() )
object = results.next();
catch ( TransactionAbortedException ex )
{ throw new PersistFetchException( ex.toString() ); }
catch ( TransactionNotInProgressException ex )
{ throw new PersistFetchException( ex.toString() ); }
catch ( PersistenceException ex )
{ throw new PersistFetchException( ex.toString() ); }
return object;
To fetch an object from the database, we first construct an OQL query
using the
getOQLQuery() method of
org.exolab.castor.oql.Database. The query
in this case might be:
SELECT o
FROM com.example.shipping.Ship o
WHERE o.id="Waterdown"
Once the query object is constructed, it can be executed. The results are
returned in a
QueryResults object. The
QueryResults object
functions as an array of
Object instances. I'm assuming in this code that I have only one
result (bad programmer am I). However, when I originally wrote this example,
I called the undocumented
results.size() method and checked for a value equal
to 1. I was unpleasantly surprised to find that
size() always returned 0! In
this case, it's a safe assumption that I'm only going to get one object per
identifier, but it's not very defensive coding.
The returned object(s) can be cast to the expected class type by the caller.
Castor JDO provides a lot of capability for simplifying the storage of Java data objects in relational tables. The use of a mapping file to direct the Castor JDO engine on how to store object member data to table rows and columns really reduces the amount of grunge code involved in query/update procedures. Mapping files maintain information about object dependencies and primary/foreign keys, also; the result is that you don't have to futz with such dependencies in either the application code or database schema.
There are many additional features of Castor JDO that I was not able to cover in this article. A lot of these are not yet well-documented; however, there's usually some example code that you can download from the Castor Web site, either as a source repository snapshot (taken daily and for each release build) or by using WebCVS.
As of this writing, Castor sits at pre-release version 0.9.3.21. A call for contributors recently went out on the the Castor mailing list, so if storing objects in databases is your kind of gig, you might check out the possibilities available in getting Castor 1.0 out the door. Hey, it just might save you a lot of work!
Jeff Lowery is a JDO expert and advocate and is experienced at using Exolab's Castor, Jakarta Ant, and more.
Return to ONJava.com.
Copyright © 2009 O'Reilly Media, Inc.


text:
"I've been around when literally every teacher around me has left, said Campbell High School teacher Corey Rosenlee.
The teacher's union says more than 1,000 teachers are leaving or retiring every year in Hawaii, and Rosenlee feels years of stumbling contract talks are about to make a bad situation a critical one.
"Right now, we don't have enough people to fill the classrooms. We have to get emergency hires, we have substitutes," Rosenlee said.
The state's latest offer includes $49 million of new compensation -- $11 million more than in the last state proposal.
It would restore 5 percent wage cuts and offer other support, as well as bonuses for so-called "highly effective" teachers.
"I think the contract proposal speaks for itself and I'm confident the public will conclude the board of education has done an excellent job," said Gov. Neil Abercrombie.
The state says the offer includes 24 out of 30 items already agreed to by the union but that offer was taken off the table last week after HSTA rejected the package as a whole.
"To walk away and have a 'take it or leave it' attitude in this negotiating process is not fair," said HSTA president Wil Okabe.
He said increased health care costs would negate the first year of 2 percent annual increases, that teachers would lose out on about $100 million in reimbursement pay, and he feels evaluations rely too heavily on test scores.
"They say to me we're OK with being evaluated. Bring it on. But we want it to be a fair process," said Rosenlee.
Teachers have been trying to have a hand into how their evaluated.
HSTA held a series of town hall meetings in October, then just put out a survey to its members to get their final input.
"I'm supporting the teachers and the staff who have worked hard to put these evaluations together. The program needs a chance to operate," said Abercrombie.
The state had hoped to resume negotiations on Dec. 19, but HSTA negotiators pushed it to Jan. 11.