本文整理了Java中org.hibernate.mapping.Formula.<init>()
方法的一些代码示例,展示了Formula.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Formula.<init>()
方法的具体详情如下:
包路径:org.hibernate.mapping.Formula
类名称:Formula
方法名:<init>
暂无
代码示例来源:origin: hibernate/hibernate-orm
public void bindFormulas(
MappingDocument sourceDocument,
List<DerivedValueSource> formulaSources,
OneToOne oneToOneBinding) {
for ( DerivedValueSource formulaSource : formulaSources ) {
oneToOneBinding.addFormula( new Formula( formulaSource.getExpression() ) );
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
public void bindColumnsAndFormulas(
MappingDocument sourceDocument,
List<RelationalValueSource> relationalValueSources,
SimpleValue simpleValue,
boolean areColumnsNullableByDefault,
ColumnNamingDelegate columnNamingDelegate) {
for ( RelationalValueSource relationalValueSource : relationalValueSources ) {
if ( ColumnSource.class.isInstance( relationalValueSource ) ) {
final ColumnSource columnSource = (ColumnSource) relationalValueSource;
bindColumn(
sourceDocument,
columnSource,
simpleValue,
areColumnsNullableByDefault,
columnNamingDelegate
);
}
else {
final DerivedValueSource formulaSource = (DerivedValueSource) relationalValueSource;
simpleValue.addFormula( new Formula( formulaSource.getExpression() ) );
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
public void bind() {
if ( StringHelper.isNotEmpty( formulaString ) ) {
LOG.debugf( "Binding formula %s", formulaString );
formula = new Formula();
formula.setFormula( formulaString );
}
else {
initMappingColumn(
logicalColumnName, propertyName, length, precision, scale, nullable, sqlType, unique, true
);
if ( defaultValue != null ) {
mappingColumn.setDefaultValue( defaultValue );
}
if ( LOG.isDebugEnabled() ) {
LOG.debugf( "Binding column: %s", toString() );
}
}
}
代码示例来源:origin: stackoverflow.com
Formula f = new Formula() {
@Override
public double calculate(int a) {
return sqrt(a * 100);
}
};
代码示例来源:origin: hibernate/hibernate-orm
boolean applyNamingStrategy) {
if ( StringHelper.isNotEmpty( formulaString ) ) {
this.formula = new Formula();
this.formula.setFormula( formulaString );
代码示例来源:origin: hibernate/hibernate-orm
while ( columns.hasNext() ) {
Object current = columns.next();
Formula formula = new Formula();
String formulaString;
if ( current instanceof Column ) {
代码示例来源:origin: org.hibernate/hibernate-annotations
public void bind() {
if ( StringHelper.isNotEmpty( formulaString ) ) {
log.debug( "binding formula {}", formulaString );
formula = new Formula();
formula.setFormula( formulaString );
}
else {
initMappingColumn(
logicalColumnName, propertyName, length, precision, scale, nullable, sqlType, unique, true
);
log.debug( "Binding column: " + toString());
}
}
代码示例来源:origin: stackoverflow.com
Formula callPriceFormula = new Formula() {
@Override
public int compute(int observedCall, int callPrice) {
return callPrice - observedCall;
}
};
Formula putPriceFormula = new Formula() {
@Override
public int compute(int observedCall, int putPrice) {
return observedCall - putPrice;
}
};
代码示例来源:origin: stackoverflow.com
Formula formula = new Formula()
{
//Click here and Press Alt+Insert
}
代码示例来源:origin: stackoverflow.com
var equation = new Formula();
document.querySelector('#sign').addEventListener('change', function(event)
{
equation.updateSign(event);
});
代码示例来源:origin: stackoverflow.com
var equation = new Formula();
document.querySelector('#sign').addEventListener('change', function() {
equation.updateSign(arguments);
});
代码示例来源:origin: org.hibernate/hibernate-annotations
while ( columns.hasNext() ) {
Object current = columns.next();
Formula formula = new Formula();
String formulaString;
if ( current instanceof Column ) {
代码示例来源:origin: org.hibernate/hibernate-annotations
protected void initMappingColumn(
String columnName,
String propertyName,
int length,
int precision,
int scale,
boolean nullable,
String sqlType,
boolean unique,
boolean applyNamingStrategy) {
if ( StringHelper.isNotEmpty( formulaString ) ) {
this.formula = new Formula();
this.formula.setFormula( formulaString );
}
else {
this.mappingColumn = new Column();
redefineColumnName( columnName, propertyName, applyNamingStrategy );
this.mappingColumn.setLength( length );
if ( precision > 0 ) { //revelent precision
this.mappingColumn.setPrecision( precision );
this.mappingColumn.setScale( scale );
}
this.mappingColumn.setNullable( nullable );
this.mappingColumn.setSqlType( sqlType );
this.mappingColumn.setUnique( unique );
}
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
public void bindFormulas(
MappingDocument sourceDocument,
List<DerivedValueSource> formulaSources,
OneToOne oneToOneBinding) {
for ( DerivedValueSource formulaSource : formulaSources ) {
oneToOneBinding.addFormula( new Formula( formulaSource.getExpression() ) );
}
}
}
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
public void bind() {
if ( StringHelper.isNotEmpty( formulaString ) ) {
log.debug( "binding formula " + formulaString );
formula = new Formula();
formula.setFormula( formulaString );
}
else {
initMappingColumn(
logicalColumnName, propertyName, length, precision, scale, nullable, sqlType, unique, true
);
log.debug( "Binding column " + mappingColumn.getName() + " unique " + unique );
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
private static void bindColumnsOrFormula(Element node, SimpleValue simpleValue, String path,
boolean isNullable, Mappings mappings) {
Attribute formulaNode = node.attribute( "formula" );
if ( formulaNode != null ) {
Formula f = new Formula();
f.setFormula( formulaNode.getText() );
simpleValue.addFormula( f );
}
else {
bindColumns( node, simpleValue, isNullable, true, path, mappings );
}
}
代码示例来源:origin: hibernate/hibernate
private static void bindColumnsOrFormula(Element node, SimpleValue simpleValue, String path,
boolean isNullable, Mappings mappings) {
Attribute formulaNode = node.attribute( "formula" );
if ( formulaNode != null ) {
Formula f = new Formula();
f.setFormula( formulaNode.getText() );
simpleValue.addFormula( f );
}
else {
bindColumns( node, simpleValue, isNullable, true, path, mappings );
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
private static void bindColumnsOrFormula(Element node, SimpleValue simpleValue, String path,
boolean isNullable, Mappings mappings) {
Attribute formulaNode = node.attribute( "formula" );
if ( formulaNode != null ) {
Formula f = new Formula();
f.setFormula( formulaNode.getText() );
simpleValue.addFormula( f );
}
else {
bindColumns( node, simpleValue, isNullable, true, path, mappings );
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
public void bind() {
if ( StringHelper.isNotEmpty( formulaString ) ) {
LOG.debugf( "Binding formula %s", formulaString );
formula = new Formula();
formula.setFormula( formulaString );
}
else {
initMappingColumn(
logicalColumnName, propertyName, length, precision, scale, nullable, sqlType, unique, true
);
if ( LOG.isDebugEnabled() ) {
LOG.debugf( "Binding column: %s", toString() );
}
}
}
代码示例来源:origin: stackoverflow.com
String filename = "C:\\input.xls";
WorkbookSettings ws = new WorkbookSettings();
ws.setLocale(new Locale("en", "EN"));
WritableWorkbook workbook =
Workbook.createWorkbook(new File(filename), ws);
WritableSheet s = workbook.createSheet("Input", 0);
WritableSheet s1 = workbook.createSheet("Output", 1);
s1.addCell(new Number(3, 0, 5));
s1.addCell(new Number(3, 1, 6));
s1.addCell(new Number(3, 2, 1));
s1.addCell(new Number(3, 3, 6));
s1.addCell(new Number(3, 4, 1));
Formula formula = new Formula(3,5,"AVERAGE(D1:D5)");
s.addCell(formula);
内容来源于网络,如有侵权,请联系作者删除!