Package org.hibernate.cfg

Examples of org.hibernate.cfg.Configuration.addResource()


      assertNull(
          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Person.hbm.xml" );
      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );

      cfg.buildSessionFactory();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
View Full Code Here


  public void testNwaitingForSuper() {
    Configuration cfg = new Configuration();

    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/Customer.hbm.xml" );
      assertNull(
          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );
View Full Code Here

      cfg.addResource( getBaseForMappings() + "extendshbm/Customer.hbm.xml" );
      assertNull(
          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );
      assertNull(
          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Person.hbm.xml" );
View Full Code Here

      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );
      assertNull(
          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Person.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" ) );
View Full Code Here

  public void testMissingSuper() {
    Configuration cfg = new Configuration();

    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/Customer.hbm.xml" );
      assertNull(
          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );
View Full Code Here

      cfg.addResource( getBaseForMappings() + "extendshbm/Customer.hbm.xml" );
      assertNull(
          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Employee.hbm.xml" );

      cfg.buildSessionFactory();

      fail( "Should not be able to build sessionfactory without a Person" );
    }
View Full Code Here

  public void testAllSeparateInOne() {
    Configuration cfg = new Configuration();

    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/allseparateinone.hbm.xml" );

      cfg.buildSessionFactory();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
View Full Code Here

  public void testJoinedSubclassAndEntityNamesOnly() {
    Configuration cfg = new Configuration();

    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/entitynames.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "EntityHasName" ) );
      assertNotNull( cfg.getClassMapping( "EntityCompany" ) );
View Full Code Here

  }

  public void testEntityNamesWithPackage() {
    Configuration cfg = new Configuration();
    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/packageentitynames.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "EntityHasName" ) );
      assertNotNull( cfg.getClassMapping( "EntityCompany" ) );
View Full Code Here

  public void testUnionSubclass() {
    Configuration cfg = new Configuration();

    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/unionsubclass.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.