Re: Entity name from class
Re: Entity name from class
- Subject: Re: Entity name from class
- From: email@hidden
- Date: Tue, 9 Aug 2005 14:40:20 +0200
If you are using EOGenerator, (which
you should), I suggest you add the following to your template files:
/**
The entity name for the current class. **/
public
static final String entityName = "<$name$>";
This allows you to write code like:
EODatabaseDataSource dataSource = new EODatabaseDataSource(ec,
Person.entityName);
Pierre.
Daniel Eggert <email@hidden>
Sent by: webobjects-dev-bounces+pierre.bernard=email@hidden
08/08/2005 11:05 PM
|
To
| WebObjectsDev Development <email@hidden>
|
cc
|
|
Subject
| Entity name from class |
|
Is there any way to programatically get the entity
name from a class?
Let's say I have the class Person, and I want to construct a
EODatabaseDataSource dataSource = new EODatabaseDataSource(ec,
entityName);
How would I go about getting entityName from the Java class Person?
Do I really need to hard code entity names into my code?
/Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden