Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Development/DBWS/RestfulComponent/UseCases"
< EclipseLink | Development | DBWS | RestfulComponent
Line 26: | Line 26: | ||
logging.level=info | logging.level=info | ||
</source> | </source> | ||
− | + | If the table name does not match the entity name, the user may specify an alias: | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<source lang="text" enclose="div"> | <source lang="text" enclose="div"> | ||
# project properties | # project properties | ||
alias.employee.tablename=EMP | alias.employee.tablename=EMP | ||
</source> | </source> | ||
− | If the built-in pluralization does not generate acceptible URIs, the user can alias for that as well - e.g. if the entity is <i>person</i>, the plural should be <i>people</i>, not <i>persons</i>: | + | The DBRS utility will login in to the database using the given database credentials and 'scrape' the meta-data for the <tt>employee</tt> table: column names and datatypes, PKs, foreign-key relationships, etc. If the built-in pluralization does not generate acceptible URIs, the user can alias for that as well - e.g. if the entity is <i>person</i>, the plural should be <i>people</i>, not <i>persons</i>: |
<source lang="text" enclose="div"> | <source lang="text" enclose="div"> | ||
# project properties | # project properties | ||
alias.person.plural=people | alias.person.plural=people | ||
</source> | </source> | ||
+ | |||
+ | There are three scenarios to consider: | ||
+ | # (<b>Existing Entities</b>) the database contains the specified entities: the typical scenario where the Project's entities are exposed via a RESTful CRUD application. | ||
+ | # (<b>Greenfield Entities</b>) the database does <b>not</b> contain the specified entities: the so-called <i>greenfield</i> scenario where the Project's entities do not yet exist on the database. | ||
+ | # (<b>Provided Meta-data</b>) meta-data describing the specified entities is provided through an alternative mechanism: the scenario where the Project's entities are described via a JPA <tt>.orm</tt> file. | ||
+ | |||
+ | === Existing Entities === | ||
+ | TBD | ||
=== Greenfield Entities === | === Greenfield Entities === |
Revision as of 10:27, 18 October 2011
DBRS Use Cases
The DBRS utility starts by reading some initial configuration information:
prompt > DBRSBuilder [-builderFile {path to dbrsbuilder.properties}] -stageDir {path to stageDir}
(if command-line arg -builderFile not present, default to look in current working directory)
prompt > DBRSBuilder running, connected to port 8884 ... Press <Return> to finish
dbrsbuilder.properties:
# builder properties
builder.port=8884
#builder.mode=production
builder.mode=test
builder.test.port=8885
# project properties
project.name=projectname
project.entities=employee, other entities ...
# database properties
db.driver=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/db
db.user=user
db.pwd=password
db.platform=org.eclipse.persistence.platform.database.MySQLPlatform
logging.level=info
(if command-line arg -builderFile not present, default to look in current working directory)
prompt > DBRSBuilder running, connected to port 8884 ... Press <Return> to finish
dbrsbuilder.properties:
# builder properties
builder.port=8884
#builder.mode=production
builder.mode=test
builder.test.port=8885
# project properties
project.name=projectname
project.entities=employee, other entities ...
# database properties
db.driver=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/db
db.user=user
db.pwd=password
db.platform=org.eclipse.persistence.platform.database.MySQLPlatform
logging.level=info
If the table name does not match the entity name, the user may specify an alias:
# project properties
alias.employee.tablename=EMP
alias.employee.tablename=EMP
The DBRS utility will login in to the database using the given database credentials and 'scrape' the meta-data for the employee table: column names and datatypes, PKs, foreign-key relationships, etc. If the built-in pluralization does not generate acceptible URIs, the user can alias for that as well - e.g. if the entity is person, the plural should be people, not persons:
# project properties
alias.person.plural=people
alias.person.plural=people
There are three scenarios to consider:
- (Existing Entities) the database contains the specified entities: the typical scenario where the Project's entities are exposed via a RESTful CRUD application.
- (Greenfield Entities) the database does not contain the specified entities: the so-called greenfield scenario where the Project's entities do not yet exist on the database.
- (Provided Meta-data) meta-data describing the specified entities is provided through an alternative mechanism: the scenario where the Project's entities are described via a JPA .orm file.
Existing Entities
TBD
Greenfield Entities
TBD
Provided Meta-data
TBD