File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToOneDescriptor.java | 29 |
org/kuali/rice/core/framework/persistence/jpa/metadata/ObjectDescriptor.java | 117 |
sb.append("ObjectDescriptor = [ ");
sb.append("targetEntity:").append(targetEntity.getName()).append(", ");
sb.append("cascade = { ");
for (CascadeType ct : cascade) {
sb.append(ct).append(" ");
}
sb.append("}, ");
sb.append("fetch:").append(fetch).append(", ");
sb.append("optional:").append(optional);
if (!joinColumnDescriptors.isEmpty()) {
sb.append(", join columns = { ");
for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) {
sb.append(" jc = { ");
sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
sb.append(" }");
}
sb.append(" } ");
}
sb.append(" ]");
return sb.toString();
}
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/type/HibernateKualiEncryptDecryptUserType.java | 34 |
org/kuali/rice/core/framework/persistence/jpa/type/KualiDecimalIntegerPercentFieldType.java | 34 |
public class KualiDecimalIntegerPercentFieldType extends HibernateImmutableValueUserType implements UserType {
/**
* Retrieves a value from the given ResultSet and decrypts it
*
* @see org.hibernate.usertype.UserType#nullSafeGet(java.sql.ResultSet, java.lang.String[], java.lang.Object)
*/
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
String value = rs.getString(names[0]);
String converted = null;
if (value != null) {
try {
converted = CoreApiServiceLocator.getEncryptionService().decrypt(value);
}
catch (GeneralSecurityException gse) {
throw new RuntimeException("Unable to decrypt value from db: " + gse.getMessage());
}
if (converted == null) {
converted = value;
}
}
return converted;
}
/**
* Encrypts the value if possible and then sets that on the PreparedStatement
*
* @see org.hibernate.usertype.UserType#nullSafeSet(java.sql.PreparedStatement, java.lang.Object, int)
*/
public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
String converted = null;
if (value != null) {
try {
converted = CoreApiServiceLocator.getEncryptionService().encrypt(value);
}
catch (GeneralSecurityException gse) {
throw new RuntimeException("Unable to encrypt value to db: " + gse.getMessage());
}
}
if (converted == null) {
st.setNull(index, Types.VARCHAR);
} else {
st.setString(index, converted);
}
}
/**
* Returns String.class
*
* @see org.hibernate.usertype.UserType#returnedClass()
*/
public Class returnedClass() {
return String.class;
}
/**
* Returns an array with the SQL VARCHAR type as the single member
*
* @see org.hibernate.usertype.UserType#sqlTypes()
*/
public int[] sqlTypes() {
return new int[] { Types.VARCHAR };
}
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToOneDescriptor.java | 38 |
org/kuali/rice/core/framework/persistence/jpa/metadata/OneToOneDescriptor.java | 53 |
if (!joinColumnDescriptors.isEmpty()) {
sb.append(", join columns = { ");
for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) {
sb.append(" jc = { ");
sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
sb.append(" }");
}
sb.append(" } ");
}
sb.append(" ]");
return sb.toString();
}
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/type/HibernateKualiIntegerPercentFieldType.java | 46 |
org/kuali/rice/core/framework/persistence/jpa/type/HibernateKualiPercentFieldType.java | 48 |
if (source != null && source instanceof BigDecimal) {
BigDecimal converted = (BigDecimal) source;
// Once we have converted, we need to convert again to KualiPercent.
KualiPercent percentConverted = new KualiPercent((BigDecimal) converted);
return percentConverted;
}
else {
return null;
}
}
/**
* This overridden method ...
*
* @see HibernateImmutableValueUserType#nullSafeSet(java.sql.PreparedStatement, java.lang.Object, int)
*/
@Override
public void nullSafeSet(PreparedStatement st, Object source, int index)
throws HibernateException, SQLException {
Object converted = source;
if (source instanceof KualiPercent) {
converted = ((KualiPercent) source).bigDecimalValue();
}
if (converted == null) {
st.setNull(index, Types.DECIMAL);
} else {
st.setBigDecimal(index, ((BigDecimal)converted));
}
}
/**
* This overridden method ...
*
* @see HibernateImmutableValueUserType#returnedClass()
*/
public Class returnedClass() {
return BigDecimal.class;
}
/**
* Returns an array with the SQL VARCHAR type as the single member
*
* @see org.hibernate.usertype.UserType#sqlTypes()
*/
public int[] sqlTypes() {
return new int[] { Types.DECIMAL };
}
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 110 |
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 163 |
final Object value = field.get(owner);
if (value != null) {
final Field fieldToSet = getField(pkObject.getClass(), fieldDescriptor.getName());
fieldToSet.setAccessible(true);
fieldToSet.set(pkObject, value);
}
}
return pkObject;
} catch (SecurityException se) {
LOG.error(se.getMessage(), se);
} catch (InstantiationException ie) {
LOG.error(ie.getMessage(), ie);
} catch (IllegalAccessException iae) {
LOG.error(iae.getMessage(), iae);
} catch (NoSuchFieldException nsfe) {
LOG.error(nsfe.getMessage(), nsfe);
}
} else {
for (FieldDescriptor fieldDescriptor : descriptor.getPrimaryKeys()) {
try {
Field field = getField(owner.getClass(), fieldDescriptor.getName()); |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToManyDescriptor.java | 53 |
org/kuali/rice/core/framework/persistence/jpa/metadata/OneToOneDescriptor.java | 51 |
sb.append(", mappedBy:").append(mappedBy);
}
if (!joinColumnDescriptors.isEmpty()) {
sb.append(", join columns = { ");
for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) {
sb.append(" jc = { ");
sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
sb.append(" }");
}
sb.append(" } ");
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToManyDescriptor.java | 55 |
org/kuali/rice/core/framework/persistence/jpa/metadata/ObjectDescriptor.java | 126 |
if (!joinColumnDescriptors.isEmpty()) {
sb.append(", join columns = { ");
for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) {
sb.append(" jc = { ");
sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
sb.append(" }");
}
sb.append(" } ");
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToManyDescriptor.java | 70 |
org/kuali/rice/core/framework/persistence/jpa/metadata/ObjectDescriptor.java | 128 |
for (JoinColumnDescriptor joinColumnDescriptor : joinColumnDescriptors) {
sb.append(" jc = { ");
sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
sb.append(" }");
}
sb.append(" } ");
}
sb.append(" ]");
return sb.toString();
}
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jdbc/sql/SQLUtils.java | 201 |
org/kuali/rice/core/framework/persistence/jdbc/sql/SQLUtils.java | 221 |
if (util.group(1).length() < 2) {
monthBuf.append("0").append(util.group(1));
} else {
monthBuf.append(util.group(1));
}
if (util.group(2).length() < 2) {
dateBuf.append("0").append(util.group(2));
} else {
dateBuf.append(util.group(2));
}
return new DateComponent(yearBuf.toString(), monthBuf.toString(), dateBuf.toString());
// small date format yyyy/M/d | yyyy/MM/dd | yyyy-M-d | yyyy-MM-dd
} else if (regexSplitExpression.equals(DATE_REGEX_SMALL_FOUR_DIGIT_YEAR_FIRST_SPLIT)) { |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 453 |
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 547 |
}
//descriptor.addFkField(entityDescriptor.getFieldByColumnName(jc.name()).getName());
//descriptor.addFkField(entitesByClass.get(field.getType()).getFieldByColumnName(jc.name()).getName());
descriptor.setInsertable(jc.insertable());
descriptor.setUpdateable(jc.updatable());
}
if (field.isAnnotationPresent(JoinColumns.class)) {
JoinColumns jcs = field.getAnnotation(JoinColumns.class);
for (JoinColumn jc : jcs.value()) {
descriptor.addJoinColumnDescriptor(constructJoinDescriptor(jc));
descriptor.addFkField(entityDescriptor.getFieldByColumnName(jc.name()).getName());
descriptor.setInsertable(jc.insertable());
descriptor.setUpdateable(jc.updatable());
}
}
entityDescriptor.add(descriptor);
}
if (field.isAnnotationPresent(ManyToMany.class)) { |
File | Line |
---|
org/kuali/rice/core/framework/persistence/platform/MySQLDatabasePlatform.java | 62 |
org/kuali/rice/core/framework/persistence/platform/OracleDatabasePlatform.java | 75 |
statement = connection.prepareStatement("select " + sequenceName + ".nextval from dual");
resultSet = statement.executeQuery();
if (!resultSet.next()) {
throw new RuntimeException("Error retrieving next option id for action list from sequence.");
}
return new Long(resultSet.getLong(1));
} catch (SQLException e) {
throw new RuntimeException("Error retrieving next option id for action list from sequence.", e);
} catch (LookupException e) {
throw new RuntimeException("Error retrieving next option id for action list from sequence.", e);
} finally {
if (statement != null) {
try {
statement.close();
} catch (SQLException e) {
}
}
if (resultSet != null) {
try {
resultSet.close();
} catch (SQLException e) {
}
}
}
}
public String getLockRouteHeaderQuerySQL(String documentId, boolean wait) { |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToManyDescriptor.java | 57 |
org/kuali/rice/core/framework/persistence/jpa/metadata/ManyToManyDescriptor.java | 70 |
for (JoinColumnDescriptor joinColumnDescriptor : inverseJoinColumnDescriptors) {
sb.append(" jc = { ");
sb.append("name:").append(joinColumnDescriptor.getName()).append(", ");
sb.append("insertable:").append(joinColumnDescriptor.isInsertable()).append(", ");
sb.append("nullable:").append(joinColumnDescriptor.isNullable()).append(", ");
sb.append("unique:").append(joinColumnDescriptor.isUnique()).append(", ");
sb.append("updateable:").append(joinColumnDescriptor.isUpdateable());
sb.append(" }");
}
sb.append(" } ");
} |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 472 |
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 567 |
ManyToMany relation = field.getAnnotation(ManyToMany.class);
descriptor.setAttributeName(field.getName());
if (relation.targetEntity().equals(void.class)) {
descriptor.setTargetEntity((Class)((ParameterizedType)field.getGenericType()).getActualTypeArguments()[0]);
} else {
descriptor.setTargetEntity(relation.targetEntity());
fieldDescriptor.setTargetClazz(relation.targetEntity());
}
descriptor.setCascade(relation.cascade());
descriptor.setFetch(relation.fetch());
descriptor.setMappedBy(relation.mappedBy()); |
File | Line |
---|
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 455 |
org/kuali/rice/core/framework/persistence/jpa/metadata/MetadataManager.java | 601 |
descriptor.setInsertable(jc.insertable());
descriptor.setUpdateable(jc.updatable());
}
if (field.isAnnotationPresent(JoinColumns.class)) {
JoinColumns jcs = field.getAnnotation(JoinColumns.class);
for (JoinColumn jc : jcs.value()) {
descriptor.addJoinColumnDescriptor(constructJoinDescriptor(jc));
descriptor.addFkField(entityDescriptor.getFieldByColumnName(jc.name()).getName());
descriptor.setInsertable(jc.insertable());
descriptor.setUpdateable(jc.updatable());
}
} |