-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheclipse-apt.html
More file actions
259 lines (230 loc) · 8.66 KB
/
eclipse-apt.html
File metadata and controls
259 lines (230 loc) · 8.66 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<!DOCTYPE html>
<html lang="en">
<head>
<title>Eclipse IDE setup for Ebean ORM Query Bean generation (Java annotation processing / APT)</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv = "refresh" content = "0; url = /docs/getting-started/eclipse-ide" />
<script async defer src="https://buttons.github.io/buttons.js"></script>
<link rel="shortcut icon" href="/images/favicon.ico" >
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<link rel="stylesheet" href="/css/pygments.css" type="text/css" />
<link rel="stylesheet" href="/css/site.css">
</head>
<body>
<div id="wrap">
<div id="header">
<div class="navbar" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".mobile-nav">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img src="/images/lg5-21x100.png" height="35">
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav pull-right nav-btn-rhs">
<li ><a href="/"><span class="fas fa-home"></span> Home</a></li>
<li class="active"><a href="/docs">Docs</a></li>
<li ><a href="/docs/getting-started">Get Started</a></li>
<li ><a href="/support">Help</a></li>
<li ><a href="/videos">Videos</a></li>
<li ><a target="_blank" href="/apidoc/13">ApiDocs</a></li>
<li ><a href="/releases">Releases</a></li>
<li><a target="_blank" href="https://github.com/ebean-orm/ebean"> <i class="fab fa-github"></i></a></li>
</ul>
</div>
<div class="mobile-nav">
<ul class="nav navbar-nav pull-right nav-btn-rhs">
<li ><a href="/"><span class="fas fa-home"></span> Home</a></li>
<li class="active"><a href="/docs">Docs</a></li>
<li ><a href="/docs/getting-started">Get Started</a></li>
<li ><a href="/support">Help</a></li>
<li ><a href="/videos">Videos</a></li>
<li ><a target="_blank" href="/apidoc/13">ApiDocs</a></li>
<li ><a href="/releases">Releases</a></li>
<li><a target="_blank" href="https://github.com/ebean-orm/ebean"> <i class="fab fa-github"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="main">
<div class="jumbotron mini">
<div class="container">
<h1><a href="/docs">Documentation</a> / <a href="/docs/setup">Setup</a> / Eclipse IDE - APT </h1>
</div>
</div>
<div class="container doc-index bs-docs-container">
<div class="row">
<div class="col-md-9" role="main">
<div class="bs-docs-section">
<h1>Redirecting to <a href="/docs/getting-started/eclipse-ide">/docs/getting-started/eclipse-ide</a></h1>
<h2 id="videos">Introduction</h2>
<div class="row">
<div class="col-md-6">
<div class="media ">
<div class="media-left">
<div class="media-left">
<a href="https://youtu.be/_DWxNj-_orA">
<img src="/images/movies-64.png" width="64" height="64" >
</a>
</div>
</div>
<div class="media-body">
<h4 class="media-heading">Installing the enhancement plugin</h4>
This plugin performs both entity bean and query bean enhancement.
</div>
</div>
</div>
<div class="col-md-6">
<div class="media ">
<div class="media-left">
<div class="media-left">
<a href="https://youtu.be/20dvi_oqVus">
<img src="/images/movies-64.png" width="64" height="64" >
</a>
</div>
</div>
<div class="media-body">
<h4 class="media-heading">Eclipse IDE APT</h4>
Query bean generation (Java annotation) with Eclipse IDE
</div>
</div>
</div>
</div>
<p class="mvm">
The Eclipse IDE plugin is installed from: <code>http://ebean.io/eclipse/update</code>
</p>
<h2 id="overview">Overview</h2>
<p>
If you want to use <code>Query beans</code> it is best that they are generated
via <code>Java annotation processing</code>. Ebean provides <code>querybean-generator</code>
which is a java annotation processor that generates query beans.
</p>
<p>
Normally we just need to add the <code>querybean-generator</code> as a maven dependency and
it will all automatically work (with Maven and IntelliJ) but with Eclipse IDE we need some extra
setup in order for it to work.
</p>
<p>
This page documents the extra setup we need for Eclipse IDE such that it becomes aware of the
<code>querybean-generator</code> APT processor and generates query beans for us during development.
</p>
<h2 id="m2e-apt">1. Install m2e apt plugin</h2>
<p>
First install the m2e apt plugin (by Redhat) from the Market place.
</p>
<p>
This plugin allows us to configure Eclipse to find java annotation processors
in the maven classpath (just like Maven and IntelliJ do automatically).
</p>
<img src="/images/eclipse/apt/install-m2e-apt.png" class="img-responsive img-thumbnail">
<h2 id="preferences">2. Preferences / Maven / Annotation processing</h2>
<p>
Goto Preferences / Maven / Annotation processing and select the option.
"Automatically configure JDT APT" is usually a fine default.
</p>
<img src="/images/eclipse/apt/pref-maven-apt.png" class="img-responsive img-thumbnail">
<h2 id="java-compile">3. Project / Java compile / Annotation processing</h2>
<p>
Turn on annotation processing for the project.
</p>
<img src="/images/eclipse/apt/javacompile-apt.png" class="img-responsive img-thumbnail">
<h2 id="factory-path">4. Project / Java compile / Annotation processing / Factory Path</h2>
<p>
Check the <code>Factory Path</code>. It is ok if all entries in the classpath are
selected but what MUST be selected is <code>querybean-generator</code> and additionally
<code>persistence-api</code> and <code>ebean</code> (we need these last 2 as
they contain annotations that querybean-generator is reading as part of it's code generation).
</p>
<img src="/images/eclipse/apt/javacompile-apt-factorypath.png" class="img-responsive img-thumbnail">
</div>
</div>
<div class="col-md-3" role="complementary">
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm">
<ul class="nav bs-docs-sidenav">
<li >
<a href="/docs/setup/enhancement">Enhancement</a>
</li>
<li class="active">
<a href="/docs/setup/eclipse-apt">Eclipse IDE - APT</a>
<ul class="nav">
<li><a href="#overview">Overview</a></li>
<li><a href="#m2e-apt">Install m2e apt</a></li>
<li><a href="#preferences">Preferences</a></li>
<li><a href="#java-compile">Java compile / APT</a></li>
<li><a href="#factory-path">Factory Path</a></li>
</ul>
</li>
<li >
<a href="/docs/setup/logging">Logging</a>
</li>
<li >
<a href="/docs/setup/serverconfig">DatabaseBuilder</a>
</li>
<li >
<a href="/docs/setup/guice">Guice</a>
</li>
<li >
<a href="/docs/setup/spring">Spring</a>
</li>
<li >
<a href="/docs/setup/activerecord">Active Record</a>
</li>
<li >
<a href="/docs/setup/ddl-create-all">DDL - Create All</a>
</li>
<li >
<a href="/docs/setup/dbmigration">DDL - DB Migration</a>
</li>
<li >
<a href="/docs/setup/test-properties"> Test properties</a>
</li>
<li >
<a href="/docs/setup/testing">Testing</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /.row -->
</div> <!-- /.container -->
</div>
</div>
<footer id="footer">
<div class="doc-footer">
<ul class="doc-footer-links">
<li><a href="/">Ebean ORM</a></li>
<li> | </li>
<li><a href="http://avaje-metric.github.io">Metrics</a></li>
</ul>
</div>
</footer>
<script type="text/javascript">
var categoryNames = {};
</script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.easing.min.js"></script>
<script src="/js/jquery.storageapi.min.js"></script>
<script src="/js/ebean-site.js"></script>
<script src="/js/extra.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75181644-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>