Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate getting following error org.hibernate.AnnotationException: No identifier specified for entity: inheritance_tutorial17.TwoWheeler
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


NIRAV J KAMANI
getting following error org.hibernate.AnnotationException: No identifier specified for entity: inheritance_tutorial17.TwoWheeler
0 Answer(s)      a year and 2 months ago
Posted in : Hibernate


when i am running following code i am getting following error...

package inheritance_tutorial17;

import javax.persistence.GeneratedValue; import javax.persistence.Id;

public class Vehicle {

@Id @GeneratedValue
private int id;
private String name;

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;
}

}

package inheritance_tutorial17;

import javax.persistence.Entity;

@Entity public class TwoWheeler extends Vehicle {

private String sterringHandel;

public String getSterringHandel() {
    return sterringHandel;
}

public void setSterringHandel(String sterringHandel) {
    this.sterringHandel = sterringHandel;
}

}

package inheritance_tutorial17;

import javax.persistence.Entity;

@Entity public class FourWheeler extends Vehicle {

private String steeringWheel;

public String getSteeringWheel() {
    return steeringWheel;
}

public void setSteeringWheel(String steeringWheel) {
    this.steeringWheel = steeringWheel;
}

}

package inheritance_tutorial17;

import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration;

public class Test {

/**
 * @param args
 */
public static void main(String[] args) {

    Vehicle vehicle=new Vehicle();
    vehicle.setName("CAR");

    TwoWheeler two=new TwoWheeler();
    two.setName("BIKE");
    two.setSterringHandel("STEERING HADEL");

    FourWheeler four=new FourWheeler();
    four.setName("Porsche");
    four.setSteeringWheel("STEERING WHEEL");

    SessionFactory sessionfactory=new Configuration().configure().buildSessionFactory();
    Session session= sessionfactory.openSession();
    session.beginTransaction();
    session.save(vehicle);
    session.save(two);
    session.save(four);
    session.getTransaction().commit();
    session.close();
}

}


Advertisement
View Answers

Related Tutorials/Questions & Answers:
getting following error org.hibernate.AnnotationException: No identifier specified for entity: inheritance_tutorial17.TwoWheeler
getting following error org.hibernate.AnnotationException: No identifier specified for entity: inheritance_tutorial17.TwoWheeler  when i am running following code i am getting following error... package inheritance_tutorial17
<identifier> expected error
expected error    expected error print(" import java.util.*; public class Person{ Queue<Person> busQ = new LinkedList<Person>(); busQ.addLast(homer); busQ.addLast(marge); busQ.addLast(maggie); busQ.addLast
Advertisements
Java error identifier excepted
an Identifier error as we have not specified the proper type of data type... Java error identifier excepted       Java Error Identifier excepted occurred
identifier not found
identifier not found  Getting compilation error " identifier not found " please explain ?   identifier means variable name,,,,make sure it same as declaration
Getting an error :(
Getting an error :(  I implemented the same code as above.. But getting this error in console... Console Oct 5, 2012 10:18:14 AM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server
Getting error java.lang.ClassNotFoundException: com.mysql.jdbc.Driver.
Getting error java.lang.ClassNotFoundException: com.mysql.jdbc.Driver. ... .when i done database connection then i get an error java.lang.ClassNotFoundException: com.mysql.jdbc.Driver. The following is the code of connection. Please
Getting Error - Development process
Getting Error   Hi , i am getting error while executing this code. I just want to store date in to database. Dont mistake me for repeated questions. java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Number
Listener refused the connectio n with the following error
Listener refused the connectio n with the following error  Hi I am getting the following error while trying to connect oracle database. I... the connection with the following error: ORA-12505, TNS:listener does not currently know
UITableViewcell Identifier
UITableViewcell Identifier  UITableviewcell identifier iPhone what are cell identifier and reuse cell identifier and why we need it?? Thanks
getting an error when set classpath
getting an error when set classpath  Hello Everyone! i have used hssf model for reading excel sheet in my project & i have set classpath... run it, it gives an error "could not find or load main" please help me
specifier and identifier
specifier and identifier  what is the difference between specifier and identifier in java
Java identifier
Java identifier  What is the minimum and maximum length of an identifier
application identifier xcode
application identifier xcode  Hi, can anyone tell me what is the profile doesn't match application identifier error in XCode? Thanks
getting error in your login form code
getting error in your login form code  i tried your code for login form but i am getting an error.the error is undefined index userid...   hi friend, your form's input must have following : <input type
error occured in following page ... how to resolve it?
error occured in following page ... how to resolve it?  // to convert image into thumbnail i used following code. But netbeans has given me following error ....wht i shud do???????? i m java beginner so plz explain in smooth way
Getting connect error in Jmeter - Development process
Getting connect error in Jmeter  Hi, Am trying to run a simple application in Jakarta Jmeter using HTTP request sampler. I am getting the below error. Please help me in viewing the results. Pl specify if there is any possible
data type used to store name.(getting an error)
data type used to store name.(getting an error)    Statement stm=con.createStatement(); String query="select * from employee where ename... getting an error like dis: "ename cannot be resolved to a variable" whats
Still getting the http 404 error - Java Beginners
Still getting the http 404 error  Dear experts, I refer... is userid? Anyway, whatever I do, I still receive the http 404 error...saying... the following code: Login ID: Password: servlet-mapping
getting error while inserting values in database
getting error while inserting values in database  AddUser.java..."); if (envContext == null)throw new Exception("Error: No Context"); if (ds == null) throw new Exception("Error: No DataSource
why i'm getting this error?The import javax.servlet.http cannot be resolved
why i'm getting this error?The import javax.servlet.http cannot... getting this error, why i'm getting this error and how to solve this error., Have... for this is following link : ** http://tech.amikelive.com/node-269/eclipse
Im getting this error while running JPA project
Im getting this error while running JPA project  Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: examplePersistenceUnit] Unable to configure EntityManagerFactory
Getting File path error - JSP-Servlet
Getting File path error  I have a requirement where i need to get certain properties on application login page start itself. I an currently using String str = request.getRealPath("/")+"a" + System.getProperty( "file.separator
Getting HTTP 404 error in Spring web MVC with Hibernate Integration
Getting HTTP 404 error in Spring web MVC with Hibernate Integration   Hi, i am Getting HTTP 404 error in Spring web MVC with Hibernate Integration...;Please visit the following links: http://www.roseindia.net/struts/hibernate-spring
i am getting an error in adding a menu item to a menu.
i am getting an error in adding a menu item to a menu.   i am not able to execute the menu program. i am getting an error at menu.add(menuitem); it says add method is undefined for type menu. but as far as i know that is only way
error for getting the data from an api using br.readLine - Development process
error for getting the data from an api using br.readLine  hi the application is hanging while reading the data using readLine() function . actually the data is coming from remote using particular api call see the following code
profile doesn't match application identifier
profile doesn't match application identifier  profile doesn't match application identifier
Itried all possible ways still getting thesame error
Itried all possible ways still getting thesame error  java.sql.SQLException: Io exception: Got minus one from a read call at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112
when sending the mail from java I am getting the below error - JavaMail
when sending the mail from java I am getting the below error   when sending the mail from java I am getting the below error : Exception...)); // Add the given addresses to the specified recipient type
I am getting error org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'IS_AUTHENTICATED_ANONYMOUSLY' is defined - Spring
I am getting error... am getting error... the solution after lot of research.I wrongly added the following code/secured
Java - Identifier and primitive datatype in java
Java - Identifier and Primitive Data Types in java  ... is identifier and primitive data types of a identifier. This tutorials will teach you how to use these identifier in you  java programming. Identifier
I'm getting an illgal start of expression error in my code for the public static boolean portion at the bottom... any ideas?
I'm getting an illgal start of expression error in my code for the public static boolean portion at the bottom... any ideas?  heres my code import java.util.Scanner; import java.util.Random; public class numberGame
 

 

 

DMCA.com