This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var argumentsRegExp = /\(([\s\S]*?)\)/; | |
var replaceRegExp = /[ ,\n\r\t]+/; | |
module.exports = function (fn) { | |
var fnArguments = argumentsRegExp.exec(fn)[1].trim(); | |
if (0 === fnArguments.length) return []; | |
return fnArguments.split(replaceRegExp); | |
}; | |
//from https://github.com/kilianc/node-introspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean onPreInsert(PreInsertEvent event) { | |
if (false) { | |
return false; | |
} | |
final EntityPersister persister = event.getPersister(); | |
Type[] propertyTypes = persister.getPropertyTypes(); | |
for (int i = 0, len = propertyTypes.length; i < len; i++) { | |
Type type = propertyTypes[i]; | |
if (type instanceof ManyToOneType) { | |
Object value = persister.getPropertyValue(event.getEntity(), i); |