[Hibernate-JIRA] Created: (EJB-232) Better documentation for <jar-file> and scanning outside of PU root
by Christian Bauer (JIRA)
Better documentation for <jar-file> and scanning outside of PU root
-------------------------------------------------------------------
Key: EJB-232
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-232
Project: Hibernate Entity Manager
Type: Improvement
Components: Documentation
Reporter: Christian Bauer
Priority: Minor
> > I'm trying to solve a problem that people will face as soon as they
> > do unit testing. Given the following directories with classes:
> >
> > - build/classes/MyModel.class @Entity
> > - build/testclasses/META-INF/persistence.xml
> >
> > This doesn't work because the PU root is build/testclasses, and
> > there are no entities there. I've tried to use <jar-file>file://
> > build/classes</jar-file> to point the scanner to that directory,
> > but it doesn't work either. Apparently it has to be a JAR file.
> >
> > Maybe we should introduce a syntax or fallback for <jar-file> to
> > scan a directory. I see no other way how I could split my entity
> > build path from the test configuration build path. It's almost
> > impossible to find a project layout in an IDE where you could get
> > both together and not run into all kinds of issues.
>
> Oh, it works. I had a slash too many in my URL. Maybe we should add
> this to the documentation:
>
> <jar-file>file:/home/turin/work/local/lab8/build/classes</jar-file>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 9 months
[Hibernate-JIRA] Created: (EJB-243) Error in Documentation: persistence.xml for typical Java SE Environment
by Michael Plöd (JIRA)
Error in Documentation: persistence.xml for typical Java SE Environment
-----------------------------------------------------------------------
Key: EJB-243
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-243
Project: Hibernate Entity Manager
Type: Improvement
Components: Documentation
Versions: 3.2.0.ga
Reporter: Michael Plöd
Hi,
I just found out that there is a small bug in the example persistence.xml file for a Typical Java SE environment in Chapter 2.2.2 Bootstrapping:
The xml file is as follows:
<persistence>
<persistence-unit name="manager1" transaction-type="RESOURCE_LOCAL">
<class>org.hibernate.ejb.test.Cat</class>
<class>org.hibernate.ejb.test.Distributor</class>
<class>org.hibernate.ejb.test.Item</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:."/>
<property name="hibernate.max_fetch_depth" value="3"/>
<!-- cache configuration -->
<property name="hibernate.ejb.classcache.org.hibernate.ejb.test.Item" value="read-write"/>
<property name="hibernate.ejb.collectioncache.org.hibernate.ejb.test.Item.distributors" value="read-write, RegionName"/>
<!-- alternatively to <class> and <property> declarations, you can use a regular hibernate.cfg.xml file -->
<!-- property name="hibernate.ejb.cfgfile" value="/org/hibernate/ejb/test/hibernate.cfg.xml"/ -->
</properties>
<persistence-unit>
</persistence>
The error is that the <persistence-unit> is not being closed by </persistence-unit> (look two lines up from here) ...
The documentation says:
...
<persistence-unit>
....
<persistence-unit> <---- this must me </persistence-unit>
</persistence>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
18 years, 9 months