Note that there are some explanatory texts on larger screens.

plurals
  1. POstoring textarea content in ebean database
    text
    copied!<p>I think the question might be a bit stupid - I am working on my first Play project and thus I am still in train to try to gain an overview over the software ;) </p> <p>Well, I have a page containing a textarea. A user should be able to enter text there and store it permanently in the standard ebean database. But storing never works and I can't find out the reason!</p> <p>This is the class definition for the database object:</p> <pre><code>public class Entry extends Model { @Required public String text; public String studentName; @Id public long id; public static Finder&lt;Long, Entry&gt; finder = new Finder&lt;Long, Entry&gt;( Long.class, Entry.class); public static Entry getMe(Long id) { return finder.byId(id); } public static void saveMe(Entry toDataBase) { toDataBase.save(); } // .... } </code></pre> <p>Here is the text area:</p> <pre><code>@(entryForm: Form[Entry]) @import helper._ @main("xy") { &lt;h1&gt;report for @entryForm("studentName")&lt;/h1&gt; @form(routes.Application.storeReport()) { @textarea(entryForm("report:")) &lt;input type="submit" value="Store Report"&gt; } } </code></pre> <p>In the <code>Application.storeReport()</code> method entryForm.bindFromRequest().hasErrors() is always true..</p> <p>and changing <code>@textarea(entryForm("report:"))</code> to <code>@textarea(entryForm("text"))</code> (..to tell the thing, which of the 3 Entry fields I actually want to fill) even causes a PersistenceException: </p> <blockquote> <p>"the type [class models.Entry] is not a registered entity? If you don't explicitly list the entity classes to use Ebean will search for them in the classpath. If the entity is in a Jar check the ebean.search.jars property in ebean.properties file or check ServerConfig.addJar().]"</p> </blockquote> <p>Orienting on the <a href="http://www.playframework.org/documentation/2.0.2/JavaTodoList" rel="nofollow">ToDoList example</a> I can't detect how I could register an entitly else than letting it extend the play.db.ebean.Model!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload