Class RUtil
- java.lang.Object
-
- com.evolveum.midpoint.repo.sql.util.RUtil
-
public final class RUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
COLUMN_LENGTH_OID
This constant is used for oid column size in database.static int
COLUMN_LENGTH_QNAME
static String
QNAME_DELIMITER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
computeChecksum(byte[]... objects)
static void
copyResultFromJAXB(QName itemName, OperationResultType jaxb, OperationResult repo, PrismContext prismContext)
static void
executeStatement(Connection connection, String sql)
static void
fixCompositeIDHandling(org.hibernate.SessionFactory sessionFactory)
This method is used to override "hasIdentifierMapper" in EntityMetaModels of entities which have composite id and class defined for it.static String
fixDBSchemaObjectNameLength(String input)
static byte[]
getBytesFromSerializedForm(String serializedForm, boolean compress)
static String
getDebugString(RObject object)
static Integer
getIntegerFromString(String val)
static <C,T extends SchemaEnum<C>>
TgetRepoEnumValue(C object, Class<T> type)
static String
getSerializedFormFromBytes(byte[] array)
static String
getSerializedFormFromBytes(byte[] array, boolean useUtf16)
static String
getTableName(Class<?> hqlType, org.hibernate.Session session)
static REmbeddedReference
jaxbRefToEmbeddedRepoRef(ObjectReferenceType jaxb, RelationRegistry relationRegistry)
static <T extends RObject>
RObjectReference<T>jaxbRefToRepo(ObjectReferenceType reference, RObject owner, RReferenceType refType, RelationRegistry relationRegistry)
static Set<RPolyString>
listPolyToSet(List<PolyStringType> list)
static <T> Set<T>
listToSet(List<T> list)
static @NotNull String
qnameToString(QName qname)
static void
revive(Objectable object, PrismContext prismContext)
static ItemName
stringToQName(String text)
static Integer
toInteger(Long l)
static Long
toLong(Integer i)
static List<ObjectReferenceType>
toObjectReferenceTypeList(Set<? extends RObjectReference<?>> set)
static <T extends RObject>
Set<RObjectReference<T>>toRObjectReferenceSet(List<ObjectReferenceType> list, RObject owner, RReferenceType refOwner, RelationRegistry relationRegistry)
static @Nullable String
trimString(@Nullable String value, int size)
-
-
-
Field Detail
-
COLUMN_LENGTH_QNAME
public static final int COLUMN_LENGTH_QNAME
- See Also:
- Constant Field Values
-
QNAME_DELIMITER
public static final String QNAME_DELIMITER
- See Also:
- Constant Field Values
-
COLUMN_LENGTH_OID
public static final int COLUMN_LENGTH_OID
This constant is used for oid column size in database.- See Also:
- Constant Field Values
-
-
Method Detail
-
revive
public static void revive(Objectable object, PrismContext prismContext) throws DtoTranslationException
- Throws:
DtoTranslationException
-
listPolyToSet
public static Set<RPolyString> listPolyToSet(List<PolyStringType> list)
-
toObjectReferenceTypeList
public static List<ObjectReferenceType> toObjectReferenceTypeList(Set<? extends RObjectReference<?>> set)
-
toRObjectReferenceSet
public static <T extends RObject> Set<RObjectReference<T>> toRObjectReferenceSet(List<ObjectReferenceType> list, RObject owner, RReferenceType refOwner, RelationRegistry relationRegistry)
-
jaxbRefToRepo
public static <T extends RObject> RObjectReference<T> jaxbRefToRepo(ObjectReferenceType reference, RObject owner, RReferenceType refType, RelationRegistry relationRegistry)
-
jaxbRefToEmbeddedRepoRef
public static REmbeddedReference jaxbRefToEmbeddedRepoRef(ObjectReferenceType jaxb, RelationRegistry relationRegistry)
-
fixCompositeIDHandling
public static void fixCompositeIDHandling(org.hibernate.SessionFactory sessionFactory)
This method is used to override "hasIdentifierMapper" in EntityMetaModels of entities which have composite id and class defined for it. It's workaround for bug as found in forum https://forum.hibernate.org/viewtopic.php?t=978915&highlight=
-
copyResultFromJAXB
public static void copyResultFromJAXB(QName itemName, OperationResultType jaxb, OperationResult repo, PrismContext prismContext) throws DtoTranslationException
- Throws:
DtoTranslationException
-
computeChecksum
public static String computeChecksum(byte[]... objects)
-
getRepoEnumValue
public static <C,T extends SchemaEnum<C>> T getRepoEnumValue(C object, Class<T> type)
-
getBytesFromSerializedForm
public static byte[] getBytesFromSerializedForm(String serializedForm, boolean compress)
-
getSerializedFormFromBytes
public static String getSerializedFormFromBytes(byte[] array)
-
getSerializedFormFromBytes
public static String getSerializedFormFromBytes(byte[] array, boolean useUtf16)
-
trimString
@Nullable public static @Nullable String trimString(@Nullable @Nullable String value, int size)
-
executeStatement
public static void executeStatement(Connection connection, String sql) throws SQLException
- Throws:
SQLException
-
-