[Hibernate-JIRA] Created: (HHH-4044) ejbql select count() and composite keys problem
by Thierry Accart (JIRA)
ejbql select count() and composite keys problem
-----------------------------------------------
Key: HHH-4044
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4044
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: Jboss 4.2.2, JDK 1.5.18, Seam 2.1.2, MSSQL2000
Reporter: Thierry Accart
Priority: Critical
Hi
we're using seam 2.1.2 on JBoss 4.2.2 with JDK 1.5.18.
Our db is hosted on mssql server.
our persistence.xml contains sets hibernate.dialect to org.hibernate.dialect.SQLServerDialect.
UserRole is an entity containing userid and roleid as a composite key.
When the following ejbql query is run :
select count(userRole) from UserRole userRole
sql receives the following statement :
declare @P1 int
set @P1=NULL
declare @P2 int
set @P2=0
declare @P3 int
set @P3=0
exec sp_cursorprepexec @P1 output, @P2 output, NULL, N'select count((userrole0_.roleId, userrole0_.userId)) as col_0_0_ from TP_UM_UserRole userrole0_', 16, 8193, @P3 output
select @P1, @P2, @P3
the count((userrole0_.roleId, userrole0_.userId)) is not understood by mssql server, causing an error " Incorrect syntax near ','."
I think that a simple select count (*) would work fine.
--
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
12 years
[Hibernate-JIRA] Created: (HSEARCH-1096) @Transient Fields are never marked dirty
by Marc Schipperheyn (JIRA)
@Transient Fields are never marked dirty
----------------------------------------
Key: HSEARCH-1096
URL: https://hibernate.onjira.com/browse/HSEARCH-1096
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 4.1.0.Final
Reporter: Marc Schipperheyn
Transient @Fields that rely on underlying @Fields are never marked dirty. When an underlying @Field is marked dirty, the @Transient related @Field should also be marked dirty. I suppose that without additional metadata (see HSEARCH-1093), a @Transient @Field should be considered dirty by default, although this may lead to unnecessary database calls.
{code}
@Field
@IndexedEmbedded
public Photo getPhoto(){
return photo;
}
@Transient
@Field
public String getPhotoUrl(){
return photoDir + "/" + photo.getFilename();
}
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years
[Hibernate-JIRA] Created: (HHH-6044) Compound ID with auto-generated part produces exception
by Alex Shubert (JIRA)
Compound ID with auto-generated part produces exception
-------------------------------------------------------
Key: HHH-6044
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6044
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.6
Environment: java 6.23 64bit
Hibernate 3.5.6
Reporter: Alex Shubert
@Entity
public class TestRow implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Id
private Long version;
setters and getters are ommited for it's triviality
}
2. creating database and table by hand
#mysql -u username ...
create table F_TESTROW (ID bigint not null auto_increment, VERSION bigint not null, primary key (VERSION, ID))
TestRow testRow = new TestRow();
testRow.setVersion(2L);
testRow.setAddr("somewhere");
sessionFactory.openSession().save(testRow);
produces
java.lang.IllegalArgumentException: Can not set java.lang.Long field ru.kctsoft.fenestro.domain.strategy.TestRow.id to org.hibernate.id.IdentifierGeneratorHelper$2
at org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:139)
This is kinda frustrating.
http://docs.jboss.org/hibernate/stable/annotations/reference/en/html_single/
2.2.3.2.4. Partial identifier generation
Hibernate supports the automatic generation of some of the identifier properties. Simply use the @GeneratedValue annotation on one or several id properties.
--
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
12 years