If DbUnit is working for you, you could use the sql-maven-plugin and
.sql files to prepopulate the database. The advantage of DbUnit is its
Java API and the fact that its database agnostic. However, it's
unlikely you'll need to support many databases and Spring's
JdbcTemplate is just as good as DbUnit's Java API IMO.

Matt

On 8/13/07, EricLandry <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've been playing with AppFuse 2.0 M5 (MySQL, JPA Hibernate, Struts2 Basic)
> for the past couple of weeks and I've been following the useful tutorials.
> I've hit a couple of snags which have slowed me down. Hopefully, your
> answers will get me back on my feet.
>
> My current issue is that DBUnit has been causing me problems. I've already
> had to add FOREIGN_KEY_CHECKS=0 to the JDBC URL to work around another
> issue, but now DBUnit doesn't seem to increment sequences when inserting the
> sample-data.xml. (see:
> http://www.nabble.com/unique-constraint-violated-when-running-test-all-tf1447523s2369.html
> Unique constraint violated ). When I run my DAO tests, it fails with
> MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 2.
>
> I tried to initialize the sequence to a high number, but it doesn't seem to
> work.
>
> @Id
> @GeneratedValue(strategy = GenerationType.AUTO, generator = "generator")
> @SequenceGenerator(name = "generator", initialValue = 100)
> private Long id;
>
> @ManyToOne
> private Subject parent;
>
> @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent")
> private Set<Subject> children;
>
> @Column(nullable = false, length = 50)
> private String title;
>
> @Lob
> private String description;
>
>
> What do people used to populate a DB when using AppFuse? I'd like to keep
> using DBUnit's solution, but maybe I'm barking at the wrong tree.
>
> Thanks much in advance!
> Eric
> =)
> --
> View this message in context: 
> http://www.nabble.com/Populating-Database-and-DAO-Testing-tf4264560s2369.html#a12136692
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to