CINXE.COM
Getting started | Ebean
<!doctype html> <html lang="en"> <head> <title>Getting started | Ebean</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="shortcut icon" href="/images/favicon.ico"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Source+Sans+Pro|Ubuntu&display=swap"> <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/reset3.css"> <link rel="stylesheet" href="/css/site3.css"> <link rel="stylesheet" href="/css/pygments3.css"> </head> <body> <div id="main"> <div id="banner"> <header> <nav id="top"> <h1 id="breadcrumb"> <a class="nav-logo" href="/"><img src="/images/logo-200.png" height="35"></a> <a href="/docs">Documentation</a><span class="sep"> / </span><a href="/docs/getting-started/">Getting started</a><span class="sep"> / </span><span class="last">Eclipse IDE</span> </h1> <ul> <li> <a href="https://github.com/ebean-orm/website-source/blob/master/docs/getting-started/eclipse-ide.html"><i class="fab fa-github"></i> edit page</a> </li> <li><a onclick="toggleTheme();" title="switch dark light theme"><i class="fas fa-adjust"></i></a></li> </ul> </nav> </header> </div> <div class="grid grid-docs"> <aside> <nav class="side"> <ul> <li class="nav0 active"> <a class="active" href="/docs/getting-started">Getting started</a> <ul> <li class="nav1 "> <a href="/docs/getting-started/intellij-idea">IntelliJ</a> </li> <li class="nav1 active"> <a class="active" href="/docs/getting-started/eclipse-ide">Eclipse</a> </li> <li class="nav1 "> <a href="/docs/getting-started/maven">Maven</a> </li> <li class="nav1 "> <a href="/docs/getting-started/gradle">Gradle</a> </li> <li class="nav1 "> <a href="/docs/getting-started/ebean-test">Test setup</a> </li> </ul> </li> <li class="nav0 "> <a href="/docs/intro">Introduction</a> </li> <li class="nav0 "> <a href="/docs">Documentation</a> </li> <li class="nav0 "> <a href="/support">Getting help</a> </li> <li class="nav0 "> <a target="_blank" href="/apidoc/13">API Javadoc</a> </li> <li class="nav0 "> <a href="/videos">Videos</a> </li> <li class="nav0 "> <a href="/docs/upgrading">Upgrading</a> </li> <li class="nav0 "> <a href="/releases">Releases</a> </li> </ul> </nav> </aside> <article> <form action="https://www.google.com/search" method="get" class="inline-form"> <input type="hidden" name="as_sitesearch" value="ebean.io"> <div id="page-search"> <div class="input-group"> <input class="frm" name="q" id="searchinput" type="text" placeholder="Search... (press 's' to focus)" data-placeholder-focus="Search... (use '↑', '↓' and '⏎' to select results)" data-placeholder-blur="Search... (press 's' to focus)" autocomplete="off"> <div class="input-group-btn"> <button class="frm" type="submit"><i class="fas fa-search"></i></button> </div> </div> <div id="page-search-results" style="display: none;"> <ul id="search-results-container" class="search-results"><li class=" active"><a href="/docs" title="Docs"><span style="color:#777;">Docs</span> Documentation </a></li><li class=""><small style="color:#999;">And 101 more...</small></li></ul> </div> </div> </form> <h2 id="eclipse">Eclipse IDE</h2> <p> Ebean uses bytecode enhancement to provide <code>dirty checking</code> and <code>lazy loading</code>. Setup Eclipse to use the Ebean agent to enhance entity beans and transactional methods when we develop and run tests in the IDE. </p> <p> Install the Plugin for IntelliJ IDEA or Eclipse IDE. </p> <h4>Eclipse IDE</h4> <div class="grid g2"> <div> <p> <b>Preferences</b> > <b>Installed JREs</b> </p> <p> Goto the installed JRE's and hit <b>Edit</b> </p> </div> <div> <img src="/images/eclipse-pref-jres.png" width="450"> </div> </div> <p> </p> <p> </p> <div class="grid g2"> <div> <h3>Add -javaagent</h3> <p> Add the ebean-agent as a VM -javaagent argument to the JRE. Use this JRE for your project. </p> </div> <div> <img src="/images/eclipse-jre-agent.png" width="450"> </div> </div> <h2 id="eclipse-maven">Eclipse maven and annotation processing</h2> <p> With Ebean we can use <a href="/docs/query/query-beans">query beans</a> to create strongly typed queries. To do this we use annotation processing to generate the query beans. </p> <p> To get Eclipse IDE to easily use annotation processing we should install the <code>m2e apt</code> plugin and enable it on the project. </p> <div class="grid g2"> <div> <h3>Install m2e-apt plugin</h3> <p> <b>Help</b> > <b>Eclipse Marketplace</b> </p> <p> Install the m2e-apt plugin from the eclipse marketplace. </p> </div> <div> <img src="/images/eclipse-m2e-apt.png" width="450"> </div> </div> <p> </p> <p> </p> <div class="grid g2"> <div> <h3>Enable m2e-apt plugin</h3> <p> <b>Properties</b> > <b>Java Compiler</b> > <b>Annotation processing</b> </p> <p> Enable the m2e-apt plugin on the project. </p> </div> <div> <img src="/images/eclipse-m2e-apt-enable.png" width="450"> </div> </div> <nav class="next"> <p class="next"> <b>Next:</b> <a class="btn btn-info" href="maven">Maven</a> <a class="btn btn-info" href="gradle">Gradle</a> </p> </nav> </article> </div> </div> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="/js/site3.js"></script> <script src="/js/search3.js"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-75181644-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-75181644-1'); </script> </body> </html>