Author: bdaw
Date: 2009-11-16 04:16:38 -0500 (Mon, 16 Nov 2009)
New Revision: 955
Added:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttributeBinaryValue.java
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredentialBinaryValue.java
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml
Removed:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateBinaryValue.java
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateBinaryValue.hbm.xml
Modified:
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldburl.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/sybase.hibernate.cfg.xml
idm/trunk/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml
idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity-classes.cfg.xml
idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity.cfg.xml
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttribute.java
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttribute.hbm.xml
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredential.hbm.xml
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/EvilBinaryTestCase.java
idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml
idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml
Log:
another hibernate mapping change
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml
===================================================================
---
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldb.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -46,7 +46,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified:
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldburl.hibernate.cfg.xml
===================================================================
---
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldburl.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/hsqldburl.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -46,7 +46,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml
===================================================================
---
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mssql.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -46,7 +46,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml
===================================================================
---
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/mysql.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -45,7 +45,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml
===================================================================
---
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/oracle.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -46,7 +46,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified:
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml
===================================================================
---
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/postgresql.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -46,7 +46,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified: idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/sybase.hibernate.cfg.xml
===================================================================
---
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/sybase.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/assembly/src/main/files/jboss/hibernate.cfg/sybase.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -46,7 +46,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified: idm/trunk/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++ idm/trunk/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -67,7 +67,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified:
idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity-classes.cfg.xml
===================================================================
---
idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity-classes.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity-classes.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -48,7 +48,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<mapping resource="mappings/HibernateRealm.hbm.xml"/>
- <mapping resource="mappings/HibernateBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>
+ <mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>
<mapping resource="mappings/HibernateIdentityObject.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>
<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>
Modified: idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity.cfg.xml
===================================================================
---
idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/example/simple/src/test/resources/hibernate-jboss-identity.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -51,7 +51,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<!--<mapping
resource="mappings/HibernateRealm.hbm.xml"/>-->
- <!--<mapping
resource="mappings/HibernateBinaryValue.hbm.xml"/>-->
+ <!--<mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>-->
+ <!--<mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObject.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>-->
Deleted:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateBinaryValue.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateBinaryValue.java 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateBinaryValue.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -1,60 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2009, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-
-package org.jboss.identity.idm.impl.model.hibernate;
-
-public class HibernateBinaryValue
-{
- private Long id;
-
- private byte[] value = null;
-
- public HibernateBinaryValue()
- {
- }
-
- public HibernateBinaryValue(byte[] value)
- {
- this.value = value;
- }
-
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- public byte[] getValue()
- {
- return value;
- }
-
- public void setValue(byte[] value)
- {
- this.value = value;
- }
-}
Modified:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttribute.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttribute.java 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttribute.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -48,7 +48,7 @@
private String type;
- private HibernateBinaryValue binaryValue = null;
+ private HibernateIdentityObjectAttributeBinaryValue binaryValue = null;
private Set<String> textValues = new HashSet<String>();
@@ -108,12 +108,12 @@
this.type = newType;
}
- public HibernateBinaryValue getBinaryValue()
+ public HibernateIdentityObjectAttributeBinaryValue getBinaryValue()
{
return binaryValue;
}
- public void setBinaryValue(HibernateBinaryValue binaryValue)
+ public void setBinaryValue(HibernateIdentityObjectAttributeBinaryValue binaryValue)
{
this.binaryValue = binaryValue;
}
@@ -174,7 +174,7 @@
throw new IllegalArgumentException("byte[] value expected with a set
type." + " Name=" + name + "; type=" + type);
}
- setBinaryValue(new HibernateBinaryValue((byte[])value));
+ setBinaryValue(new HibernateIdentityObjectAttributeBinaryValue((byte[])value));
}
else
{
Copied:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttributeBinaryValue.java
(from rev 947,
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateBinaryValue.java)
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttributeBinaryValue.java
(rev 0)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectAttributeBinaryValue.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -0,0 +1,60 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2009, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.impl.model.hibernate;
+
+public class HibernateIdentityObjectAttributeBinaryValue
+{
+ private Long id;
+
+ private byte[] value = null;
+
+ public HibernateIdentityObjectAttributeBinaryValue()
+ {
+ }
+
+ public HibernateIdentityObjectAttributeBinaryValue(byte[] value)
+ {
+ this.value = value;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public byte[] getValue()
+ {
+ return value;
+ }
+
+ public void setValue(byte[] value)
+ {
+ this.value = value;
+ }
+}
Modified:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -46,7 +46,7 @@
private String textValue;
- private HibernateBinaryValue binaryValue;
+ private HibernateIdentityObjectCredentialBinaryValue binaryValue;
private Map<String, String> properties = new HashMap<String, String>();
@@ -74,12 +74,12 @@
this.textValue = textValue;
}
- public HibernateBinaryValue getBinaryValue()
+ public HibernateIdentityObjectCredentialBinaryValue getBinaryValue()
{
return binaryValue;
}
- public void setBinaryValue(HibernateBinaryValue binaryValue)
+ public void setBinaryValue(HibernateIdentityObjectCredentialBinaryValue binaryValue)
{
this.binaryValue = binaryValue;
}
Added:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredentialBinaryValue.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredentialBinaryValue.java
(rev 0)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredentialBinaryValue.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -0,0 +1,60 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2009, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+
+package org.jboss.identity.idm.impl.model.hibernate;
+
+public class HibernateIdentityObjectCredentialBinaryValue
+{
+ private Long id;
+
+ private byte[] value = null;
+
+ public HibernateIdentityObjectCredentialBinaryValue()
+ {
+ }
+
+ public HibernateIdentityObjectCredentialBinaryValue(byte[] value)
+ {
+ this.value = value;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public byte[] getValue()
+ {
+ return value;
+ }
+
+ public void setValue(byte[] value)
+ {
+ this.value = value;
+ }
+}
\ No newline at end of file
Modified:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -419,7 +419,8 @@
return config
.addResource("mappings/HibernateIdentityObject.hbm.xml")
- .addResource("mappings/HibernateBinaryValue.hbm.xml")
+
.addResource("mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml")
+
.addResource("mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml")
.addResource("mappings/HibernateIdentityObjectAttribute.hbm.xml")
.addResource("mappings/HibernateIdentityObjectCredential.hbm.xml")
.addResource("mappings/HibernateIdentityObjectCredentialType.hbm.xml")
@@ -1789,7 +1790,7 @@
throw new IdentityException("Wrong attribute mapping. Attribute
persisted as binary is mapped with: "
+ type + ". Attribute name: " + name);
}
- HibernateBinaryValue bv = new
HibernateBinaryValue((byte[])attribute.getValue());
+ HibernateIdentityObjectAttributeBinaryValue bv = new
HibernateIdentityObjectAttributeBinaryValue((byte[])attribute.getValue());
getHibernateSession(ctx).persist(bv);
storeAttribute.setBinaryValue(bv);
}
@@ -1810,7 +1811,7 @@
}
else if (type.equals(HibernateIdentityObjectAttribute.TYPE_BINARY))
{
- HibernateBinaryValue bv = new
HibernateBinaryValue((byte[])attribute.getValue());
+ HibernateIdentityObjectAttributeBinaryValue bv = new
HibernateIdentityObjectAttributeBinaryValue((byte[])attribute.getValue());
getHibernateSession(ctx).persist(bv);
newAttribute.setBinaryValue(bv);
}
@@ -1959,7 +1960,7 @@
+ type + ". Attribute name: " + name);
}
- HibernateBinaryValue bv = new
HibernateBinaryValue((byte[])attribute.getValue());
+ HibernateIdentityObjectAttributeBinaryValue bv = new
HibernateIdentityObjectAttributeBinaryValue((byte[])attribute.getValue());
getHibernateSession(ctx).persist(bv);
hibernateAttribute.setBinaryValue(bv);
}
@@ -1992,7 +1993,7 @@
values.add((byte[])value);
}
hibernateAttribute = new HibernateIdentityObjectAttribute(hibernateObject,
name, HibernateIdentityObjectAttribute.TYPE_BINARY);
- HibernateBinaryValue bv = new
HibernateBinaryValue((byte[])attribute.getValue());
+ HibernateIdentityObjectAttributeBinaryValue bv = new
HibernateIdentityObjectAttributeBinaryValue((byte[])attribute.getValue());
getHibernateSession(ctx).persist(bv);
hibernateAttribute.setBinaryValue(bv);
}
@@ -2248,7 +2249,7 @@
}
else if (value instanceof byte[])
{
- HibernateBinaryValue bv = new HibernateBinaryValue((byte[])value);
+ HibernateIdentityObjectCredentialBinaryValue bv = new
HibernateIdentityObjectCredentialBinaryValue((byte[])value);
getHibernateSession(ctx).persist(bv);
hibernateCredential.setBinaryValue(bv);
}
Deleted: idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateBinaryValue.hbm.xml
===================================================================
---
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateBinaryValue.hbm.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateBinaryValue.hbm.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping>
- <class
name="org.jboss.identity.idm.impl.model.hibernate.HibernateBinaryValue"
- table="jbid_bin_value">
- <cache usage="read-write"/>
- <id name="id"
- type="java.lang.Long"
- access="field">
- <column name="ATTRIBUTE_ID" />
- <generator class="native"/>
- </id>
- <property name="value"
- type="org.hibernate.type.PrimitiveByteArrayBlobType"
- access="field"
- lazy="true"
- not-null="true">
- <column name="VALUE" length="10240000"/>
- </property>
- </class>
-</hibernate-mapping>
Modified:
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttribute.hbm.xml
===================================================================
---
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttribute.hbm.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttribute.hbm.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -43,16 +43,13 @@
column="ATTR_VALUE"/>
</set>
<many-to-one name="binaryValue"
-
class="org.jboss.identity.idm.impl.model.hibernate.HibernateBinaryValue"
+
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttributeBinaryValue"
not-null="false"
+ column="BIN_VALUE_ID"
+ unique="true"
lazy="proxy"
access="field"
fetch="select"
- cascade="all">
- <column name="BINARY_VALUE"
- not-null="false"/>
- </many-to-one>
-
-
+ cascade="all"/>
</class>
</hibernate-mapping>
Copied:
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml
(from rev 947,
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateBinaryValue.hbm.xml)
===================================================================
---
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml
(rev 0)
+++
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class
name="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttributeBinaryValue"
+ table="jbid_attr_bin_value">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="BIN_VALUE_ID" />
+ <generator class="native"/>
+ </id>
+ <property name="value"
+ type="org.hibernate.type.PrimitiveByteArrayBlobType"
+ access="field"
+ lazy="true"
+ not-null="true">
+ <column name="VALUE" length="10240000"/>
+ </property>
+ </class>
+</hibernate-mapping>
Modified:
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredential.hbm.xml
===================================================================
---
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredential.hbm.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredential.hbm.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -12,16 +12,15 @@
<column name="ID" />
<generator class="native"/>
</id>
- <many-to-one name="binaryValue"
-
class="org.jboss.identity.idm.impl.model.hibernate.HibernateBinaryValue"
+ <many-to-one name="binaryValue"
+
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialBinaryValue"
not-null="false"
+ column="BIN_VALUE_ID"
+ unique="true"
lazy="proxy"
access="field"
fetch="select"
- cascade="all">
- <column name="BINARY_VALUE"
- not-null="false"/>
- </many-to-one>
+ cascade="all"/>
<many-to-one name="identityObject"
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"
access="field"
Copied:
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml
(from rev 947,
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateBinaryValue.hbm.xml)
===================================================================
---
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml
(rev 0)
+++
idm/trunk/idm-hibernate/src/main/resources/mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class
name="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialBinaryValue"
+ table="jbid_creden_bin_value">
+ <cache usage="read-write"/>
+ <id name="id"
+ type="java.lang.Long"
+ access="field">
+ <column name="BIN_VALUE_ID" />
+ <generator class="native"/>
+ </id>
+ <property name="value"
+ type="org.hibernate.type.PrimitiveByteArrayBlobType"
+ access="field"
+ lazy="true"
+ not-null="true">
+ <column name="VALUE" length="10240000"/>
+ </property>
+ </class>
+</hibernate-mapping>
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -95,7 +95,8 @@
List<String> mappings = new LinkedList<String>();
mappings.add("mappings/HibernateIdentityObject.hbm.xml");
- mappings.add("mappings/HibernateBinaryValue.hbm.xml");
+
mappings.add("mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml");
+
mappings.add("mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml");
mappings.add("mappings/HibernateIdentityObjectAttribute.hbm.xml");
mappings.add("mappings/HibernateIdentityObjectCredential.hbm.xml");
mappings.add("mappings/HibernateIdentityObjectCredentialType.hbm.xml");
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/EvilBinaryTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/EvilBinaryTestCase.java 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/EvilBinaryTestCase.java 2009-11-16
09:16:38 UTC (rev 955)
@@ -24,13 +24,10 @@
import org.jboss.identity.idm.impl.model.hibernate.*;
import org.jboss.identity.idm.impl.IdentityTestPOJO;
-import org.jboss.identity.idm.impl.api.PasswordCredential;
import org.jboss.unit.api.pojo.annotations.Destroy;
import org.jboss.unit.api.pojo.annotations.Create;
import org.jboss.unit.api.pojo.annotations.Test;
import org.hibernate.Session;
-import org.hibernate.Query;
-import org.hibernate.criterion.Projection;
import org.hibernate.criterion.Projections;
import java.util.*;
@@ -97,11 +94,11 @@
Random random = new Random();
// Small
- byte[] picture = new byte[4];
+ byte[] picture = new byte[512];
random.nextBytes(picture);
attr = new HibernateIdentityObjectAttribute(user1, "simple2",
HibernateIdentityObjectAttribute.TYPE_BINARY);
- attr.setBinaryValue(new HibernateBinaryValue(picture));
+ attr.setBinaryValue(new HibernateIdentityObjectAttributeBinaryValue(picture));
user1.addAttribute(attr);
commit();
@@ -119,7 +116,7 @@
attr = new HibernateIdentityObjectAttribute(user1, "simple3",
HibernateIdentityObjectAttribute.TYPE_BINARY);
- attr.setBinaryValue(new HibernateBinaryValue(picture));
+ attr.setBinaryValue(new HibernateIdentityObjectAttributeBinaryValue(picture));
user1.getAttributes().add(attr);
commit();
@@ -132,14 +129,14 @@
assertEquals(3, user1.getAttributes().size());
- int binaryCount = ((Integer)session.createCriteria(HibernateBinaryValue.class).
+ int binaryCount =
((Integer)session.createCriteria(HibernateIdentityObjectAttributeBinaryValue.class).
setProjection(Projections.rowCount()).uniqueResult()).intValue();
assertEquals(2,binaryCount);
session.delete(user1);
- binaryCount = ((Integer)session.createCriteria(HibernateBinaryValue.class).
+ binaryCount =
((Integer)session.createCriteria(HibernateIdentityObjectAttributeBinaryValue.class).
setProjection(Projections.rowCount()).uniqueResult()).intValue();
assertEquals(0,binaryCount);
Modified: idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++ idm/trunk/idm-testsuite/src/test/resources/hibernate-jboss-identity.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -48,7 +48,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<!--<mapping
resource="mappings/HibernateRealm.hbm.xml"/>-->
- <!--<mapping
resource="mappings/HibernateBinaryValue.hbm.xml"/>-->
+ <!--<mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>-->
+ <!--<mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObject.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>-->
Modified: idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml
===================================================================
---
idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml 2009-11-16
06:23:40 UTC (rev 954)
+++
idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml 2009-11-16
09:16:38 UTC (rev 955)
@@ -49,7 +49,8 @@
<!-- all nessesary mappings are added programatically to the configuration in
the store-->
<!-- this is for manual SF creation or when 'addHibernateMappings' is
set to false in the store configuration-->
<!--<mapping
resource="mappings/HibernateRealm.hbm.xml"/>-->
- <!--<mapping
resource="mappings/HibernateBinaryValue.hbm.xml"/>-->
+ <!--<mapping
resource="mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml"/>-->
+ <!--<mapping
resource="mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObject.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObjectCredential.hbm.xml"/>-->
<!--<mapping
resource="mappings/HibernateIdentityObjectCredentialType.hbm.xml"/>-->