Skip to content

Instantly share code, notes, and snippets.

View dipold's full-sized avatar

Rafael Dipold dipold

  • @Prevtudo
  • Mal. C. Rondon - PR - Brazil
View GitHub Profile
@dipold
dipold / Unit1.dfm
Created September 11, 2018 13:00
FastReport Example: Display data in TfrxReport from Business Object using TfrxUserDataSet
object Form1: TForm1
Left = 0
Top = 0
Caption = 'Form1'
ClientHeight = 242
ClientWidth = 472
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
@dipold
dipold / CORSController.java
Last active September 21, 2020 13:44
CORS in VRaptor 4
import java.util.Set;
import javax.inject.Inject;
import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Options;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.controller.HttpMethod;
import br.com.caelum.vraptor.core.RequestInfo;
import br.com.caelum.vraptor.http.route.Router;
import java.lang.reflect.Type;
import org.hibernate.proxy.HibernateProxy;
import com.google.gson.JsonElement;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
public class HibernateProxySerializer implements JsonSerializer<HibernateProxy> {
@dipold
dipold / MultiTenantProvider.java
Last active May 29, 2024 18:47
Hibernate 4 Multitenancy with postgresql implementation example
package yourpackage.util.hibernate.multitenancy;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;
import org.hibernate.HibernateException;
import org.hibernate.service.config.spi.ConfigurationService;
import org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider;
import org.hibernate.service.jdbc.connections.spi.MultiTenantConnectionProvider;