This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 300398 - Add "get(String, Class)" method to DynamicEntity
Summary: Add "get(String, Class)" method to DynamicEntity
Status: ASSIGNED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: dynamic
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-21 11:25 EST by Blaise Doughan CLA
Modified: 2022-06-09 10:03 EDT (History)
1 user (show)

See Also:


Attachments
add public conversion API to get(); internally, set platform (15.01 KB, patch)
2010-06-21 16:06 EDT, Mike Norman CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Blaise Doughan CLA 2010-01-21 11:25:10 EST
Proposal:

Add the following API to DynamicEntity:

  /**
   * Converts the value of the property identified by the specified property name
   * to the provided target class.
   * @param targetClass if the conversion is supported, the property value will 
   * be converted to this class.
   * @param propertyName the path to a valid object and property.
   * @return the converted value of the specified property.
   * @see #get(String)
   */
  <T> T get(Class<T> targetClass, String propertyName);

Rationale:

Allow users easy access to the form in which they get data.  One common usage is the ability to get all data back in String format (useful when dealing with XML).
Comment 1 Mike Norman CLA 2010-02-23 13:11:50 EST
Should be:
   <T> T get(String propertyName, Class<T> targetClass);
Comment 2 Mike Norman CLA 2010-06-21 16:06:44 EDT
Created attachment 172363 [details]
add public conversion API to get(); internally, set platform
Comment 3 Mike Norman CLA 2010-06-21 16:09:55 EDT
attach'd patch also fixes problem with JPADynamicEntity's: need to set 'check-
database' for existence checking same as JPA metadata processor does
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:03:20 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink