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;

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

}

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
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
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
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
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 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
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
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
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
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
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: ADS_TO_REPLACE_1
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 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
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
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
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
error getting repository data for epel repository not found centos 7
error getting repository data for epel repository not found centos 7  ... because of the error: error getting repository data for epel repository not found My os is centos 7. How to resolve this? Thanks   Hi, This error
error getting repository data for epel repository not found centos 7
error getting repository data for epel repository not found centos 7  ... because of the error: error getting repository data for epel repository not found My os is centos 7. How to resolve this? Thanks   Hi, This error
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: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Error: Timeout - Async callback was not invoked within timeout specified... and due to timeout its throwing: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULTTIMEOUTINTERVAL. How to resolve
UITableViewcell Identifier
UITableViewcell Identifier  UITableviewcell identifier iPhone what are cell identifier and reuse cell identifier and why we need it?? Thanks! (adsbygoogle = window.adsbygoogle || []).push
ModuleNotFoundError: No module named 'framework-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'framework-identifier' error? Thanks   Hi... framework-identifier python with following command: pip install framework
ModuleNotFoundError: No module named 'symbol_identifier'
Python program is throwing following error: ModuleNotFoundError: No module... named 'symbol_identifier' error? Thanks   Hi, In your..._identifier python with following command: pip install symbol_identifier
ModuleNotFoundError: No module named 'tense-identifier'
Python program is throwing following error: ModuleNotFoundError: No module... named 'tense-identifier' error? Thanks   Hi, In your...-identifier python with following command: pip install tense-identifier After
ModuleNotFoundError: No module named 'card-identifier'
Python program is throwing following error: ModuleNotFoundError: No module... 'card-identifier' error? Thanks   Hi, In your python... python with following command: pip install card-identifier After
ModuleNotFoundError: No module named 'framework-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'framework-identifier' error? Thanks   Hi... framework-identifier python with following command: pip install framework
ModuleNotFoundError: No module named 'number-identifier'
Python program is throwing following error: ModuleNotFoundError: No module... named 'number-identifier' error? Thanks   Hi, In your...-identifier python with following command: pip install number-identifier
ModuleNotFoundError: No module named 'symbol_identifier'
Python program is throwing following error: ModuleNotFoundError: No module... named 'symbol_identifier' error? Thanks   Hi, In your..._identifier python with following command: pip install symbol_identifier
ModuleNotFoundError: No module named 'tense-identifier'
Python program is throwing following error: ModuleNotFoundError: No module... named 'tense-identifier' error? Thanks   Hi, In your...-identifier python with following command: pip install tense-identifier After
ModuleNotFoundError: No module named 'card-identifier'
Python program is throwing following error: ModuleNotFoundError: No module... 'card-identifier' error? Thanks   Hi, In your python... python with following command: pip install card-identifier After
ModuleNotFoundError: No module named 'edc-identifier'
Python program is throwing following error: ModuleNotFoundError: No module... 'edc-identifier' error? Thanks   Hi, In your python... python with following command: pip install edc-identifier After
ModuleNotFoundError: No module named 'framework-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'framework-identifier' error? Thanks   Hi... framework-identifier python with following command: pip install framework
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
Java identifier
Java identifier  What is the minimum and maximum length of an identifier
specifier and identifier
specifier and identifier  what is the difference between specifier and identifier in java
application identifier xcode
application identifier xcode  Hi, can anyone tell me what is the profile doesn't match application identifier error in XCode? Thanks
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
ModuleNotFoundError: No module named 'payment-card-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'payment-card-identifier' error? Thanks   ... install payment-card-identifier python with following command: pip install
ModuleNotFoundError: No module named 'fake-email-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'fake-email-identifier' error? Thanks   Hi... install fake-email-identifier python with following command: pip install fake
ModuleNotFoundError: No module named 'gs2-python-sdk-identifier'
, My Python program is throwing following error: ModuleNotFoundError... the ModuleNotFoundError: No module named 'gs2-python-sdk-identifier' error? Thanks  .... You can install gs2-python-sdk-identifier python with following command: pip
ModuleNotFoundError: No module named 'mastercard-merchant-identifier'
; Hi, My Python program is throwing following error: ModuleNotFoundError... the ModuleNotFoundError: No module named 'mastercard-merchant-identifier' error... with following command: pip install mastercard-merchant-identifier After
ModuleNotFoundError: No module named 'mastercard-product-identifier'
;Hi, My Python program is throwing following error: ModuleNotFoundError... the ModuleNotFoundError: No module named 'mastercard-product-identifier' error... library. You can install mastercard-product-identifier python with following
ModuleNotFoundError: No module named 'payment-card-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'payment-card-identifier' error? Thanks   ... install payment-card-identifier python with following command: pip install
ModuleNotFoundError: No module named 'payment-card-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'payment-card-identifier' error? Thanks   ... install payment-card-identifier python with following command: pip install
ModuleNotFoundError: No module named 'payment-card-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'payment-card-identifier' error? Thanks   ... install payment-card-identifier python with following command: pip install
ModuleNotFoundError: No module named 'dataframe-column-identifier'
;Hi, My Python program is throwing following error: ModuleNotFoundError... the ModuleNotFoundError: No module named 'dataframe-column-identifier' error? Thanks.... You can install dataframe-column-identifier python with following command
ModuleNotFoundError: No module named 'fake-email-identifier'
, My Python program is throwing following error: ModuleNotFoundError...: No module named 'fake-email-identifier' error? Thanks   Hi... install fake-email-identifier python with following command: pip install fake

Ads