[Hibernate-JIRA] Created: (ANN-751) Hibernate reports erroneous "possible typo error" for properties with protected accessor methods
by Stephen R. Saucier (JIRA)
Hibernate reports erroneous "possible typo error" for properties with protected accessor methods
------------------------------------------------------------------------------------------------
Key: ANN-751
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-751
Project: Hibernate Annotations
Issue Type: Improvement
Affects Versions: 3.3.0.ga
Reporter: Stephen R. Saucier
Priority: Minor
Attachments: checkForOrphanProperties.patch
According to the EJB3 spec, section 2.1.1 (Persistent Fields and Properties), "property accessor methods must be public or protected." However, the checkForOrphanProperties method of org.hibernate.cfg.annotations.reflection.EJB3OverridenAnnotationReader only looks for public methods (by virtue of the fact that it is using the getMethods method of Class. I believe that the checkForOrphanProperties method ought to look at the protected methods implemented in the entity class as well in order to eliminate the erroneous warning messages that are reported when using hibernate with protected property accessor methods.
I've attached a patch which implements this additional behavior.
--
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, 4 months
[Hibernate-JIRA] Created: (HBX-1093) Missing inverseJoinColumn at ManyToMany relations with composite keys
by Nils Kelleter (JIRA)
Missing inverseJoinColumn at ManyToMany relations with composite keys
---------------------------------------------------------------------
Key: HBX-1093
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1093
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2java
Affects Versions: 3.2.2, 3.2LATER
Environment: Hibernate Tools version 3.2.2.Beta1 and 3.2.4.CR1-N200810300202, Oracle Database
Reporter: Nils Kelleter
Using the hbm2java tool for reverse engineering of database tables, the following problem exists:
At ManyToMany relations with composite keys an inverseJoinColumn is missing.
Wrong code:
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "ET_MANY_TO_MANY_COMP_MAPPING",
joinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP1_ID", nullable = false, updatable = false),
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP11_ID", nullable = false, updatable = false) },
inverseJoinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP2_ID", nullable = false, updatable = false) })
public Set<EtManyToManyComp2> getEtManyToManyComp2s() {
return this.etManyToManyComp2s;
}
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "ET_MANY_TO_MANY_COMP_MAPPING",
joinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP2_ID", nullable = false, updatable = false),
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP22_ID", nullable = false, updatable = false) },
inverseJoinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP1_ID", nullable = false, updatable = false) })
public Set<EtManyToManyComp1> getEtManyToManyComp1s() {
return this.etManyToManyComp1s;
}
Correct code:
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "ET_MANY_TO_MANY_COMP_MAPPING",
joinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP1_ID", nullable = false, updatable = false),
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP11_ID", nullable = false, updatable = false) },
inverseJoinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP2_ID", nullable = false, updatable = false),
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP22_ID", nullable = false, updatable = false) })
public Set<EtManyToManyComp2> getEtManyToManyComp2s() {
return this.etManyToManyComp2s;
}
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "ET_MANY_TO_MANY_COMP_MAPPING",
joinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP2_ID", nullable = false, updatable = false),
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP22_ID", nullable = false, updatable = false) },
inverseJoinColumns = {
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP1_ID", nullable = false, updatable = false),
@JoinColumn(name = "FK_ET_MANY_TO_MANY_COMP11_ID", nullable = false, updatable = false) })
public Set<EtManyToManyComp1> getEtManyToManyComp1s() {
return this.etManyToManyComp1s;
}
For reproducing this, you can use the following Oracle SQL scripts:
CREATE TABLE ET_MANY_TO_MANY_COMP1 (
ET_MANY_TO_MANY_COMP1_ID NUMBER,
ET_MANY_TO_MANY_COMP11_ID NUMBER,
FIELD VARCHAR2(10),
PRIMARY KEY (ET_MANY_TO_MANY_COMP1_ID, ET_MANY_TO_MANY_COMP11_ID)
);
CREATE TABLE ET_MANY_TO_MANY_COMP2 (
ET_MANY_TO_MANY_COMP2_ID NUMBER,
ET_MANY_TO_MANY_COMP22_ID NUMBER,
FIELD VARCHAR2(10),
PRIMARY KEY (ET_MANY_TO_MANY_COMP2_ID, ET_MANY_TO_MANY_COMP22_ID)
);
CREATE TABLE ET_MANY_TO_MANY_COMP_MAPPING (
FK_ET_MANY_TO_MANY_COMP1_ID NUMBER,
FK_ET_MANY_TO_MANY_COMP11_ID NUMBER,
FK_ET_MANY_TO_MANY_COMP2_ID NUMBER,
FK_ET_MANY_TO_MANY_COMP22_ID NUMBER,
FOREIGN KEY (FK_ET_MANY_TO_MANY_COMP1_ID,FK_ET_MANY_TO_MANY_COMP11_ID)
REFERENCES ET_MANY_TO_MANY_COMP1(ET_MANY_TO_MANY_COMP1_ID,ET_MANY_TO_MANY_COMP11_ID),
FOREIGN KEY (FK_ET_MANY_TO_MANY_COMP2_ID, FK_ET_MANY_TO_MANY_COMP22_ID)
REFERENCES ET_MANY_TO_MANY_COMP2(ET_MANY_TO_MANY_COMP2_ID, ET_MANY_TO_MANY_COMP22_ID),
PRIMARY KEY (FK_ET_MANY_TO_MANY_COMP1_ID,FK_ET_MANY_TO_MANY_COMP11_ID,FK_ET_MANY_TO_MANY_COMP2_ID,FK_ET_MANY_TO_MANY_COMP22_ID)
);
--
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, 4 months
[Hibernate-JIRA] Created: (HBX-1112) Reverse engineering problem with composite primary key
by Christian Meyer (JIRA)
Reverse engineering problem with composite primary key
------------------------------------------------------
Key: HBX-1112
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1112
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.4 Beta1
Environment: configuration:
Hibernate Tools version: HibernateTools-3.2.4.CR2-R200901280154
Hibernate version: hibernate-3.2.6.ga.zip
Database: Sybase SQL Anywhere 10.0.1.3415
JDBC-Driver: jconnect 6.05
Eclipse Version: 3.4.0
Code Generation Configuration:
Use Java 5 syntax and generate EJB3 annotations switched on.
Exporters: domain code.
Reporter: Christian Meyer
Hello,
I have a problem reverse engineering domain code from a sybase anywhere 10 database.
For every table with composite primary key i get the following exception:
org.hibernate.cfg.JDBCBinderException: Duplicate names found for primarykey.
Her is one example:
create table DCALLS
(
AES timestamp default timestamp,
APPLID char(8) not null,
DIALOG integer not null,
COUNTER integer,
constraint PK_DCALLS primary key (APPLID, DIALOG)
);
For downloading developer edition of sybase anywhere version 10 follow the link: http://marketing.ianywhere.com/forms/SQLAny10DevEditionCDReigster
I used a Hibernate dialect from the sybase homepage: http://www.sybase.de/detail?id=1057826
org.hibernate.cfg.JDBCBinderException: Duplicate names found for primarykey.
Existing name: APPLID JDBC name: DIALOG on table org.hibernate.mapping.Table(sybase10.DCALLS)
Duplicate names found for primarykey. Existing name: APPLID JDBC name: DIALOG on table org.hibernate.mapping.Table(sybase10.DCALLS)
all Tables with single key are 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
15 years, 4 months
[Hibernate-JIRA] Created: (HHH-3851) object load with composite id
by sahasra (JIRA)
object load with composite id
-----------------------------
Key: HHH-3851
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3851
Project: Hibernate Core
Issue Type: Bug
Components: core
Environment: HIbernate Version : 3.3.1.GA
Database : Oracle 10g
The table column types are CHAR
Reporter: sahasra
Priority: Blocker
Having issues in loading, updating, deleting and querying with bind variable an entity with composite id. The table column types are CHAR
No row with the given identifier exists
but the row exists
I replace "?" by correct values, execute it in the SQL Plus and it works.
Code in the DAO class
public BoardDefinition getBoardDefinitionById(BoardDefinitionId anId)
throws HibernateException
{
BoardDefinition instance = (BoardDefinition)getHibernateTemplate().get(BoardDefinition.class, anId);
if (instance == null)
{
System.out.println("get successful, no instance found");
}
else
{
System.out.println("get successful, instance found");
}
return instance;
}
Generated SQL on running the test case
select boarddefin0_.STN as STN0_0_, boarddefin0_.BOARD_ID as BOARD2_0_0_, boarddefin0_.DESCRIPTION as DESCRIPT3_0_0_, boarddefin0_.BOARD_TYPE as BOARD4_0_0_, boarddefin0_.ACTV_FRA_RPT_FL as ACTV5_0_0_, boarddefin0_.DEACT_TRN_LINUP_FL as DEACT6_0_0_, boarddefin0_.TMP_MOVE_RESTR_EN as TMP7_0_0_, boarddefin0_.TMP_MOVE_RESTR_TR as TMP8_0_0_, boarddefin0_.TMP_MOVE_ALW_EN as TMP9_0_0_, boarddefin0_.TMP_MOVE_ALW_TR as TMP10_0_0_, boarddefin0_.AUTOSHT_CL_VAC_HRS as AUTOSHT11_0_0_, boarddefin0_.AUTOSHT_CL_VAC_MNS as AUTOSHT12_0_0_, boarddefin0_.AUTOSHT_CL_HRS as AUTOSHT13_0_0_, boarddefin0_.AUTOSHT_CL_MNS as AUTOSHT14_0_0_, boarddefin0_.COMMENTS as COMMENTS0_0_, boarddefin0_.WRK_RST_PROF_EN as WRK16_0_0_, boarddefin0_.WRK_RST_PROF_TR as WRK17_0_0_, boarddefin0_.SEN_MOVE_PROF_EN as SEN18_0_0_, boarddefin0_.SEN_MOVE_PROF_TR as SEN19_0_0_, boarddefin0_.MILES_PROF_EN as MILES20_0_0_, boarddefin0_.MILES_PROF_TR as MILES21_0_0_, boarddefin0_.STARTS_PROF_EN as STARTS22_0_0_, boarddefin0_.STARTS_PROF_TR as STARTS23_0_0_, boarddefin0_.BLE16_EN as BLE24_0_0_, boarddefin0_.FREE_DY_PROF_EN as FREE25_0_0_, boarddefin0_.FREE_DY_PROF_TR as FREE26_0_0_, boarddefin0_.SGL_DY_VAC_EN as SGL27_0_0_, boarddefin0_.SGL_DY_VAC_TR as SGL28_0_0_, boarddefin0_.LOF_RQST_ALW_EN_FL as LOF29_0_0_, boarddefin0_.LOF_RQST_ALW_TR_FL as LOF30_0_0_, boarddefin0_.SVC_TYP_CD as SVC31_0_0_, boarddefin0_.CRW_CONSIST_CD as CRW32_0_0_, boarddefin0_.UPD_TS as UPD33_0_0_, boarddefin0_.USER_ID as USER34_0_0_, boarddefin0_.SPRSS_BRD_ADVRT_FL as SPRSS35_0_0_, boarddefin0_.CRFT_TYP as CRFT36_0_0_, boarddefin0_.HDR_STN as HDR37_0_0_, boarddefin0_.HDR_BOARD as HDR38_0_0_, boarddefin0_.NBR_TRADES_MAX as NBR39_0_0_, boarddefin0_.TRADE_RESET_VALUE as TRADE40_0_0_, boarddefin0_.TRADE_RESET_TYPE as TRADE41_0_0_, boarddefin0_.TRADE_RESET_DT as TRADE42_0_0_, boarddefin0_.TRADE_ALLOWED_IND as TRADE43_0_0_, boarddefin0_.DISPLCE_CU_AWAY_FL as DISPLCE44_0_0_, boarddefin0_.NMS_ACTIVE_FL as NMS45_0_0_, boarddefin0_.SAME_BRD_MOVE_CD as SAME46_0_0_, boarddefin0_.TRADE_AGAINST_CD as TRADE47_0_0_, boarddefin0_.TMP_SEN_POS_PRF_EN as TMP48_0_0_, boarddefin0_.TMP_SEN_POS_PRF_TR as TMP49_0_0_, boarddefin0_.PERM_CUT_ALLW_FL as PERM50_0_0_, boarddefin0_.AUTO_PX_STN1 as AUTO51_0_0_, boarddefin0_.AUTO_PX_BRD1 as AUTO52_0_0_, boarddefin0_.AUTO_PX_STN2 as AUTO53_0_0_, boarddefin0_.AUTO_PX_BRD2 as AUTO54_0_0_, boarddefin0_.TRADE_TYPE_CD as TRADE55_0_0_, boarddefin0_.SPRS_BRD_ADVRT_DYS as SPRS56_0_0_, boarddefin0_.BUMP_PX_STN as BUMP57_0_0_, boarddefin0_.BUMP_PX_BOARD as BUMP58_0_0_, boarddefin0_.BUMP_OPEN_ASG_FL as BUMP59_0_0_, boarddefin0_.BUMP_MOST_JR_FL as BUMP60_0_0_, boarddefin0_.CUTOFF_STN as CUTOFF61_0_0_, boarddefin0_.CUTOFF_BOARD as CUTOFF62_0_0_, boarddefin0_.METRA_BOARD_FL as METRA63_0_0_, boarddefin0_.ADVRT_BID_FL as ADVRT64_0_0_, boarddefin0_.STAND_BID_FL as STAND65_0_0_, boarddefin0_.SEN_MOVE_FL as SEN66_0_0_, boarddefin0_.FORCED1_FB_FL as FORCED67_0_0_, boarddefin0_.FORCED2_FB_FL as FORCED68_0_0_, boarddefin0_.AUTO_DH_TU_FL as AUTO69_0_0_, boarddefin0_.RDE_BLGENBID_EN_FL as RDE70_0_0_, boarddefin0_.RDE_BLGENBID_TR_FL as RDE71_0_0_, boarddefin0_.SEN_MOVE_ALLOW_CD as SEN72_0_0_, boarddefin0_.DISP_ON_DUTY_FL as DISP73_0_0_, boarddefin0_.TRAINING_BOARD_FL as TRAINING74_0_0_ from BOARD_DEFINITION boarddefin0_ where boarddefin0_.STN=? and boarddefin0_.BOARD_ID=?
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Apr 3, 2009 1:57:04 PM by Hibernate Tools 3.2.4.CR1 -->
<hibernate-mapping>
<class name="com.pstechnology.persistence.hibernate.BoardDefinition" table="BOARD_DEFINITION">
<composite-id name="id" class="com.pstechnology.persistence.hibernate.BoardDefinitionId">
<key-property name="stn" type="string">
<column name="STN" length="6" />
</key-property>
<key-property name="boardId" type="string">
<column name="BOARD_ID" length="4" />
</key-property>
</composite-id>
<property name="description" type="string">
<column name="DESCRIPTION" length="25" not-null="true" />
</property>
<property name="boardType" type="java.lang.Character">
<column name="BOARD_TYPE" length="1" />
</property>
<property name="actvFraRptFl" type="java.lang.Character">
<column name="ACTV_FRA_RPT_FL" length="1" />
</property>
</class>
</hibernate-mapping>
CREATE TABLE BOARD_DEFINITION
(
STN CHAR(6) NOT NULL,
BOARD_ID CHAR(4) NOT NULL,
DESCRIPTION VARCHAR2(25) NOT NULL,
BOARD_TYPE CHAR(1) NULL,
ACTV_FRA_RPT_FL CHAR(1) NULL,
constraint BOARD_DEFINITION_PK primary key (STN, BOARD_ID)
);
Code snippet of the generated POJOs
import java.math.BigDecimal;
import java.util.Date;
/**
* BoardDefinition generated by hbm2java
*/
public class BoardDefinition
implements java.io.Serializable
{
private BoardDefinitionId id;
private String description;
private Character boardType;
private Character actvFraRptFl;
-------
-------
-----
}
/**
* BoardDefinitionId generated by hbm2java
*/
public class BoardDefinitionId
implements java.io.Serializable
{
private String stn;
private String boardId;
public BoardDefinitionId()
{
}
--
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, 5 months
[Hibernate-JIRA] Created: (HV-171) JSR-303 must specify how to run in environments that use a SecurityManager
by Ed Burns (JIRA)
JSR-303 must specify how to run in environments that use a SecurityManager
--------------------------------------------------------------------------
Key: HV-171
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-171
Project: Hibernate Validator
Issue Type: Improvement
Components: documentation
Affects Versions: 4.0.0.Beta1
Environment: Glassfish V3 with Security Manager Enabled
Reporter: Ed Burns
When running the JSR-303 Impl that is Hibernate Validator 4.0.0.Beta1 on a container with a SecurityManager, such as Glassfishv3 with the SecurityManager enabled, calling simple validator code such as:
Set<ConstraintViolation<Person>> violations =
beanValidator.validate(person);
Will cause an AccessControlException, as shown in the following stack trace:
[#|2009-06-19T11:22:20.347-0400|SEVERE|glassfish|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=17;_ThreadName=Thread-1;|StandardWrapperValve[SimpleBVServlet]: PWC1406: Servlet.service() for servlet SimpleBVServlet threw exception
java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:107)
at org.hibernate.validation.util.ReflectionHelper.setAccessibility(ReflectionHelper.java:195)
at org.hibernate.validation.engine.BeanMetaDataImpl.initFieldConstraints(BeanMetaDataImpl.java:233)
at org.hibernate.validation.engine.BeanMetaDataImpl.initClass(BeanMetaDataImpl.java:207)
at org.hibernate.validation.engine.BeanMetaDataImpl.createMetaData(BeanMetaDataImpl.java:179)
at org.hibernate.validation.engine.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:106)
at org.hibernate.validation.engine.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:96)
at org.hibernate.validation.engine.ValidatorImpl.getBeanMetaData(ValidatorImpl.java:559)
at org.hibernate.validation.engine.ValidatorImpl.validateConstraints(ValidatorImpl.java:225)
at org.hibernate.validation.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:189)
at org.hibernate.validation.engine.ValidatorImpl.validate(ValidatorImpl.java:110)
at simple_bv_servlet.SimpleBVServlet.doGet(SimpleBVServlet.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:319)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:352)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:209)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1499)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:293)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:187)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:353)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:249)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:147)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:655)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:905)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:161)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
Some remedies include:
1. Explicitly accounting for SecurityManager considerations in the JSR-303 Java API
2. Mentioning in the spec prose what a caller that wishes to use SecurityManager must do to enable JSR-303 to work without throwing security related exceptions.
--
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, 5 months
[Hibernate-JIRA] Created: (HBX-1120) Incorrect ManyToMany Generation
by Henry Chan (JIRA)
Incorrect ManyToMany Generation
-------------------------------
Key: HBX-1120
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1120
Project: Hibernate Tools
Issue Type: Bug
Environment: MySQL v5.1
Hibernate Tools 3.2.4
Reporter: Henry Chan
When I run the reverse Engineering Tool to generate my classes, one of these classes does not have the correct manytomany annotation defined correctly:
In the example below, the I have User, User_Role and Role
The User classgets generated correctly:
User.java ...
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "user_role", catalog = "exms", joinColumns = { @JoinColumn(name = "userID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "roleID", nullable = false, updatable = false) })
public Set<Role> getRoles() {
return this.roles;
}
but Role.java class isn't correct:
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "roles")
public Set<User> getUsers() {
return this.users;
}
Where is the @JoinTable in Role.java?
DROP TABLE IF EXISTS `exms`.`Role` ;
CREATE TABLE IF NOT EXISTS `exms`.`Role` (
`roleID` INT NOT NULL AUTO_INCREMENT ,
`roleName` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`roleID`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `exms`.`Login`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `exms`.`Login` ;
CREATE TABLE IF NOT EXISTS `exms`.`Login` (
`loginID` INT NOT NULL AUTO_INCREMENT ,
`userID` INT NULL ,
`timeStamp` DATETIME NULL ,
`failedLogins` INT NULL ,
PRIMARY KEY (`loginID`) ,
INDEX `fk_Login_User` (`userID` ASC) ,
CONSTRAINT `fk_Login_User`
FOREIGN KEY (`userID` )
REFERENCES `exms`.`User` (`userID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `exms`.`User_Role`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `exms`.`User_Role` ;
CREATE TABLE IF NOT EXISTS `exms`.`User_Role` (
`userID` INT NOT NULL ,
`roleID` INT NOT NULL ,
INDEX `fk_User_Role_User` (`userID` ASC) ,
INDEX `fk_User_Role_Role` (`roleID` ASC) ,
PRIMARY KEY (`userID`, `roleID`) ,
CONSTRAINT `fk_User_Role_User`
FOREIGN KEY (`userID` )
REFERENCES `exms`.`User` (`userID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_User_Role_Role`
FOREIGN KEY (`roleID` )
REFERENCES `exms`.`Role` (`roleID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
--
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, 5 months