I've seen this question previously, but it has not yet been answered.  I can't 
get SQL commands stored in an import.sql file to load data into my database.

The following configuration appears to function properly:
  - jboss-4.0.3 SP1
  - jboss-EJB-3.0_RC3
  - Sun's JDK 1.5.0_05
  - Linux Fedora Core 3
  - MySQL 14.7

I have the following very simple POJO Entity:
@Entity(access = AccessType.FIELD)
public class Principle implements Serializable 
{
        @Id
        @Length(min=3, max=25)
        private String username;
        public String getUsername() { return username;  }
        public void setUsername(String username) { this.username = username; }
}

and an import.sql script that looks like this:
insert into Principle (username) values ('test');

my persistence.xml file looks like this (angle brackets removed to post 
correctly):

<entity-manager>
    pandoDatabase
    org.hibernate.ejb.HibernatePersistence
    <jta-data-source>java:/pandoDatasource</jta-data-source>
    properties
        property name="hibernate.dialect" 
value="org.hibernate.dialect.MySQLDialect"/
        property name="hibernate.hbm2ddl.auto" value="create-drop"/
    /properties
</entity-manager>

Everything gets packed into an ejb3 archive and deployed into the container.  
My log indicates that the insertion from import.sql is occurring, but the 
resulting tables are empty.  Note that I can cut and paste the import command 
into the mysql command client to load the data.

Any help is greatly appreciated.

Cheers,
Cameron.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3904719#3904719

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3904719


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to