[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-2077) "Make this class and its related classes mapped via JPA"

Max Rydahl Andersen (JIRA) jira-events at lists.jboss.org
Mon Oct 6 03:40:20 EDT 2008


    [ https://jira.jboss.org/jira/browse/JBIDE-2077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12432567#action_12432567 ] 

Max Rydahl Andersen commented on JBIDE-2077:
--------------------------------------------

Tried to apply the updated 20081002.zip file

1) even with the .jar file in lib the tests does not pass on windows - have to use File.pathSeperator

2) Why is the code generated different when not having the ejb3-persistence.jar in the tests ? 

3) Why are we creating 2 meg arrays to read few k files ?
    if efficiency is so important why don't we close the streams we open ?
    I fixed it by using normal built in BufferedReader.
   This means the test now runs much faster and is not causing outofmemory errors instantly

4) the .settings folder seem to have no purpose - should not be committed

5) I dont see any tests for the logic around id selection etc. ?

6) why isn't RefEntityInfo an enumeration ?

7) why dont you use a List to show the classes that will be affected ? A text field isn't really easy to read with many classes in it

8) why use the internal compilationunit instead of the public ICompilationUnit ? (Fixed)

9) Why is the action not using the incoming/current selection instead of using the editor selection ?
    Running it via the packageexplorer does not take the selection but takes whatever is in the editor
    even though that is completely unrelated. 

10) Sometimes the context menu does not show the action where as it does show up in the root menu

11) Can't we avoid the extra level of menus and just have a "Generate Hibernate/JPA annotations" menu entry ?








> "Make this class and its related classes mapped via JPA"
> --------------------------------------------------------
>
>                 Key: JBIDE-2077
>                 URL: https://jira.jboss.org/jira/browse/JBIDE-2077
>             Project: Tools (JBoss Tools)
>          Issue Type: Feature Request
>          Components: Hibernate
>            Reporter: Vitali Yemialyanchyk
>            Assignee: Vitali Yemialyanchyk
>            Priority: Minor
>             Fix For: 3.0.0.beta1
>
>         Attachments: JBIDE-2077_20081002.zip
>
>
> Denis Golovin:
> >>>
> Let's imagine I have several (say 10) classes that I'd like to make
> persistent. The classes form completed domain model.
> I decided to use hibernate and JPA annotations, I have lets say JBDS
> 1.1.0 or JBossTools 2.1.0 installed.
> Question is what I should do to make my model persistent? It there
> anything that helps me to do it?
> Now I see only way. I have to go through all classes and add annotations
> for class and for fields.
> >>>
> Max Andersen:
> >>>
> Having a "Make this class and its related classes mapped via JPA" would be 
> an interesting Refactoring to implement.
> Should basically just work like this:
> makePersistent(ITypeRoot clazz, Set processed) {
>   add @Entity 
>   Find most likely id property and add @Id  
>  processed.add(selectedClass);
>  associations = getAssociatedClasses(selectedClass);
>  foreach class in associations {
>   if(!processed.contains(class)) {
>        makePersistent(class, processed);     
>   }  
> }
> }
> There then might be some exceptional cases like handling version properties, temporal values and
> non-JPA supported mappings which Hibernate would be able to understand/map.
> >>>

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

        



More information about the jbosstools-issues mailing list