This question already has answers here:
Eclipselink with MongoDB java.lang.ClassCastException
(3 answers)
Closed 7 years ago.
I'm getting stuck in configuring JPA for Mongodb.
Here is my stack exception :
[EL Config]: connection: 2014-03-31 10:48:24.171--ServerSession(1883377923)--Connection(1001688235)--Thread(Thread[main,5,smarttrade])--disconnect
[EL Severe]: ejb: 2014-03-31 10:48:24.181--ServerSession(1883377923)--Thread(Thread[main,5,smarttrade])--java.lang.ClassCastException: org.eclipse.persistence.nosql.adapters.mongo.MongoPlatform cannot be cast to org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
at org.eclipse.persistence.sequencing.TableSequence.onConnect(TableSequence.java:168)
at org.eclipse.persistence.sequencing.Sequence.onConnect(Sequence.java:270)
at org.eclipse.persistence.internal.sequencing.SequencingManager.onConnectSequences(SequencingManager.java:927)
at org.eclipse.persistence.internal.sequencing.SequencingManager.onConnectInternal(SequencingManager.java:747)
at org.eclipse.persistence.internal.sequencing.SequencingManager.onConnect(SequencingManager.java:700)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeSequencing(DatabaseSessionImpl.java:282)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:636)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:632)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:568)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:799)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:756)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:241)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:304)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:336)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:302)
at com.smarttrade.tick.engine.TickEngine.start(TickEngine.java:287)
My persistence.xml is defined as follow :
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="mongo" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.smarttrade.tick.jpa.Instrument</class>
<class>com.smarttrade.tick.jpa.Snapshot</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-database"
value="org.eclipse.persistence.nosql.adapters.mongo.MongoPlatform" />
<property name="eclipselink.nosql.connection-spec"
value="org.eclipse.persistence.nosql.adapters.mongo.MongoConnectionSpec" />
<property name="eclipselink.nosql.property.mongo.port" value="27017" />
<property name="eclipselink.nosql.property.mongo.host" value="localhost" />
<property name="eclipselink.nosql.property.mongo.db" value="mydb" />
<property name="eclipselink.logging.level" value="FINEST" />
</properties>
</persistence-unit>
</persistence>
I have two entity classes :
#Entity
#NoSql(dataFormat = DataFormatType.MAPPED)
public class Instrument {
#Id
String securityID = null;
#OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH })
Set<Snapshot> snapshots = new HashSet<Snapshot>();
// constructor, getters and setters
...
}
and
#Entity
#Inheritance(strategy = InheritanceType.JOINED)
#NoSql(dataFormat = DataFormatType.MAPPED)
public class Snapshot {
#Id
#GeneratedValue(strategy = GenerationType.TABLE)
double id;
#Temporal(TemporalType.TIMESTAMP)
Date snapshotTs;
String bestOfferOwn;
.. // other fields
// constructor, getters and setters
...
}
And here it's how I call it :
EntityManagerFactory factory = Persistence.createEntityManagerFactory("mongo");
EntityManager em = factory.createEntityManager();
em.getTransaction().begin();
Instrument i = new Instrument("JAP_USDEUR");
Snapshot s = new Snapshot(new Date(), "LP_one", 20000, 3.1, new Date(), "LP_two", 10000, 3.0, new Date());
Snapshot s2 = new Snapshot(new Date(), "LP_rg", 500, 4.9, new Date(), "LP_zet", 6000, 5.1, new Date());
i.getSnapshots().add(s);
i.getSnapshots().add(s2);
em.persist(i);
em.getTransaction().commit();
em.close();
The factory is created, and then it seems that that EntityManager make the connection, but after I have this cast exception. I found a post about it (Eclipselink with MongoDB java.lang.ClassCastException)but I had already added the classes in my persistence.xml.
Like I'm really a newbie in jpa I might have set something wrong, but I can't find out what.
I finally find out where was my problem. I used a GenerationType.TABLE for my Snaphot's Id generation strategy, but this is not supported in nosql.
I just changed :
#Id
#GeneratedValue(strategy = GenerationType.TABLE)
double id;
to
#Id
#GeneratedValue
double id;
and it worked
Related
I'm developing a web app and deploying it on Tomcat 7.0. My app uses a MySQL database. I've already configured connection between app and database and wanted to add Hibernate 5.2.5 support. I can communicate with database via Hibernate console with configuration below, and it works when I use it in non-web app. The problem is only when I deploy it on server. I get warning
no persistent classes found for query class: from entities.UserH
and then 500 server error caused by it.
My entity class:
#Entity
#Table(name = "users", uniqueConstraints = {#UniqueConstraint(columnNames = {"id"})})
public class UserH {
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
#Column(name = "id", nullable = false, unique = true, length = 11)
private int id;
#Column(name = "login", nullable = false, length = 45)
private String login;
#Column(name = "name", nullable = false, length = 45)
private String name;
#Column(name = "surname", nullable = false, length = 45)
private String surname;
/* getters and setters*/
}
My hibernate-annotation.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection properties - Driver, URL, user, password -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/web-database</property>
<property name="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>
<!-- org.hibernate.HibernateException: No CurrentSessionContext configured! -->
<property name="hibernate.current_session_context_class">thread</property>
<!-- Mapping with model class containing annotations -->
<mapping class="entities.UserH"/>
</session-factory>
</hibernate-configuration>
Method that should get users:
public List<UserH> getAllUsers() {
try (Session session = HibernateUtils.getSessionAnnotationFactory().getCurrentSession()) {
session.beginTransaction();
Query<UserH> usersQuery = session.createQuery("from entities.UserH", UserH.class);
List<UserH> usersList = usersQuery.getResultList();
session.getTransaction().commit();
return usersList;
}
}
As I mentioned - it works ok with normal app, but not with Tomcat. I added all available elements to web artifacts, but it didn't help. I even tried to add JPA support with persistance.xml, but still with no luck.
What else could be the problem?
edit: My HibernateUtils class:
public class HibernateUtils {
private static SessionFactory sessionAnnotationFactory;
private static SessionFactory buildSessionAnnotationFactory() {
try {
// Create the SessionFactory from hibernate.cfg.xml
Configuration configuration = new Configuration();
configuration.configure("hibernate-annotation.cfg.xml");
System.out.println("Hibernate Annotation Configuration loaded");
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
System.out.println("Hibernate Annotation serviceRegistry created");
SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
return sessionFactory;
} catch (Throwable ex) {
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionAnnotationFactory() {
if (sessionAnnotationFactory == null)
sessionAnnotationFactory = buildSessionAnnotationFactory();
return sessionAnnotationFactory;
}
}
Maybe this is not a proper answer fot my question, but this is what actually worked for me. I replaced hibernate with JPA configuration + hibernate.
So instead of using hibernate-annotation.cfg.xml + Session I used persistance.xml + EntityManager:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="NewPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>entities.UserH</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/web-database"/>
<property name="javax.persistence.jdbc.user" value="Admin"/>
<property name="javax.persistence.jdbc.password" value="password2#"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties>
</persistence-unit>
</persistence>
getEntityManager:
public static EntityManager getEntityManager() {
EntityManager entityManager = Persistence
.createEntityManagerFactory("NewPersistenceUnit")
.createEntityManager();
return entityManager;
}
getAllUsers:
public List<UserH> getAllUsers() {
EntityManager entityManager = HibernateUtils.getEntityManager();
EntityTransaction transaction = entityManager.getTransaction();
transaction.begin();
TypedQuery<UserH> usersQuery = entityManager.createQuery("from UserH ", UserH.class);
List<UserH> usersList = usersQuery.getResultList();
transaction.commit();
entityManager.close();
return usersList;
}
However, I still don't understand why this configurations works while hibernate alone didn't. Any comments/suggestions would be appreciated.
You should just change your query to reference only the class name:
session.createQuery( "FROM UserH", UserH.class )
The only time the package is important would be when you're defining entities as inner classes.
For those cases, you'd need to use the full class name, com.c.SomeOutterClass$MyEntity. Another alternative is to change the #Entity annotation so that it includes the name attribute so you explicitly name your entity class:
public class SomeOutterClass {
#Entity(name = "MyEntity")
public static class MyEntity {
}
}
I'm trying to get all the objects from my table but I don't understand why i get this error ... : org.hibernate.hql.internal.ast.QuerySyntaxException: calamartest.personne is not mapped
I can insert without a problem but query doesn't work.
My code :
List<Personne> listPersonne;
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("testhibernate0");
EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.getTransaction().begin();
listPersonne = entityManager.createQuery("from calamartest.personne", Personne.class).getResultList();
entityManager.getTransaction().commit();
entityManager.close();
My classes :
#Entity
#Table( name = "calamartest.personne")
public class Personne {
#Id
#GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "personne_seq_gen")
#SequenceGenerator(name = "personne_seq_gen", sequenceName = "calamartest.personne_id_seq",initialValue = 1, allocationSize = 1)
private int id ;
private String nom ;
#OneToMany(mappedBy="personne", cascade = CascadeType.PERSIST, fetch = FetchType.EAGER)
private List<Maison> listMaison;
[...]
}
#Entity
#Table( name = "calamartest.maison")
public class Maison {
#Id
#GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "maison_seq_gen")
#SequenceGenerator(name = "maison_seq_gen", sequenceName = "calamartest.maison_id_seq",initialValue = 1, allocationSize = 1)
private int id;
#ManyToOne
private Personne personne;
private String adresse;
[...]
}
My persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 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 http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="testhibernate0" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>bean.Personne</class>
<class>bean.Maison</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.id.new_generator_mappings" value="false"/>
[...]
</properties>
</persistence-unit>
</persistence>
Thx for your help ! :)
Solution
So my problem was in my query : i was calling the postgres tab {myschema}.{mytab}
listPersonne = entityManager.createQuery("from calamartest.personne", Personne.class).getResultList();
Instead of calling my class name :
listPersonne = entityManager.createQuery("from Personne", Personne.class).getResultList();
The error comes from your query : from calamartest.personne. There is no class personne but Personne exists.
One more thing, make sure the entities are under the correct package. In your code, you are making a request to from calamartest.Personne while in the persistence.xml, class Personne is under the bean package.
i'm trying to make a simple multitenant example to run, using Eclipselink 2.5.2, and MySQL.
When trying to persist an entity asigned to a tenant id, mysql server throws an error: "Table 'jpatest.tenant1_userdata' doesn't exist". (userdata being the entity, jpatest the database name, and tenant1 the tenant-id)
The table indeed doesn't exist, the database jpatest do exist. I was expecting eclipselink to autogenerate the tables each time i try to persist with a new tenant id.
So the question would be:
How can i force Eclipselink to create the tables?
If that is not possible; How can i create tables at runtime?
Here's the code:
Entity:
#Entity
#Table(name = "userdata")
#Multitenant(value = MultitenantType.TABLE_PER_TENANT)
#TenantTableDiscriminator(type = TenantTableDiscriminatorType.PREFIX, contextProperty = "tenant-id")
public class UserData implements Serializable {
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private static final long serialVersionUID = 1L;
private String name;
.
.
.
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="MultiTeanantTest" transaction-type="RESOURCE_LOCAL">
<class>UserData</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/jpatest" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="" />
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="javax.persistence.schema-generation.create-database-schemas" value="true"/>
<property name="eclipselink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
</persistence>
Main class:
public class Main {
public static void main(String[] args) {
UserData ud = new UserData();
ud.setNombre("John);
Map properties = new HashMap<>();
properties.put("tenant-id", "tenant1");
EntityManagerFactory emf = Persistence.createEntityManagerFactory("MultiTeanantTest", properties );
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(ud);
em.getTransaction().commit();
}
}
Hope someone can give me a tip in what i'm doing wrong.
DDL generation will not be supported in a Multitenant Scenario by Eclipselink.
Refer to this link for more information, https://wiki.eclipse.org/EclipseLink/DesignDocs/Multi-Tenancy/TablePerTenant
I'm using Hibernate 4.3.6 and Glassfish 4.0 for my ejb project.
My test Dao class :
#PersistenceContext
private EntityManager entityManager;
public void saveTest(){
Foo testFoo = new Foo();
testFoo.setSomething("test");
entityManager.persist(testFoo);
entityManager.flush();
}
and POJO class Foo.class:
#Entity
#Table(name = "FOO")
public class Foo implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String something;
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
#Column(name = "T_ID", unique = true, nullable = false, precision = 15, scale = 0)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
#Column(name = "T_SOMETHING", length = 50)
public String getSomething() {
return something;
}
public void setSomething(String something) {
this.adi = something;
}
}
persistence.xml :
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1">
<persistence-unit name="TestAppUnit" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/TestApp</jta-data-source>
<class>com.example.test.Foo</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9iDialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
I can list table data, get data with query and i can remove data from table. But i can't persist or merge.
Exception is:
IllegalArgumentException occurred calling getter of com.example.test.Foo.id
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:192)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:346)
at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:4746)
at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:4465)
at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:243)
at org.hibernate.event.internal.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:511)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:100)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:684)
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:676)
at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:671)
....
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:169)
Where am I doing wrong?
This project working on Glassfish 3.1 with persistence.xml version 1.0(jpa) and without this line :
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.SunOneJtaPlatform" />
Thanks in advance
I found it. Maybe others they encounter this problem. I wanted to share the solution.
The problem caused from Hibernate and "#PersistenceContext" annotation.
I change to Hibernate version to 4.3.5 and problem solved. Hibernate 4.3.6 and 4.3.7 has same problem. It's caused by different classloaders. Ejb Classloader and web app Classloader is different.
I'm having trouble handling IDs of my databse tables using OpenJPA and HSQLdb. I created an Abstract class where I handle annotations and stuff to remap into the DB:
// Property accessors
#Id
#Column(name = "IDTESTOBJEKT", unique = true, nullable = false)
public Integer getIdtestobjekt() {
return this.idtestobjekt;
}
public void setIdtestobjekt(Integer idtestobjekt) {
this.idtestobjekt = idtestobjekt;
}
It's as a Facade used to create Testobjekts.
Testobjekt test_obj = new Testobjekt();
test_obj.setEigentuemerin("helge");
// test_obj.setIdtestobjekt(1);
EntityManagerHelper.beginTransaction();
TestobjektDAO test_dao = new TestobjektDAO();
test_dao.save(test_obj);
EntityManagerHelper.commit();
List<Testobjekt> foo;
foo = test_dao.findByEigentuemerin("helge");
Testobjekt from_db = foo.get(0);
System.out.println(from_db.getEigentuemerin());
Nevertheless what I set ... 1, nothing... I get errors.
Like:
Field "model_layer.AbstractTestobjekt.idtestobjekt" of "model_layer.Testobjekt#3209fa8f" can not be set to "null" value.
I want the ORM layer to handle that ID stuff without bothering me. My experience with Hibernate is that is handles that stuff quite well... but OpenJPA seems to be cumbersome here. I assume my annotations are wrong or something but I'm having trouble tracking this multi-layered issue down.
I configured OpenJPA in the persistence.xml:
<persistence-unit name="HSQLdb_mvn_openJPA_autoTablesPU"
transaction-type="RESOURCE_LOCAL">
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<class>model_layer.Testobjekt</class>
<class>model_layer.AbstractTestobjekt</class>
<properties>
<property name="openjpa.ConnectionDriverName"
value="org.hsqldb.jdbc.JDBCDriver" />
<property name="openjpa.ConnectionURL"
value="jdbc:hsqldb:hsql://localhost:9001/mydb" />
<property name="openjpa.ConnectionUserName" value="SA" />
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)" />
</properties>
</persistence-unit>
How do I handle an automated ID strategy with OpenJPA?
Thanks,
wishi
How do I handle an automated ID strategy with OpenJPA?
Use the #GeneratedValue annotation (and I suggest using the default GenerationType.AUTO strategy which indicates that the persistence provider should pick an appropriate strategy for the particular database):
#Id
#GeneratedValue
#Column(name = "IDTESTOBJEKT", unique = true, nullable = false)
public Integer getIdtestobjekt() {
return this.idtestobjekt;
}