Skip to main content
summaryrefslogtreecommitdiffstats
blob: 63307f226e2e43d6d2ef07ee4b86db28e3953532 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8"?>
<cheatsheet title="Map a Java Persistent Entity">
   <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
      <description>
         This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to map the fields of a JPA entity entity to your database.

To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?). 
To start work working on this cheat sheet, click the &quot;Click to Begin&quot; button below. 

Let&apos;s get started!
      </description>
   </intro>
   <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
      <description>
         Your environment must be set up before you can perform the steps in this cheat sheet. 

Create a database profile and connect to the database.

If you already have (and are connected to) a database connection, you  may skip this step by clicking the &quot;Click to Skip&quot; button.

The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
      </description>
      <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
      </command>
   </item>
   <item title="Create a JPA Project" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
      <description>
         Use the New Project Wizard to create a JPA project. 
Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list. 

Complete each page of the wizard to create a new JPA project.

The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.

If you already have a JPA project, you  may skip this step by clicking the &quot;Click to Skip&quot; button.
      </description>
      <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
      </action>
   </item>
   <item title="Open the JPA Development Perspective" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
      <description>
         When working with JPA  persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the &quot;Click to Skip&quot; button. 
If not, select <b>Window-&gt;Open Perspective-&gt;Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
You can click the &quot;Click to Perform&quot; button to have the &quot;Persistence&quot; perspective opened automatically.
      </description>
      <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.jpt.ui.PersistencePerspective">
      </action>
   </item>
   <item title="Create a Java Class" dialog="false" skip="false">
      <description>
         The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
The Java editor will automatically open showing your new class.
      </description>
   </item>
   <item title="Create a Persistent Entity" dialog="false" skip="false">
      <description>
         Finally we will make the Java class a persistent entity.
In the JPA Structure view select the Java class. 
In the JPA Details view, use the &quot;Map As&quot; field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor. 
Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
      </description>
   </item>
   <item title="Add Fields to the Class" dialog="false" skip="true">
      <description>
         Now you will add some fields to the entity to map to rows in the database table.   

If your persistent entity already has fields to map, you may skip this step by clicking the &quot;Click to Skip&quot; button. If not, use the Java editor to add fields to the entity.
      </description>
      <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
      </action>
   </item>
   <item title="Create the Mapping" dialog="false" skip="false" href="/org.eclipse.dali.doc.user/ref_entity_page.htm">
      <description>
         Now you are ready to map the entity fields to columns in the database table. In the Package Explorer, select the Java class. 

In the JPA Structure view, expand the persistent entity to display the fields. Select a field. 

The JPA Details view displays the information for the field. Use the Map As field to select the Basic mapping. Use the Column field to select a column from the database table.
      </description>
      <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
      </action>
   </item>
   <item title="Finish" dialog="false" skip="false">
      <description>
         Congratulations! You have successfully mapped the fields from a Java persistent entity to a column in a database table.
      </description>
   </item>
</cheatsheet>

Back to the top