geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Kofler" <mario.kof...@gmail.com>
Subject Re: error writing tuple to database "the owning entity is not mapped" geronimo 2.1.1
Date Sun, 06 Jul 2008 09:34:24 GMT
>
> If a person becomes a director, (s)he won't be able to
> resign and become a manager or just a developer?

that's right. for my application it is assumed that if a person is a
director this person is just a director and cannot be an actor in the
same time.

>
> On to your issue...
>
> > so i want to write a Person first, to keep it simple. unfortunately i get an
> > error when i try to perform a write:
>
> Could you show us how Person looks like? And your persistence.xml too.
> I assume you don't use orm.xml or alike, do you? If so, show it too.

so thanks, the persistence.xml we discussed a lot already if i
remember right ;):

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
	     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
	     version="1.0">
  <persistence-unit name="valhalla" transaction-type="JTA">
    <description>videothek</description>
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <class>vt.bean.entity.Person</class>
    <class>vt.bean.entity.Actor</class>
    <class>vt.bean.entity.Director</class>
    <class>vt.bean.entity.Movie</class>
    <class>vt.bean.entity.Dvd</class>

    <properties>

      <property name="openjpa.jdbc.DBDictionary" value="postgres"/>
      <!--property name="openjpa.LockManager" value="pessimistic"/-->	
    </properties>
    <jta-data-source>jdbc/postgres</jta-data-source>
    <non-jta-data-source>jdbc/postgres</non-jta-data-source>
  </persistence-unit>
</persistence>


--------------------------------------------------------
 the Person entity:
--------------------------------------------------------

/*Persistent Entity Person*/
@Entity
@Table(name="person")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="role", discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue("P")
public class Person implements java.io.Serializable
{
    private int id;
    private String name;
    private Calendar birthdate;
    private String origin;

    @Id
    @GeneratedValue
    public int getId()
    {
	return id;
    }

    public void setId(int id)
    {
	this.id = id;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    @Temporal(TemporalType.DATE)
    public Calendar getBirthdate()
    {
        return birthdate;
    }

    public void setBirthdate(Calendar birthdate)
    {
        this.birthdate = birthdate;
    }

    public String getOrigin()
    {
        return origin;
    }

    public void setOrigin(String origin)
    {
        this.origin = origin;
    }

}


and yes i do not use an orm.xml

thanks a lot for helping,

greetings,

mario.

>
> Jacek
>
> --
> Jacek Laskowski
> Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Mime
View raw message