本文整理了Java中org.hibernate.criterion.Example.<init>()
方法的一些代码示例,展示了Example.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Example.<init>()
方法的具体详情如下:
包路径:org.hibernate.criterion.Example
类名称:Example
方法名:<init>
[英]Allow subclasses to instantiate as needed.
[中]允许子类根据需要实例化。
代码示例来源:origin: hibernate/hibernate-orm
/**
* Create a new Example criterion instance, which includes all non-null properties by default
*
* @param exampleEntity The example bean to use.
*
* @return a new instance of Example
*/
public static Example create(Object exampleEntity) {
if ( exampleEntity == null ) {
throw new NullPointerException( "null example entity" );
}
return new Example( exampleEntity, NotNullPropertySelector.INSTANCE );
}
代码示例来源:origin: stackoverflow.com
function Emitter() {
var eventTarget = document.createDocumentFragment()
function delegate(method) {
this[method] = eventTarget[method].bind(eventTarget)
}
[
"addEventListener",
"dispatchEvent",
"removeEventListener"
].forEach(delegate, this)
}
// sample class to use it
function Example() {
Emitter.call(this)
}
// run it
var e = new Example()
e.addEventListener("something", function(event) {
console.log(event)
})
e.dispatchEvent(new Event("something"))
代码示例来源:origin: stackoverflow.com
public class ExampleProvider implements Provider<Example> {
@AOPExample
public Example get() {
System.out.println("Building...");
return new Example();
}
}
代码示例来源:origin: stackoverflow.com
public class MyMainClass {
public static void main(final String[] args) {
final MyMainClass clazz = new MyMainClass();
clazz.echo(new Example());
}
public Example echo(@Valid final Example example) {
// ...
}
}
代码示例来源:origin: stackoverflow.com
function Example() {
var someVar = something;
var moreState = initializedToSomethingElse;
this.verifySomething(); // <== Works
}
Example.prototype.verifySomething = function() {
// do verify stuff
};
var e = new Example();
代码示例来源:origin: stackoverflow.com
function Example(data) {
var privateData = data;
Example.prototype.doSomethingWithPrivateData = function() {
console.log(privateData);
};
}
var e1 = new Example(1);
e1.doSomethingWithPrivateData(); // "1"
var e2 = new Example(2);
e2.doSomethingWithPrivateData(); // "2"
代码示例来源:origin: stackoverflow.com
import foo.*:
import bar.*:
class MyClass {
void someMethod() {
// Assume that this class is from the "foo" librariy, and the
// fully qualified name of this class is "foo.Example"
Example e = new Example();
}
}
代码示例来源:origin: stackoverflow.com
var Example = (function() {
function Example() {
var someVar = something;
var moreState = initializedToSomethingElse;
this.verifySomething(); // <== Works
}
Example.prototype.verifySomething = function() {
// do verify stuff
};
return Example;
})();
var e = new Example();
代码示例来源:origin: stackoverflow.com
(function() {
var problem = new Example();
$("#sign").change(problem.newSign.bind(problem));
$(".number").change(problem.newNumber.bind(problem));
})();
代码示例来源:origin: stackoverflow.com
package CallBefore;
public class Main {
public static void main(String[] args) {
ExampleInterface proxy = ExampleProxy.newInstance(new Example());
proxy.function1();
proxy.function2();
proxy.otherFunction();
proxy.refresh();
}
}
代码示例来源:origin: stackoverflow.com
var Example = function () {
this.prop1 = "test1";
this.prop2 = "test2"
};
var newObj2 = new Example();
代码示例来源:origin: stackoverflow.com
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
Fragment fragment= new Example();
FragmentManager fm = getFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.replace(R.id.main_fragment, fragment, fragment.getClass().getName());
ft.addToBackStack(fragment.getClass().getName());
ft.commit();
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
/**
* Create a new instance, which includes all non-null properties
* by default
* @param entity
* @return a new instance of <tt>Example</tt>
*/
public static Example create(Object entity) {
if (entity==null) throw new NullPointerException("null example");
return new Example(entity, NOT_NULL);
}
代码示例来源:origin: hibernate/hibernate
/**
* Create a new instance, which includes all non-null properties
* by default
* @param entity
* @return a new instance of <tt>Example</tt>
*/
public static Example create(Object entity) {
if (entity==null) throw new NullPointerException("null example");
return new Example(entity, NOT_NULL);
}
代码示例来源:origin: stackoverflow.com
Example ee=new Example();
FileInputStream in=new FileInputStream("hyxa_code.txt");
ObjectInputStream o=new ObjectInputStream(in);
ee=(Example)o.readObject();
System.out.println("The vlaue of i,j:"+ee.i+" "+ee.j);
代码示例来源:origin: stackoverflow.com
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(Example.class, new ExampleTypeAdapter());
gsonBuilder.setPrettyPrinting();
Gson gson = gsonBuilder.create();
Example example = new Example();
example.title = "mytitle";
example.id = 1234;
example.userId = 0;
final String json = gson.toJson(example);
System.out.println(json);
代码示例来源:origin: stackoverflow.com
@Test
public void testMethod() {
int something = 0;
Foo mockFoo = mock(Foo.class, RETURNS_DEEP_STUBS);
when(mockFoo.doSomething()).thenReturn(something);
assertEquals(new Example().method(mockFoo), something);
verify(mockFoo);
}
代码示例来源:origin: stackoverflow.com
public static void main(String[] args) {
Example sharedData = new Example();
for (int i = 0; i < 1000; i++)
sharedData.increment();
System.out.println("Incrementer finished");
for (int i = 0; i < 1000; i++)
sharedData.decrement();
System.out.println("Decrementer finished");
System.out.println(sharedData.count);
}
代码示例来源:origin: stackoverflow.com
Example e1 = new Example();
Example e2 = new Example();
e2.setNumber(3);
e1.setNumber(5);
System.out.println(e2.getNumber()); // surprise! prints 5,
代码示例来源:origin: stackoverflow.com
Example e = new Example();
// do lots of stuff
e.setId(12345L);
e.build();
// at this point, e is immutable
内容来源于网络,如有侵权,请联系作者删除!