METAGEN-67 Updating testcase - mapped super class does now not contain an id

This commit is contained in:
Hardy Ferentschik 2012-01-17 11:55:46 +01:00 committed by Strong Liu
parent 170d2c9bff
commit 8d1a767b35
4 changed files with 8 additions and 15 deletions

View File

@ -14,15 +14,16 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.hibernate.jpamodelgen.test.manytoone; package org.hibernate.jpamodelgen.test.manytoone;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id;
/** /**
* @author Hardy Ferentschik * @author Hardy Ferentschik
*/ */
@Entity @Entity
public class ConcreteProduct extends Product { public class ConcreteProduct extends Product {
@Id
long id;
} }

View File

@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.hibernate.jpamodelgen.test.manytoone; package org.hibernate.jpamodelgen.test.manytoone;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -34,7 +32,7 @@ public class MappedSuperclassManyToOneTest extends CompilationTest {
assertMetamodelClassGeneratedFor( ConcreteProduct.class ); assertMetamodelClassGeneratedFor( ConcreteProduct.class );
assertMetamodelClassGeneratedFor( Product.class ); assertMetamodelClassGeneratedFor( Product.class );
assertMetamodelClassGeneratedFor( Shop.class ); assertMetamodelClassGeneratedFor( Shop.class );
assertPresenceOfFieldInMetamodelFor( Product.class, "shop", "The many to one attribute shop shop is missing" ); assertPresenceOfFieldInMetamodelFor( Product.class, "shop", "The many to one attribute shop is missing" );
} }
@Override @Override

View File

@ -14,12 +14,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.hibernate.jpamodelgen.test.manytoone; package org.hibernate.jpamodelgen.test.manytoone;
import javax.persistence.Entity; import javax.persistence.Access;
import javax.persistence.Id; import javax.persistence.AccessType;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass; import javax.persistence.MappedSuperclass;
@ -30,9 +28,7 @@ import org.hibernate.jpamodelgen.test.accesstype.Shop;
*/ */
@MappedSuperclass @MappedSuperclass
public class Product { public class Product {
@Id @Access(AccessType.FIELD)
long id;
@ManyToOne @ManyToOne
Shop shop; Shop shop;
} }

View File

@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.hibernate.jpamodelgen.test.manytoone; package org.hibernate.jpamodelgen.test.manytoone;
import javax.persistence.Entity; import javax.persistence.Entity;