Welcome Guest  |  Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 6
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 2068 times and has 5 replies Next Thread
Male andy
Expert
Member's Avatar

UK
Joined: Mar 13, 2004
Post Count: 5686
Status: Offline
Reply to this Post  Reply with Quote 
JDO 2.3 Metadata API

You can read about this new feature here
http://datanucleus.blogspot.com/2009/01/jdo-23-metadata-api.html
----------------------------------------
-Andy smile

[Jan 27, 2009 11:52:46 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male ganzuoni
Expert
Member's Avatar


Joined: Nov 16, 2005
Post Count: 1009
Status: Online
Reply to this Post  Reply with Quote 
Re: JDO 2.3 Metadata API

Nice, very nice.
Having the possibility to access metadata with an API instead of
parsing XML and reimplementing .jdo/.orm files retrieval algorithms is great.
I know that you can specify orm-specific properties in .jdo files but
I really don't like:

ClassMetadata cmd = pmd.newClassMetadata("Client");
cmd.setTable("CLIENT")

I would prefer

ClassMetadata cmd = pmd.newClassMetadata("Client");
OrmClassMetadata ormcmd = cmd.getOrmMetadata();
ormcmd.setTable("CLIENT")


Guido
----------------------------------------
Guido Anzuoni
http://www.objectmagic.org
[Jan 27, 2009 12:40:28 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male andy
Expert
Member's Avatar

UK
Joined: Mar 13, 2004
Post Count: 5686
Status: Offline
Reply to this Post  Reply with Quote 
Re: JDO 2.3 Metadata API

I know that you can specify orm-specific properties in .jdo files but

yes I know, and FWIW I agree totally on the principle of keeping ORM info out of basic persistence information (which is why all DN docs stress this), but providing a split causes implementation issues since ORM info is distributed through the whole metadata "file", on every element with some attributes being ORM and some being JDO. So we'd have to force people to "create" 2 metadata objects - one for JDO and one for ORM, and if they had multiple classes in their metadata object then this would get complicated. Also it complicates the implementation, and not got the time for that right now

PS. I just updated the blog entry to now include the access to XML/annotation based metadata, as well as mentioning that you can use toString() on the JDO metadata object to get the XML representation that it equates to.
----------------------------------------
-Andy smile

----------------------------------------
[Edit 1 times, last edit by andy at Jan 27, 2009 3:32:16 PM]
[Jan 27, 2009 3:30:36 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male fschulz
Newbie




Joined: Mar 7, 2008
Post Count: 18
Status: Offline
Reply to this Post  Reply with Quote 
Re: JDO 2.3 Metadata API

I read the blog article about this topic. I am particularly excited about being able to programmatically create persistence meta data.
For use with RDBMS I have one question though:
How could DB schema creation be handled in a scenario with no external (XML) and only programmatically created meta data - if at all? "autoCreateSchema" is not a valid option for most use cases I'm sure. How could the SchemaCreator (e.g. launched from Ant) receive the required meta data?
[Feb 5, 2009 10:25:23 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male andy
Expert
Member's Avatar

UK
Joined: Mar 13, 2004
Post Count: 5686
Status: Offline
Reply to this Post  Reply with Quote 
Re: JDO 2.3 Metadata API

Doing things in-memory is not limited to metadata definition
http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageId=6619188
You can create classes (ASM), define their metadata ("JDO2.3 Metadata API"), enhance them ("JDO2.3 Enhancer API"), run schematool on them (DataNucleus), and even persist them (JDO) ... without anything actually in your filesystem. Or you can do a subset of the above
----------------------------------------
-Andy smile

[Feb 5, 2009 10:42:50 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male fschulz
Newbie




Joined: Mar 7, 2008
Post Count: 18
Status: Offline
Reply to this Post  Reply with Quote 
Re: JDO 2.3 Metadata API

Lots of nice information there. Thanks a lot! wink
[Feb 5, 2009 1:59:35 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread