Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » problems using metamodel generator in Eclipse
problems using metamodel generator in Eclipse [message #646732] Thu, 30 December 2010 16:09 Go to next message
Martin Geisse is currently offline Martin GeisseFriend
Messages: 24
Registered: July 2009
Junior Member

I am trying to get the EclipseLink metamodel generator working from within Eclipse. To do this, I have enabled annotation processing in the Java compiler options and added the following JARs:

- eclipselink-jpa-modelgen_2.1.2.v20101206-r8635.jar
- javax.persistence_2.0.1.v201006031150.jar
- eclipselink.jar

Eclipse generates a folder for the generated source code in the project folder (called "generated" -- I changed this from the default) but no classes inside that folder.

Thanks in advance for any help.

Code for the entity class:
 * Copyright (c) 2010 Martin Geisse
 * This file is distributed under the terms of the MIT license.

package name.martingeisse.leckermittag.experiment;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

 * A simple test entity for EclipseLink experiments.
public class Todo {

	 * the id
	private Long id;

	 * the summary
	private String summary;

	 * the description
	private String description;

	 * Constructor.
	public Todo() {

	 * Getter method for the id.
	 * @return the id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;

	 * Setter method for the id.
	 * @param id the id to set
	public void setId(Long id) { = id;

	 * Getter method for the summary.
	 * @return the summary
	public String getSummary() {
		return summary;

	 * Setter method for the summary.
	 * @param summary the summary to set
	public void setSummary(String summary) {
		this.summary = summary;

	 * Getter method for the description.
	 * @return the description
	public String getDescription() {
		return description;

	 * Setter method for the description.
	 * @param description the description to set
	public void setDescription(String description) {
		this.description = description;

	public String toString() {
		return "Todo [summary=" + summary + ", description=" + description + "]";


<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="" xsi:schemaLocation="" version="2.0" xmlns="">
	<persistence-unit name="todos" transaction-type="RESOURCE_LOCAL">
			<!-- <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" /> -->
			<!-- <property name="javax.persistence.jdbc.url" value="jdbc:derby:/home/vogella/databases/simpleDb;create=true" /> -->
			<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost/leckerMittag" />
			<property name="javax.persistence.jdbc.user" value="postgres" />
			<property name="javax.persistence.jdbc.password" value="postgres" />

			<!-- EclipseLink should create the database schema automatically -->
			<!-- <property name="eclipselink.ddl-generation" value="create-tables" /> -->
			<!-- <property name="eclipselink.ddl-generation.output-mode" value="database" /> -->


<?xml version="1.0" encoding="UTF-8" ?>
<entity-mappings version="1.0"
	xsi:schemaLocation=" orm_1_0.xsd">

	<description>description here</description>
			<delimited-identifiers />

Re: problems using metamodel generator in Eclipse [message #646737 is a reply to message #646732] Thu, 30 December 2010 16:47 Go to previous messageGo to next message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 475
Registered: July 2009
Senior Member
One thing you could try as an alternative would be the metamodel generation capabilities available in Dali Java Persistence Tools. These tools are integrated directly into Eclipse and do not require additional compiler configuration.

See the section called "JPA 2.0 Canonical Metamodel Generation" at the link below for more info. thy/jpa.php

Dali is available via the Helios Software Site and is a part of the Web Tools project. It is included in the Helios Java EE package.

For more info on Dali -

Re: problems using metamodel generator in Eclipse [message #646765 is a reply to message #646737] Thu, 30 December 2010 19:42 Go to previous message
Martin Geisse is currently offline Martin GeisseFriend
Messages: 24
Registered: July 2009
Junior Member
That works. Thank you!
Previous Topic:ClassNotFoundException on create of TypedQuery
Next Topic:Using OneToMany or ManyToOne . A Performance issue
Goto Forum:

Current Time: Fri Jun 22 15:35:28 GMT 2018

Powered by FUDForum. Page generated in 0.01315 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top