[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3155) Getter method metadata to support load()/getReference() proxies on field based id

Emmanuel Bernard (JIRA) noreply at atlassian.com
Wed Mar 5 16:09:33 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29697 ] 

Emmanuel Bernard commented on HHH-3155:
---------------------------------------

yes that's a good idea. It has nothing to do with immutable though.

> Getter method metadata to support load()/getReference() proxies on field based id
> ---------------------------------------------------------------------------------
>
>                 Key: HHH-3155
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3155
>             Project: Hibernate3
>          Issue Type: Improvement
>            Reporter: Bob Tiernay
>
> Currently, the best reason to go with Property mapping in Hibernate performance: If you often loop through collections and only read the id of the entities Hibernate doesn't need to fetch the entities from the database if you use property access type. This is because Hibernate knows getId() only returns the id it already has, but Hibernate has no clue what your getId() method returns if you have marked @Id Long id; 
> Well, what I propose is giving Hibernate a clue, thus opening up the possibility that field based @Id can produce proxies. Perhaps all that is needed is something like this:
> @Id
> Long id;
> @Immutable
> Long getId(){return this.id};
> This way we can convey to Hibernate that getId() has no side effects.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list