[Hibernate-JIRA] Commented: (HBX-622) Allow ability to ignore Foreign Keys
by abhiram alamuru (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-622?page=co... ]
abhiram alamuru commented on HBX-622:
-------------------------------------
I'm using Sybase and the Eclipse IDE plugin and the method mentioned by Michael isn't working. I'm including
<property name="hibernate.metadatadialect">abc.efg.xyz.KeylessMetaDataDialect</property>
in the hibernate.cfg.xml file and creating the class as mentioned above. But it still creates the foreign key mappings linking to another table. Am I doing something wrong?
> Allow ability to ignore Foreign Keys
> ------------------------------------
>
> Key: HBX-622
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-622
> Project: Hibernate Tools
> Issue Type: New Feature
> Components: reverse-engineer
> Affects Versions: 3.1beta4
> Environment: As per patch.
> Reporter: James Olsen
> Fix For: 3.2.beta11
>
> Attachments: svn-patch.txt
>
>
> On the project I'm currently working on we want 1:1 POJO<->Table mapping without any relationships between the POJOs. Although this is not a configuration that I would normally choose or recommend, in this case it is forced upon us be external architectural requirements.
> Currently in order to avoid relationships in your POJOs you have to reveng each table individually. The attached patch is a proposed solution to allow the reveng to ignore relationships between tables when reverse engineering multiple tables at the same time.
> Note that the patch only supports this for ReverseEngineeringStrategy not for reveng.xml.
> I'm supplying the patch in the hope that it (or something similar) can be incorporated into the main code and in case anyone else has (unfortunately) similar requirements.
--
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
15 years, 3 months
[Hibernate-JIRA] Created: (ANN-842) Collection's @Where doesn't support @SecondaryTable columns
by StarBreeze (JIRA)
Collection's @Where doesn't support @SecondaryTable columns
-----------------------------------------------------------
Key: ANN-842
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-842
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.4.0.GA
Environment: 3.4.0.GA, MS SQL Server 2005
Reporter: StarBreeze
@Where annotation of collection wrongly mapping columns of entity secondary tables as columns of primary table.
Example:
@Entity
@Table(name = "Object")
@SecondaryTable(name="Classifier")
public class Classifier {
...
@Column(table="Classifier", name = "IsService")
public Boolean isService() {
return service;
}
public void setService(Boolean service) {
this.service = service;
}
@ManyToOne
@JoinColumn(name = "CategoryId")
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
}
@Entity
@Table(name = "Category")
public class Category {
...
@OneToMany(mappedBy = "category", fetch = FetchType.LAZY)
@Where(clause="IsService <> 1")
public List<Classifier> getClassifiers() {
return classifiers;
}
public void setClassifiers(List<Classifier> classifiers) {
this.classifiers = classifiers;
}
}
generates SQL on fetch Category's classifiers:
select ... from Object classifier0_ inner join Classifier classifier0_1_ on classifier0_.ObjectId=classifier0_1_.ClassifierId where ( classifier0_.IsService <> 1)
Expected SQL:
select ... from Object classifier0_ inner join Classifier classifier0_1_ on classifier0_.ObjectId=classifier0_1_.ClassifierId where ( classifier0_1_.IsService <> 1)
--
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
15 years, 3 months
[Hibernate-JIRA] Created: (HV-147) Invetigate problem with maven release plugin
by Hardy Ferentschik (JIRA)
Invetigate problem with maven release plugin
--------------------------------------------
Key: HV-147
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-147
Project: Hibernate Validator
Issue Type: Task
Reporter: Hardy Ferentschik
Fix For: 4.0.0.Beta2
mvn release:prepare -DdryRun=true reports no errors, but when actually executing the command there is a svn commit error. Maybe a configuration error!?
>>>
[INFO] [INFO] BUILD SUCCESSFUL
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 34 seconds
[INFO] [INFO] Finished at: Mon Apr 27 16:33:43 CEST 2009
[INFO] [INFO] Final Memory: 50M/97M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /Users/hardy/work/hibernate/validator/trunk && svn --non-interactive commit --file /tmp/maven-scm-1861763739.commit --targets /tmp/maven-scm-55083-targets
[INFO] Working directory: /Users/hardy/work/hibernate/validator/trunk
[INFO] Tagging release with the label hibernate-validator-parent-4.0.0.Beta1...
[INFO] Executing: /bin/sh -c cd /Users/hardy/work/hibernate/validator/trunk && svn --non-interactive copy --file /tmp/maven-scm-145441974.commit . https://svn.jboss.org/repos/hibernate/validator/tags/hibernate-validator-...
[INFO] Working directory: /Users/hardy/work/hibernate/validator/trunk
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to tag SCM
Provider message:
The svn tag command failed.
Command output:
svn: Commit failed (details follow):
svn: File '/repos/hibernate/validator/tags/hibernate-validator-parent-4.0.0.Beta1/hibernate-validator/pom.xml' already exists
>>>
--
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
15 years, 3 months
[Hibernate-JIRA] Created: (HBX-1124) BasicWorkbenchAdapter Classpath not found in hibernate configuration
by Clay Graham (JIRA)
BasicWorkbenchAdapter Classpath not found in hibernate configuration
--------------------------------------------------------------------
Key: HBX-1124
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1124
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.4.GA
Environment: Mac Book Pro, Eclipse Platform
Version: 3.4.2
Build id: M20090211-1700
Reporter: Clay Graham
Attachments: eclipse-config.txt, momentarynow.launch, Picture 1.png
I know this is a problem that many newbies trip on, and I have spent many hours researching this before filing a bug. Saying that after 20 years of windoze use I just bought a new Mac Book pro, which I love, and I am trying to get my development environment together. I use the maven2 plugin from sonotype, the subversion plugin, the tomcat plugin, and >the hibernate plugin< as my core development platform (JDK 1.6) with eclipse.
Version: 3.2.4.GA-R200905070146-H18
The only problem I have had is with the Hibernate Tools plugin. Specifically the classpath for the project cannot be found when attempting to rebuild the configuration:
Error
Sat Jun 06 14:08:00 PDT 2009
java.lang.ClassNotFoundException: com.noi.momentary.model.ConnectRequest
java.lang.ClassNotFoundException: com.noi.momentary.model.ConnectRequest
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:483)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:70)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:401)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:334)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
at org.hibernate.cfg.Configuration.add(Configuration.java:669)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:483)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter$1.execute(ConsoleConfigurationWorkbenchAdapter.java:45)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:94)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:41)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:99)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
So I have tried a *bunch* of things to resolve this (attached images)
1. make sure the project (default) classpath is in the configuration
2. make sure a jar, which is built, is in the configuration
3. make sure the maven build target class dir is in the configration
no matter what I have tried it always comes back the same, the class path cannot be found which is necessary for the configuration to bind to the database.
here is one interesting detail: I have exported the configuration file (attached) and there seems to be some XML encoded entries in the file. This seems different than most XML configuration files I have seen before.
I would love a fix for this. I love this tool.
I am happy to provide more information if its helpful.
--
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
15 years, 3 months
[Hibernate-JIRA] Created: (HHH-3942) Missing Maven dependencies in hibernate-core-3.3.1.GA.pom
by Bruno Harbulot (JIRA)
Missing Maven dependencies in hibernate-core-3.3.1.GA.pom
---------------------------------------------------------
Key: HHH-3942
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3942
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1.GA, Linux and Maven
Reporter: Bruno Harbulot
I've been trying to use this from the JBoss Maven repository:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.1.GA</version>
</dependency>
However, I've had to add these (to avoid ClassNotFoundExceptions):
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.4.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.10.0.GA</version>
<scope>runtime</scope>
</dependency>
I'm not sure these are the version numbers that were used, but these seem to work.
In addition, javassist already is in hibernate-core-3.3.1.GA.pom, but it's declared as optional (it seems required at runtime).
--
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
15 years, 3 months
[Hibernate-JIRA] Created: (HHH-3939) @NotAudited association requires and joins to the associated table
by dsailer (JIRA)
@NotAudited association requires and joins to the associated table
------------------------------------------------------------------
Key: HHH-3939
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3939
Project: Hibernate Core
Issue Type: Bug
Components: envers
Environment: envers-1.2.0
hibernate-3.3.1.ga
hibernate-annotations-3.4.0.ga
postgresql-8.1-407
Reporter: dsailer
We have an Asset with an association to an Organization. Asset is audited and Organization is not. The association to Organization has @NotAudited. However, envers still requires the join table to exist. If the table exists AuditReader's queries for Asset revisions try to join to that table. Our work around was to go ahead and audit Organization. Here is the code:
@Entity
@Table(name = "MTE_ASSET")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Audited
public class Asset extends AuditableEntity implements Serializable{
<snip>
@ManyToOne
@JoinTable(name="mte_organization_mte_asset",
joinColumns = @JoinColumn(name="asset_id"),
inverseJoinColumns = @JoinColumn(name="organization_id"))
private Organization organization;
<snip>
}
@Entity
@Table(name = "MTE_ORGANIZATION")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(
name = "organization_type",
discriminatorType = DiscriminatorType.STRING
)
@DiscriminatorValue("Organization")
public class Organization extends AuditableEntity {
<snip>
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "mte_organization_mte_asset", joinColumns = @JoinColumn(name = "organization_id"), inverseJoinColumns = @JoinColumn(name = "asset_id"))
@OrderBy(value="name asc")
private List<Asset> assets = new ArrayList<Asset>();
<snip>
}
without the table mte_organization_mte_asset_audit defined and using:
<entry key="hibernate.hbm2ddl.auto" value="validate"/>
we get:
Caused by: org.hibernate.HibernateException: Missing table: mte_organization_mte_asset_audit
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1113)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:349)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.jav
a:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
... 38 more
If we create the table mte_organization_mte_asset_audit but don't audit Organization the queries from AuditReader include a join to mte_organization_mte_asset_audit and we get no rows back.
--
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
15 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1853) CREATE SCHEMA inside database-object need to execute before tables are created
by Ed Gow (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1853?page=c... ]
Ed Gow commented on HHH-1853:
-----------------------------
The crux of the issue seems to be just the creation of schema, not dropping schema. Earlier comments about dropping more than is intended provide good reason for not dropping schema from Hibernate. Can a version of the patch for this bug that only creates, but never drops, schema make it into a release?
This bug is a serious impediment for the common case of using an H2 in-memory database for unit testing.
> CREATE SCHEMA inside database-object need to execute before tables are created
> ------------------------------------------------------------------------------
>
> Key: HHH-1853
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1853
> Project: Hibernate Core
> Issue Type: Improvement
> Affects Versions: 3.1.3
> Environment: hsqldb 1.8.0
> Reporter: Mattias Jiderhamn
> Priority: Minor
> Attachments: create-schema.patch, create-schema2.patch
>
>
> In order to have Hibernate create database schemas for hsqldb, you have to insert a <database-object> in your mapping file (http://forums.hibernate.org/viewtopic.php?p=2305138). Problem is, all the database-object statements are executed after the tables are created, so tables in non-default schemas will not be created. To get around this, you have to first use Configuration.generateSchemaCreationScript() to get the schemas, and then Configuration.generateSchemaUpdateScript() to get the tables inside the schemas.
> (This is a bit problematic when using Springs LocalSessionFactoryBean)
--
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
15 years, 3 months